I have a PDF file that is created via the PrintDocument object in my desktop application.
I set the page orientation to be portrait or landscape depending on the needs.
If the user chooses to "Print" to a PDF printer (Cute PDF, Bullzip, Microsoft Print to PDF) the output goes to a PDF file. If the user chooses to print directly to a printer, the output goes to the printer.
I then create the document
Here's the problem:
If the user chooses to "print" to a PDF printer and the user opens the document (in either Acrobat Reader or programmatically using a PDF Viewer form with an embedded AxAcroPDF object that is part of my application), the print dialog always opens with the print orientation Portrait regardless of the setting of the PDF document. If you look at the attached screenshot, you can clearly see that the document is meant to be landscape
Here is a code snippet of how I tell PrintDocument the orientation:
Public oPrintDialog as System.Windows.Forms.PrintDialog = new System.Windows.Forms.PrintDialog ()
Public oPrintDocument as System.Drawing.Printing.PrintDocument = new System.Drawing.Printing.PrintDocument ()
oPrintDialog.PrinterSettings.DefaultPageSettings.Landscape = True
oPrintDialog.PrinterSettings.PrinterName = oPS.strChosenPrinter ' The printer that the user picked
oPrintDialog.PrinterSettings.PrintFileName = strFullPath ' The output file name
oPrintDocument.PrinterSettings = oPrintDialog.PrinterSettings
So, what else do I have to do such that the page orientation that is set in my code can be seen by the PDF viewer??
Thanks in advance,
Jerry
Jerry Scannell
I set the page orientation to be portrait or landscape depending on the needs.
If the user chooses to "Print" to a PDF printer (Cute PDF, Bullzip, Microsoft Print to PDF) the output goes to a PDF file. If the user chooses to print directly to a printer, the output goes to the printer.
I then create the document
Here's the problem:
If the user chooses to "print" to a PDF printer and the user opens the document (in either Acrobat Reader or programmatically using a PDF Viewer form with an embedded AxAcroPDF object that is part of my application), the print dialog always opens with the print orientation Portrait regardless of the setting of the PDF document. If you look at the attached screenshot, you can clearly see that the document is meant to be landscape
Here is a code snippet of how I tell PrintDocument the orientation:
Public oPrintDialog as System.Windows.Forms.PrintDialog = new System.Windows.Forms.PrintDialog ()
Public oPrintDocument as System.Drawing.Printing.PrintDocument = new System.Drawing.Printing.PrintDocument ()
oPrintDialog.PrinterSettings.DefaultPageSettings.Landscape = True
oPrintDialog.PrinterSettings.PrinterName = oPS.strChosenPrinter ' The printer that the user picked
oPrintDialog.PrinterSettings.PrintFileName = strFullPath ' The output file name
oPrintDocument.PrinterSettings = oPrintDialog.PrinterSettings
So, what else do I have to do such that the page orientation that is set in my code can be seen by the PDF viewer??
Thanks in advance,
Jerry
Jerry Scannell