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

Free Support Forum - aspose.com

About getting text from PDF

i have tried the following code , but the context of the output is wrong ,

it only extracts the first row(not complete) of every page in PDF.


TextAbsorber textAbsorber = new TextAbsorber();
// Accept the absorber for all the pages
// Get the extracted text
String extractedText = textAbsorber.getText();
// Create a writer and open the file
java.io.FileWriter writer = new java.io.FileWriter(new java.io.File(“C:\oliver\test\Aspose2.txt”));
// Write a line of text to the file
// tw.WriteLine(extractedText);
// Close the stream

Hello Cheng,

Thanks for contacting support.

I have checked the scenario with sample PDF document while using Aspose.Pdf for Java 17.5 and was unable to observe the issue. Would you please share your input document so that we can try to replicate the issue in our environment and address it accordingly.

Best Regards,