I want to extract one/multiple pages from a document and save it to a pdf, docx or some other format. Is it possible?
What I want is some API like “public Document extractPages(fromIndex, toIndex)”
I want to extract one/multiple pages from a document and save it to a pdf, docx or some other format. Is it possible?
Hi Abhradeep,
Document doc = new Document(“C:\Temp\in.doc”);
LayoutCollector layoutCollector = new LayoutCollector(doc);
doc.updatePageLayout();
DocumentPageSplitter splitter = new DocumentPageSplitter(layoutCollector);
Document pageDoc = splitter.GetDocumentOfPage(5);
pageDoc.save(“C:\Temp\out.doc”);
pageDoc.save(“C:\Temp\out.pdf”);
I am not able to find DocumentPageSplitter class in aspose-words-14.5.0-jdk16 jar. Can you please let me know where should I get it
Hi Abhradeep,
It is not working as expected you can check with this doc.
Hi Abhradeep,
Thanks for your inquiry. We are checking this scenario and will get back to you soon.
Hi Abhradeep,
I tested with that document and it is working as expected. I will test with other documents as well and let you know if I face any other issues.