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.

Wed Jan 17, 2018 5:43 pm

Hello,

I'm using Spire.Pdf to print transaction receipts on roll paper but the printed result is stretched when compared to the PDF file opened on the computer.

Does anyone know what I'm doing wrong? I've also noticed that this works well on Windows 7 PC. I only detect this problem on Windows 10, with the same printer.

Here is the code that I'm using.

Code: Select all
PdfDocument doc = new PdfDocument();
                doc.LoadFromFile(pdfFileName);

                doc.CompressionLevel = PdfCompressionLevel.None;

                doc.PrinterName = szPrinter;
                doc.PrintFromPage = 1;
                doc.PrintToPage = 1;

                doc.PrintDocument.Print();


Thank you in advance.

fabiopires
 
Posts: 5
Joined: Thu May 11, 2017 4:09 pm

Thu Jan 18, 2018 2:06 am

Hello,

Thanks for your inquiry. I notice that you are using the PrintDocument Class which will be abandoned. Please update to the latest version(Spire.PDF Pack(Hot Fix) Version:3.9.584) and use doc.Print() instead. If the issue still exists after trying, please share us with your PDF file. You could remove the confidential information.
Code: Select all
PdfDocument doc = new PdfDocument();
                doc.LoadFromFile(pdfFileName);
                doc.CompressionLevel = PdfCompressionLevel.None;
                doc.PrinterName = szPrinter;
                doc.PrintFromPage = 1;
                doc.PrintToPage = 1;
                doc.Print();


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Thu Jan 18, 2018 9:58 am

Hello,

Thank you for your reply. I was able to solve this problem adding a PdfPrintPageScaling.ActualSize parameter and now it prints ok on Windows 10. Why this was working well on Windows 7 and not on Windows 10, I don't know...

I'm using the Spire PDF free DLLs. That hotfix will also work for the free version?

Thank you.

fabiopires
 
Posts: 5
Joined: Thu May 11, 2017 4:09 pm

Thu Jan 18, 2018 10:06 am

Hello,

Thanks for your feedback. Glad to hear that the issue is resolved. The hotfix is the commercial version. If your need further assistance, please contact us.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDF