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.