Hello!!
I have a problem and I would need help please.
The point is that if I try to divide a four-page pdf and keep the first one, the result I get is different if the document has been previously scanned.
If the document I have not scanned, everything is fine.
On the other hand, if the document is scanned, the result is a new document rotated and with two pages when in reality it is not rotated and I have only copied one page.
Can you help me please?
with the scanned document, the result is wrong:
PdfDocument source = new PdfDocument("Join and scanned document.pdf");
PdfDocument dest = new PdfDocument();
PdfPageBase page;
pageFrom = 1;
pageTo = 1;
for (int i = pageFrom; i <= pageTo; i++)
{
page = dest.Pages.Add(source.Pages[i].Size, new Spire.Pdf.Graphics.PdfMargins(0));
source.Pages[i].CreateTemplate().Draw(page, new System.Drawing.PointF(0, 0));
}
dest.SaveToFile(@"d:\ManualResult.pdf"); --> error: the result is a document rotate with two pages.
source.Split(@"d:\AutomaticResult_{0}.pdf"); --> correct: the result is a for document with one page every document.
with the NO scanned document, the result is correct:
PdfDocument source = new PdfDocument("Join but not scanned document.pdf");
PdfDocument dest = new PdfDocument();
PdfPageBase page;
pageFrom = 1;
pageTo = 1;
for (int i = pageFrom; i <= pageTo; i++)
{
page = dest.Pages.Add(source.Pages[i].Size, new Spire.Pdf.Graphics.PdfMargins(0));
source.Pages[i].CreateTemplate().Draw(page, new System.Drawing.PointF(0, 0));
}
dest.SaveToFile(@"d:\ManualResultNOSCANNED.pdf"); --> correct: the result is a document with one page.
source.Split(@"d:\AutomatictResultNOSCANNED_{0}.pdf"); --> correct: the result is a for document with one page every document.
I attach the documents and the results.
Thank you very much!