-
Notifications
You must be signed in to change notification settings - Fork 913
Closed
Labels
bugSomething isn't workingSomething isn't workingpdfPDF componentPDF componentwaiting for customer responseCannot make further progress until the customer responds.Cannot make further progress until the customer responds.
Description
Hello,
i am using the following versions in flutter and syncfusion_flutter_pdf :
flutter:3.13.6
syncfusion_flutter_pdf: ^23.1.38
I have the following issue that when i try to read the attached pdf file the pages are blank or mostly unreadable. This is my code for reading a specific page :
Future<Map<String, dynamic>> getPdfContent(String path,{pageIndex=1}) async{
PdfDocument document = PdfDocument(inputBytes: await _readDocumentData(path));
int pageCount = document.pages.count;
if (pageIndex < 0 || pageIndex >= pageCount) {
print("Error: Page index out of bounds!");
document.dispose();
return {'text': '', 'pageCount': pageCount};
}
PdfTextExtractor extractor = PdfTextExtractor(document);
// Since you're extracting from a single page, start and end page indices should be the same
String text = extractor.extractText(startPageIndex: pageIndex, endPageIndex: pageIndex);
document.dispose();
return {'text': text, 'pageCount': pageCount};
}
The provided code is working fine with other pdf files, am i doing something wrong and can this issue be resolved somehow?
Thank you for your time!
Stanko
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpdfPDF componentPDF componentwaiting for customer responseCannot make further progress until the customer responds.Cannot make further progress until the customer responds.