Unable to read PDF Fields JAVA

Hi,
Please find attached a pdf file document generated using ASPOSE PDF API. aspose.pdf-17.3.0.jar
Although fields Field1[0]…to Field110[0] are present in this document it does not show up in the code below.

Aspose PDF Java Code:

newPdfDoc= new com.aspose.pdf.Document(inputStream);
Form pdfForm= newPdfDoc.getForm();
Field[] pdfFields= pdfForm.getFields();

for(Field pdfField: pdfFields){
System.out.println(“pdfField.getPartialName()…”+pdfField.getPartialName());
System.out.println(“pdfField.getFullName()…”+pdfField.getFullName());

		System.out.println("pdfField.getValue() before..."+pdfField.getValue());

}

Please advise urgently

Hi,

Thank you for contacting support. There is no any attached PDF document to your post. Kindly recheck and send us your input PDF document, we will investigate and share our findings with you.

Hi Imran,
I am unable to upload files. It comes with an error saying new user. The new support portal is absolutely frustrating and I have wasted valuable time on this.

is there any email id where I can email the files?

@pexy_poulose

We have made some changes and we hope you would be able to attach files now. Please retry and let us know if the issue still persists. Thanks

Application_Approved Cultivar of Industrial Hemp-RI150001_00-DEV Premise.pdf (383.6 KB)

Thanks, I have attached the file causing this issue. Please check and respond urgently.

Hi,
Please look into this urgently and advise.

Hi,

Thank you for sending an input PDF. We have tested your scenario with the latest version 17.5 of Aspose.Pdf for Java API and could retrieve Field1[0] to Field110[0]. Please refer to the resultant text file: Results_17.6

Hi,
I could not find the 17.6 version of aspose pdf jar as it seems it is not released yet. I tried with 17.5 version and can still see the values are not reflecting. Can you please email me the link for 17.6 version of the jar or try the same in 17.5 version and let me know.

Thanks.

Hi,

We are sorry for the confusion caused. We have tested with the latest version 17.5 of Aspose.Pdf for Java API and shared a resultant text file in our previous post. Did you find that the values are not reflected in our shared resultant file? Are you getting the same results as we shared? Did you apply license before executing the test case with the latest version 17.5 of Aspose.Pdf for Java API? Your response is awaited.

Thanks, it seems the earlier test was loading temp license. The results are now showing after loading with the correct license.

Hi,

Thank you for the confirmation. It is nice to hear from you that the issue has been resolved. Please let us know in case of any further assistance or questions.

Thanks & Regards,
Imran Rafique

Hi,
There is a new issue we are facing. I am using ASPOSE PDF 17.3 JAVA version. While running the application on the UNIX AIX server, we are receiving the error "specified method is not supported ".

Can you please look into this urgently and advise.

While running locally everything works fine, however on the server it is giving this issue.

@pexy_poulose,
Kindly let us know the complete steps to replicate this error, including the code and PDF document as well as on which line of code this error occurs. We will investigate and share our findings with you. Your response is awaited.

Best Regards,
Imran Rafique

Please refer this link:

https://forum.aspose.com/t/14658&Subj=specified-method-is-not-supported-at-com.aspose.pdf.textfragment.settext-unknown-source&Ajax_CallBack=true;

In my local Windows machine while running on Eclipse Juno IDE , I am not facing this error.
Could you please advise as to what caused the issue in the link pasted above? I did not find any answers to that post in Oct 2016.

Code:

InputStream inputStream = null;
com.aspose.pdf.Document newPdfDoc = null;
String documentGuid =null;
try {
inputStream = getDocumentAsStream(ceDocument);

 newPdfDoc= new com.aspose.pdf.Document(inputStream);	 
 

 Form pdfForm= newPdfDoc.getForm();	 	 
 Field[] pdfFields= pdfForm.getFields();
inputStream1= getDocumentAsStream(docShareholding);
				shareholdingPdf= new com.aspose.pdf.Document(inputStream1);
				newPdfDoc.getPages().delete(4);
				newPdfDoc.getPages().insert(4,shareholdingPdf.getPages());
				
				for(Field pdfField: pdfFields){
		System.out.println("pdfField.getPartialName()..."+pdfField.getPartialName());
		String partialName = pdfField.getPartialName();
	
		if(partialName.startsWith("ApplicationTemplate")){

			pdfField.setValue("RI Application RENEW");
		}
		}
		
		ByteArrayOutputStream pdfDocOutputStream = new ByteArrayOutputStream();
	
	try {
		
		
		newPdfDoc.save(pdfDocOutputStream);
		
		}

Application_Restriction Notice-RI160002_00-DEV Premise.pdf (406.5 KB)
please find the generated document attached on my local machine which is not generated fine on the server.

@pexy_poulose,
Your source code is not in fully compilable form and loading two PDF documents, later using only one Document class instance to retrieve fields. After some modifications in the code, we tried to replicate this error but not successful. Please remove additional lines of code, compile it and share input PDF instead of the generated PDF document. Your response is awaited.

Best Regards,
Imran Rafique