Hi,
While I am processing an uploaded document, I want track the number of pages that document skipped from page number. For that i am tried to take the last page number using below code
DocumentBuilder builder = new DocumentBuilder(document); builder.moveToDocumentEnd(); // Insert a PAGE field and update it. Field page = builder.insertField("PAGE"); document.updatePageLayout(); page.update(); int lasPgNo = Integer.parseInt(page.getResult()); // Remove PAGE field. page.remove();
I am getting the last page number and from above code. After I will save the document with word and pdf. In saved pdf document not removing the inserted page field and I can see page number at the end. I am attaching the input document, output document and sample code for the issue. Please help me to remove that unwanted page field from downloaded pdf document. Or please html me with any alternative solution to find number of skipped pages
PageFieldRemoveIssue.zip (200.4 KB)
Thank you