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

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
sjrogers
User
Posts: 10
Joined: Tue Mar 03, 2015 8:38 pm

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

Post 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?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17818
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

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

Post 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
Post Reply