DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.4k stars 626 forks source link

Printing.raster result is black image #1564

Open fewensa opened 10 months ago

fewensa commented 10 months ago

Describe the bug

Call Printing.raster result image is black background.

To Reproduce Code snippet to reproduce the behavior:

    File file = new File('/tmp/doc.pdf');
    var data = await file.readAsBytes();
    Stream<PdfRaster> pdfraster = Printing.raster(
      data,
    );

Expected behavior

White image

Screenshots

image image

image image

Flutter Doctor

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.16.4, on Microsoft Windows [Version 10.0.19045.3803], locale zh-TW)
    ! Warning: `flutter` on your path resolves to D:\opt\scoop\apps\flutter\3.16.4\bin\flutter, which is not inside your
      current Flutter SDK checkout at D:\opt\scoop\apps\flutter\current. Consider adding
      D:\opt\scoop\apps\flutter\current\bin to the front of your path.
    ! Warning: `dart` on your path resolves to D:\opt\scoop\apps\flutter\3.16.4\bin\dart, which is not inside your
      current Flutter SDK checkout at D:\opt\scoop\apps\flutter\current. Consider adding
      D:\opt\scoop\apps\flutter\current\bin to the front of your path.
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.6)
[!] Android Studio (not installed)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

ElChengLee commented 9 hours ago

do you have new solution? @fewensa