I use spire pdf in c# for cutting pdf.
I' cutting pdf because we have trouble to display them on our tablets.
This my code :
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(inputFileName);
PdfPageBase page = doc.Pages[0];
float width = page.Size.Width;
float height = page.Size.Height;
SizeF sizeF = new SizeF(this.largeurPC * height, this.hauteurPC * width);
PdfDocument newDoc1 = new PdfDocument();
PdfPageBase newPage1 = newDoc1.Pages.Add(sizeF, new Spire.Pdf.Graphics.PdfMargins(0));
page.CreateTemplate().Draw(newPage1.Canvas, new PointF(-this.decLargeurPC * height, -this.decHauteurPC * width));
newDoc1.SaveToFile(outputileName);
It's working weel but the cut files have exactely the same weight than the original file.
it's like all the data are keep inside the pdf, even the data "outside of the screen".
Is-it possible to delete the data "outside of the screen" ?
Thanks a lot for your help.
Best regards,