Print document with mixed orientation

I have tried unsuccessfully to print a pdf document containing portrait and landscape pages correctly using the pdfviewer. The PrinterSettings.PageOrientation is set to Auto. However, the document always prints in portrait which is the orientation of the first page. I have attached a sample document for your reference.


3 Replies

DG Deepak Gunasekaran Syncfusion Team August 7, 2020 08:53 PM UTC

Hi Frederick 
 
We have tested the attached PDF document, printed it using the PdfViewer with the printer settings as Auto and it is worked as expected in our side. The page content is oriented properly based on the selected printer page setup and the output file can be downloaded from the following location. 
 
  
When you set the printer settings to Auto it will automatically select the best orientation for the page content based on the output paper and orients the content accordingly. It will not change the preferences of the printer that you are using. To manually change the paper orientation in the printer preferences, we need to set the printer settings as portrait / landscape as you said. We are following the similar behavior of Adobe PDF printing in our PDF Viewer and we could see the same behavior in Adobe too. We have attached the printed output of Adobe in the following location. 
 
 
Kindly let us know if you have any concerns or getting different behavior other than the mentioned above with some more details. This will be helpful for us to analyze more and assist you better. 
 
Regards, 
Deepak G 



FS Frederick Sheriffs August 8, 2020 03:24 PM UTC

I have printed the document to Microsoft PDF printer, Adobe PDF printer and my Cannon Laserjet printer. From the PDFViewer they all print the same with the second page in portrait instead landscape. When I print from Acrobat, all three printers print correctly. Unless there is a specific version you fixed this functionality in, a piece of code I am missing, it does not currently work as intended. On the print dialog box you can only select Portrait or Landscape. There is no mixed mode (portrait/landscape). It is the same with adobe print dialog box. However, Adobe works correctly. I will have to find another way to print my documents. 

Edit: The setting necessary to make the document print correctly is this:

pdfviewer1.RenderingEngine = PdfRenderingEngine.SfPdf;

It does not print correctly using the default engine. Please remove the attachments from this post.


VS Vikas Sekar Syncfusion Team August 10, 2020 05:29 PM UTC

Hi Frederick  
   
On analyzing with the provided details,  we are able to create the printed output from Adobe as the source document with respective page orientation, only when we enable the 'Choose paper source by PDF page size' option in Adobe's print dialog box. Currently, in PdfViewer we don't have an option to set paper source by PDF page size. 
 
Also currently PdfViewer's printed output documents for both Pdfium and SfPdf renders have the same behavior, as similar to the Adobe's printed output without enabling the 'Choose paper source by PDF page size' option. But as you have mentioned in the previous update, that by setting SfPdf render change the printed output. Will you please share the  PdfViewer version details, so it will be helpful for us to analyze more and assist you better.  
  
Regards,  
Vikas 


Loader.
Up arrow icon