Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError (index): Invalid value: Valid value range is empty: 95 #1524

Open
KalaliEhsan opened this issue Nov 11, 2023 · 4 comments
Open

RangeError (index): Invalid value: Valid value range is empty: 95 #1524

KalaliEhsan opened this issue Nov 11, 2023 · 4 comments
Labels
bug Something isn't working needs triage

Comments

@KalaliEhsan
Copy link

Describe the bug
I generated a long document with this package, and suddenly top error occurred.
I used 6 times from doc.addPage() for 6 pages.

The console log:

======== Exception caught by printing ==============================================================
The following RangeError was thrown while generating a PDF:
RangeError (index): Invalid value: Valid value range is empty: 95

When the exception was thrown, this was the stack: 
#0      List.[] (dart:core-patch/growable_array.dart:264:36)
#1      List.removeAt (dart:core-patch/growable_array.dart:23:22)
#2      Paragraph._removeBidiMarkers (package:bidi/src/paragraph.dart:95:18)
#3      new Paragraph._ (package:bidi/src/paragraph.dart:19:5)
#4      splitStringToParagraphs (package:bidi/src/bidi.dart:110:30)
#5      logicalToVisual (package:pdf/src/pdf/font/bidi_utils.dart:44:27)
#6      RichText.layout._buildLines (package:pdf/src/widgets/text.dart:929:26)
#7      RichText.layout (package:pdf/src/widgets/text.dart:1136:5)
#8      Flex.layout (package:pdf/src/widgets/flex.dart:285:15)
#9      Padding.layout (package:pdf/src/widgets/basic.dart:90:14)
#10     SingleChildWidget.layout (package:pdf/src/widgets/widget.dart:302:14)
#11     InheritedWidget.layout (package:pdf/src/widgets/widget.dart:373:11)
#12     StatelessWidget.layout (package:pdf/src/widgets/widget.dart:240:15)
#13     Page.layout (package:pdf/src/widgets/page.dart:187:11)
#14     Page.postProcess (package:pdf/src/widgets/page.dart:141:18)
#15     Document.save (package:pdf/src/widgets/document.dart:130:14)
#16     generateMyDocument (package:my_app/my_document.dart:615:20)
<asynchronous suspension>
#17     PdfPreviewRaster._raster (package:printing/src/preview/raster.dart:125:13)
<asynchronous suspension>
PageFormat: "PdfPageFormat 595.275590551181x841.8897637795275 margins:56.69291338582677, 56.69291338582677, 56.69291338582677, 56.69291338582677"
@KalaliEhsan KalaliEhsan added bug Something isn't working needs triage labels Nov 11, 2023
@DavBfr
Copy link
Owner

DavBfr commented Nov 11, 2023

Seems to be a bug in package:bidi/src/paragraph.dart not this PDF library

@KalaliEhsan
Copy link
Author

Seems to be a bug in package:bidi/src/paragraph.dart not this PDF library

Thanks @DavBfr

@fdhaeyerDev
Copy link

Hello, i have the same problem. Will you get a fix quickly ?

@KalaliEhsan
Copy link
Author

I guess that you used a specific font in your document which isn't supported in this package or bidi package. Try another font pls. @fdhaeyerDev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

3 participants