We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Size not decreasing after splitting a document

Hi,

I am trying to split a pdf document using the below code. where wipDocument is a java bean holding split document information.

for

(WipDocumentPage wipDocumentPage : wipDocument

.getDocumentPages()) {

if (wipDocumentPage.getPageActions().contains("split")) {

Page page = pdfDocument.getPages().get_Item(

wipDocumentPage.getPageNumber());

splitPdfDocument.getPages().add(page);

}

}

wipDocument.getDocumentPages().orderByPageNumberDescending();

for (WipDocumentPage wipDocumentPage : wipDocument

.getDocumentPages()) {

if ( wipDocumentPage.getPageActions().contains("split")) {

log.debug("delete page number " + wipDocumentPage.getPageNumber());

pageCollection.delete(wipDocumentPage.getPageNumber());

}

}

Document gets splitted properly using this code the only issue is size of files does not increase. attached is the test document.

Can you please help.

Hi Sarika,


Thanks for your inquiry. I am afraid I am unable to understand you issue completely. What you do mean by “size of file does not increase”. Moreover, I am afraid we cannot test your code due to missing references. We will appreciate it if you please share a simple executable java code for testing.

We are sorry for the inconvenience caused.

Best Regards,