How to remove specific page from word document in Aspose Java? -
how remove specific page word document in aspose java ?
my requirement is, have 1 word document need first page ?
so either can remove pages except first 1 or can create new document read first page document , write new document.
you can achieve requirements using "pagesplitter" example project. can find pagesplitter code in aspose.words java examples repository @ github. please use following code example extract first page word document.
//load document document doc = new document(mydir + "in.docx"); // create , attach collector document before page layout built. layoutcollector layoutcollector = new layoutcollector(doc); // split nodes in document separate pages. documentpagesplitter splitter = new documentpagesplitter(layoutcollector); //get first page of document document newdoc = splitter.getdocumentofpage(1); newdoc.save(mydir + "out.docx");
i work aspose developer evangelist.
Comments
Post a Comment