#1 PDF Engine » Userdefined PDF page sizes » 2010-08-25 08:46:32

J Clement
Replies: 1

I am using 1.8.8 and have a problem with user defined page sizes.
I sometimes need to generate landscape PDF files. Previously (with another PDF tool) I set the page to A4, then read the width and height, and swapped these using the user defined page size.
The problem I have is that the size of the page does not appear to work properly.
I created a PdfDocumentGDI, set DefaultPageSize to psA4 and then read DefaultPageWidth and height.
I added a page with AddPage and read the VCLCanvasSize. Width=595, height=842
I then draw a line on the VCLCanvas from 10,10 to (width-10,Height-10) which draws a short line which ends in the middle of the page.
If I draw a line from 10,10 to 790,1120 then this draws from top left to bottom right on the page.
Why do I not get the correct width/height values from the VCLCanvas or from the page/document ?
How do I get the drawing limits I can use to draw on the page ?
I tried setting the default values but this also does not always seem to work. I seem to be able to set then to larger values but swapping width and height does not seem to work.

I may just be missing something. I have spent some time trying to figure out how to use the PDF engine. I still have not managed to get the non-VCLCanvas version to work. I looked at all the forum posts and learned a lot from them but I would appreciate a few very simple examples of how best to put text and an image on a PDF page using the different modes available in PDF Engine. I am sure that such examples would also help others get started with the PDF engine.
Thanks.

Board footer

Powered by FluxBB