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

Free Support Forum - aspose.com

How to Extract Text from an particular rectangle region?

Here is my code

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("/home/parkavi/Pdffiles/pages/page_0001.pdf");
//Create rectangle object to get fields in that area
com.aspose.pdf.Rectangle rectangle = new com.aspose.pdf.Rectangle(372, 325, 193, 9);
//Get the PDF form
com.aspose.pdf.Form form = pdfDocument.getForm();
//get fields in the rectangular area
com.aspose.pdf.Field[] fields = form.getFieldsInRect(rectangle);

How to iterate field value??

This is the correct way or any other solution is there??????

Hi Parkavi,


Thanks for contacting support.

In case you need to get/extract from particular page region, then please try using the code snippet shared over Extract Text from an particular page region

However if you need to get form fields from PDF document, then please follow the instructions specified over Get Form Fields from a Specific Region of PDF file


In case you still face any issue, please share the resource PDF file so that we can test the scenario at our end.

cannot get extact text


my code is here

absorber.getTextSearchOptions().setRectangle(new com.aspose.pdf.Rectangle(161, 588, 203, 12));

doc.getPages().get_Item(1).accept(absorber);

String extractedText = absorber.getText();
System.out.println(“Extracted Text”+extractedText);

i have attached my pdf also

how to resolve this??

Hi Parkavi,


Thanks for sharing the code snippet.

I
have tested the scenario and I am able to reproduce the same problem that complete text from certain page lines is not being extracted. Only first word or few characters from each line are being extracted. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-34463. We will
investigate this issue in details and will keep you updated on the status of a
correction. <o:p></o:p>

We apologize for your inconvenience.

Hiii



Any Updates???

Hi Parkavi,


Thanks for your inquiry. I am afraid your issue is still not resolved, it is pending for the investigation in queue with other priority issues. We will update you as soon as we made some significant progress towards issue resolution.

Thanks for your patience and cooperation.

Best Regards,