I'm evaluating Spire.PDF free edition and found one issue.
When trying to display yours Sample1.pdf file inside a Print Preview Dialog, the pages render with a strange space in the beginning of the file. The code I'm using is this:
var doc = new PdfDocument();
doc.LoadFromFile("Sample1.pdf");
var ppd = new PrintPreviewDialog();
ppd.Document = doc.PrintDocument;
ppd.ShowDialog(this); // renders Image1 attached
I made some tests changing a lot of properties (Margins, PageScaling, OriginAtMargins, etc) and couldn't get it to render the file correctly.
Finally I manage to display the pdf (still incorrectly, but without cropping contents) changing the paper size like this:
var doc = new PdfDocument();
doc.LoadFromFile("Sample1.pdf");
var conv = new PdfUnitConvertor();
var paper = new PaperSize("XX",
(int)Math.Round(conv.ConvertUnits(297, PdfGraphicsUnit.Millimeter, PdfGraphicsUnit.Inch) * 100),
(int)Math.Round(conv.ConvertUnits(420, PdfGraphicsUnit.Millimeter, PdfGraphicsUnit.Inch) * 100));
paper.RawKind = (int)PaperKind.A4;
doc.PrintDocument.DefaultPageSettings.PaperSize = paper;
var ppd = new PrintPreviewDialog();
ppd.Document = doc.PrintDocument;
ppd.ShowDialog(this); // renders Image2 attached
Note that I'm using an A3 size (297 x 420) but the RawKind must be A4. If you change this the rendering problem appears again.
I have also changed the printer to see if this could be related to it, but again with no avail.
When printing the file directly to a printer everything works fine, without the rendering problem.
Probably I'm doing something very silly but I couldn't find out what. I have attached two images displaying what I'm getting.
Additional information:
Spire.PDF version: 2.9.37.56020 Free Edition - .Net Framework 3.5
OSes: Windows XP SP3 32 bits / Windows 7 64 Bits
Can you reproduce this? Do you have any idea why this might be happening?
Best regards and thank you for any help