wxPdfDocument - draw text Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

wxPdfDocument - draw text

Post by wxProgrammer »

Hi! How can I draw this page? (A4)

Code: Select all

 ________
|text   |
|       |
|_______|
|text   |
|       |
|_______|
The text is equal in both sides.
I have to draw two pages A5 but they must be in the same page A4. How can I find the center of the page?
I'm Italian but we can speak C++ :)
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDocument - draw text

Post by utelle »

wxProgrammer wrote:Hi! How can I draw this page? (A4)

Code: Select all

 ________
|text   |
|       |
|_______|
|text   |
|       |
|_______|
The text is equal in both sides.
I have to draw two pages A5 but they must be in the same page A4. How can I find the center of the page?
The wxPdfDocument class has method GetPageHeight to determine the height of the page in user units (as selected on creating the class instance). Dividing the page height by 2 will give you the offset in vertical direction from the top to the lower A5 sized part of the page. You may then use method SetY or SetXY to move the current position to the new position. Then you can repeat the output steps you did for the upper A5 page. Please keep in mind that you have to handle the top margin for the lower A5 page yourself.

Alternatively you could create a template of your A5 page and insert it 2 times on an A4 page (see methods BeginTemplate, EndTemplate, UseTemplate). This would usually result in smaller PDF files.

Regards,

Ulrich
wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: wxPdfDocument - draw text

Post by wxProgrammer »

Oh, thank you! I think that I'll use UseTemplate ecc... :)
I'm Italian but we can speak C++ :)
Post Reply