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 Jul 21, 2021 11:48 am

Hi,

I am totally new to Spire.PDF, so excuse me, if this is a duplicate question. I have read some posts - none of wich solved my problem.

I am generating a report from the ReportViewer in a WindowsForms application. Now the generated PDF is perfect in size while on screen and printed (opening the PDF with Sumatra or Acrobat). Now I am trying to automate printing to different trays. For that I open the created PDF:

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


Then I found out that scaling it to "ActualSize" solves 98% of the size Problem:

Code: Select all
doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.ActualSize, true);


But now I still have an issues

The PDF seems to get shrunk onto the printed page. It is about 1cm too short, and about 0.5cm too narrow.

I have tried playing around with the margins, and searching through the properties of the doc, but I can't seem to find the missing piece of the puzzle. I understand the hardMargins of the printer can not be changed?! What I can't wrap my head around is the fact, that from Adobe or Sumatra the original document gets printed perfectly

Thanks in advance.

shumachine
 
Posts: 1
Joined: Wed Jul 21, 2021 11:37 am

Thu Jul 22, 2021 10:14 am

Hello,

Thanks for your inquiry.

I simulated a PDF file and printed it with the latest Spire.PDF Pack(Hot Fix) Version:7.7.10. But I did not reproduce your issue. If you are using an older version, we recommend you upgrade to the latest version and try again.
If there are still any issues, please provide your input file, your OS information (e.g. Win7 64bit), your region setting (e.g. China, Chinese) and your project target framework (e.g. .NET Framework 4.5). Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Jul 30, 2021 10:57 am

Hello,

Greetings from E-iceblue!
How is your issue now? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF