Determining Paper Size
Posted: Tue Jul 11, 2017 4:51 pm
Hello,
How do you determine the page size for a PDF document. In the class wxPrintData, there's a wxSize variable m_paperSize that's
initialized to -1, -1. After setting the paper type and orientation using the page setup dialog, this variable is not updated
but it is updated when printing to a Printer. Also, the wxPdfPrintData object doesn't have a paper size variable, not sure why.
Here's a snippet of code we're using:
When we use a wxPrinter object instead of a wxPdfPrinter object, the paper size is initialized.
Is this by design and if so how does the wxPdfDC know the size of the paper it's printing on.
Thanks.
Windows 7, Visual Studio 2015
How do you determine the page size for a PDF document. In the class wxPrintData, there's a wxSize variable m_paperSize that's
initialized to -1, -1. After setting the paper type and orientation using the page setup dialog, this variable is not updated
but it is updated when printing to a Printer. Also, the wxPdfPrintData object doesn't have a paper size variable, not sure why.
Here's a snippet of code we're using:
Code: Select all
wxPrintData &printData = GetPrintData() ; // Stored in the frame class
wxPrintDialogData initPrintDialogData(printData);
wxPdfPrinter printer(&initPrintDialogData);
if( !printer.PrintDialog(pFrame) )
{
return ;
}
wxPageSetupDialogData &pageSetupDialogData = GetPageSetupDialogData() ; // Stored in the frame class
wxPdfPageSetupDialog setupDialog(pFrame, &pageSetupDialogData);
if( setupDialog.ShowModal() != wxID_OK )
{
return ;
}
wxPrintData &printData = setupDialog.GetPageSetupData().GetPrintData();
Is this by design and if so how does the wxPdfDC know the size of the paper it's printing on.
Thanks.
Windows 7, Visual Studio 2015