Hi all,
i have a PDF with over 5000 Pages. I have to Split the PDF in Parts. But i need to Split in dynamic Steps. Not Save One Page to a new PDF, maybe two or three Pages must be save to a new PDF. In Aspose.PDF for .NET Documentation|Aspose.PDF for .NET is a Sample to save only one Page into a new Page.
Is it possible to save page No. 3,4,5 and 6 to One new Page in One Step?
Now i Save each Page in a own PDF and add the other Pages like this Sample to the first one: Concatenate PDF documents in C#|Aspose.PDF for .NET
Thanks and Regards
Winfried
Hi Winfried,
Thanks for your inquiry. Please check the following code snippet to extract more than one page using the DOM approach. You can also extract multiple pages using the Facades approach as suggested here. Hopefully, it will help you accomplish your requirements.
Document wholePdf = new Document(myDir + "s3.pdf");
Document extractedPdf = new Document();
int pagecount = 1;
foreach (Page page in wholePdf.Pages)
{
if (pagecount > 2 && pagecount < 7)
{
extractedPdf.Pages.Add(page);
}
pagecount++;
}
extractedPdf.Save(myDir + "extractPages.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
Thank you Tilal,
this Extract PDF pages|Aspose.PDF for Java is the solution for me.
Thanks and Regards
Winfried
Hi Winfried,