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

Free Support Forum - aspose.com

Problem with Operator

Hi Team,

I am trying to use below code to get content from one pdf file.
for(int j = 1; j <= contentPage.getContents().size(); j++) {

after saving the pdf, I am facing the error alert while opening the pdf in Adobe even though the values fetched correctly. Kindly advise.


Thank you for contacting support.

Would you please elaborate your requirements a little more so that we may investigate and assist you accordingly. If you are trying to copy pages from one PDF document to another one then you can get a particular page and add it to other PDF document as explained in Add, Delete and Access a Page in a PDF File. Before sharing requested data, please ensure using Aspose.PDF for Java 19.1 in your environment.

Thanks for the reply Farhan.

I am using aspose pdf 18.11 with License.

I just want add artifact and content together in a single pdf page. Aspose also successfully added the exact information in pdf page but while opening the pdf in adobe, I am always facing error alert. Below is the code i used.

I found that if i have image inside pdf, i facing the error alert while getting the content. And If remove the image from pdf, I am not facing such issues. But I have get both the artifact and content together without facing any issue. Can you provide solution on this please. I have attached the pdf file as well

Kindly advice.

public static void main(String args[]) throws Exception{
Document doc = new Document(filePath + “Own.pdf”);
Document newDocument = new Document();
Page pdfPage = doc.getPages().get_Item(1);
System.out.println(“artifact size is:::”+pdfPage.getArtifacts().size());
System.out.println(“size is:::”+pdfPage.getContents().size());
newDocument.save(filePath+“test2.pdf”);Own.pdf (162.6 KB)




Thank you for elaborating it further.

We have logged a ticket with ID PDFJAVA-38327 in our issue management system for further investigations. However, please also share the PDF document with us where you have removed the image and problem does not occur.

We are sorry for the inconvenience.