Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Apr 26, 2016 2:39 pm

I am trying to print a Pdf that uses landscape orientation, and use Ariel embedded font. The page size is Letter, and that is what the printer is using.

If I save the PDF and print it with Foxit, the document prints correctly.

This is my print code.

Code: Select all
PDF_Report_Generator gen = new PDF_Report_Generator();

   using (PdfDocument document = gen.Generate(report))
   {

      Log.Information("Printing {0}",report.serial);

      document.PageScaling = PdfPrintPageScaling.ShrinkOversized;

      document.PrintDocument.Print();
      
      Log.Information("Printing Done");
   }   


What the document should look like, and what is actually printed are attached
Pdf Samples.zip
Last edited by [email protected] on Wed Apr 27, 2016 2:25 pm, edited 1 time in total.

[email protected]
 
Posts: 6
Joined: Sat Apr 16, 2016 11:06 pm

Tue Apr 26, 2016 8:45 pm

Really no help?

Sample-WhatIsPrinted.jpg

Sample-WhatShouldBePrinted.jpg

[email protected]
 
Posts: 6
Joined: Sat Apr 16, 2016 11:06 pm

Wed Apr 27, 2016 8:06 am

Hi,

Thanks for your posting.
I tested the following code with Spire.PDF Pack(Hot Fix) Version:3.6.260 and printed result was correct, attached printing result(I saved as .xps).
Code: Select all
 string fileName = "..\\..\\Sample-WhatShouldBePrinted.pdf";
            Spire.Pdf.PdfDocument pdfDocument = new Spire.Pdf.PdfDocument();
            pdfDocument.LoadFromFile(fileName);
            pdfDocument.PrintDocument.Print();


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Wed Apr 27, 2016 2:05 pm

I just tried what you did, saving it to a file and then loading it back in to print. That does work.

However printing directly after generating the PDF does not.

I can send you a copy of my VS solution, if you would like

[email protected]
 
Posts: 6
Joined: Sat Apr 16, 2016 11:06 pm

Thu Apr 28, 2016 1:29 am

Hi,

Thanks for your response.
Please share us your VS solution to help us investigate it. Thank you. If it is inconvenience to attach it here, you can send it to [email protected].

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF