Page 1 of 1

How do I define output size for .PDF /w PXC_GetContextDC

Posted: Wed Mar 18, 2015 2:26 pm
by sjrogers
I am trying to use the PDF Tools SDK to create a PDF file from my application. My approach has been to use PXC_GetContentDC, create a device context, render to the DC, end up with the .PDF. With some help from the forums, I have all of this working. My issue now is that I have to have an existing Device Context that is the same size of what I want to create the .PDF file. I have just been using existing printers to create a Print DC, then use that as the source to the PXC_GetContentDC. I know I can leave the source DC as NULL, but this just mimics the screen.

Is there a way to specify a desired output size for the .PDF without having a pre-existing Device Context of that kind? For example, I want to create an E Size .PDF, but I don't have a local E Size printer to create a Device Context from. I see that I can specify the page size with PXC_AddPage, but this seems to be overwritten when I do PXC_GetContentDC.

Am I missing something here as to what I should do to specify my desired output size, or do I need to try a different approach such as the PDF-XChange Drivers API?

Re: How do I define output size for .PDF /w PXC_GetContextDC

Posted: Wed Mar 18, 2015 3:49 pm
by Tracker Supp-Stefan
Hello sjrogers,

Looking at this:
http://stackoverflow.com/questions/1527 ... ce-context
It might not be too easy to create your own DC with the desired size, so probably going through the printing drivers API will be the easier solution for you.

Regards,
Stefan