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

[Bad state: No element]: Thrown if text contains a backspace/rubout character #1749

Open
rohansohonee1 opened this issue Sep 26, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@rohansohonee1
Copy link

Describe the bug
When using the backspace/rubout character in the pdf Text widget. The pdf document is not generated & throws an error.

To Reproduce
Run the sample from this project.

Console logs

======== Exception caught by printing ==============================================================
The following StateError was thrown while generating a PDF:
Bad state: No element

When the exception was thrown, this was the stack: 
#0      Iterable.first (dart:core/iterable.dart:643:7)
#1      TtfWriter.withChars (package:pdf/src/pdf/font/ttf_writer.dart:112:67)
#2      PdfTtfFont._buildType0 (package:pdf/src/pdf/obj/ttffont.dart:121:28)
#3      PdfTtfFont.prepare (package:pdf/src/pdf/obj/ttffont.dart:162:7)
#4      PdfDocument._write (package:pdf/src/pdf/document.dart:225:10)
#5      PdfDocument.save.<anonymous closure> (package:pdf/src/pdf/document.dart:259:13)
#6      _RemoteRunner._run (dart:isolate:1090:47)
#7      _RemoteRunner._remoteExecute (dart:isolate:1084:12)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:17)
#9      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
PageFormat: "PdfPageFormat 612.0x792.0 margins:72.0, 72.0, 72.0, 72.0"
====================================================================================================

Expected behavior

The pdf document should be generated with no errors.

Flutter Doctor

[✓] Flutter (Channel stable, 3.22.2, on macOS 12.7.6 21H1320 darwin-x64, locale en-US)
    • Flutter version 3.22.2 on channel stable at /Users/appleapple/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (4 months ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/appleapple/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    ! Flutter recommends a minimum Xcode version of 15.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.93.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.96.0

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 12.7.6 21H1320 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 129.0.6668.71

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Smartphone (please complete the following information):

  • Device: Pixel 2 Emulator
  • OS: Android 12.0 x86_64

Additional Context

pdf: 3.11.1
printing: 5.13.2
@rohansohonee1 rohansohonee1 added bug Something isn't working needs triage labels Sep 26, 2024
Repository owner deleted a comment Oct 24, 2024
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

1 participant