Code Monkey home page Code Monkey logo

flutter_pdf_render's Introduction

Notice (2024-01-22)

If you want to move to pdfrx but you have some compatibility issues or any other problems or questions, please feel free to open new discussions on Discussions on pdfrx.

Notice (2023-12-05)

New plugin, named pdfrx, is a better replacement for pdf_render. And pdf_render is now in maintenance mode. No new features are added to pdf_render.

New features introduced by pdfrx:

  • Desktop platforms support (Windows, macOS, Linux)
  • Password protected PDF files support
  • Multithreaded PDF rendering
  • PdfDocument.openUri
  • pdfium based structure to support more... :)

pdfrx is not a full drop-in-replacement to pdf_render but I guess it takes less then a hour to change your code to adopt it.

Introduction

pdf_render is a PDF renderer implementation that supports iOS, Android, macOS, and Web. It provides you with intermediate PDF rendering APIs and also easy-to-use Flutter Widgets.

Getting Started

The following fragment illustrates the easiest way to show a PDF file in assets:

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Easiest PDF sample'),
        ),
        backgroundColor: Colors.grey,
        body: PdfViewer.openAsset('assets/hello.pdf')
      )
    );
  }

web-preview

Install

Add this to your package's pubspec.yaml file and execute flutter pub get:

dependencies:
  pdf_render: ^1.4.9

Web

For Web, you should add <script> tags on your index.html:

The plugin utilizes PDF.js to support Flutter Web.

To use the Flutter Web support, you should add the following code just before <script src="main.dart.js" type="application/javascript"></script> inside index.html:

<!-- IMPORTANT: load pdfjs files -->
<script
  src="https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.min.js"
  type="text/javascript"
></script>
<script type="text/javascript">
  pdfjsLib.GlobalWorkerOptions.workerSrc =
    "https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.js";
  pdfRenderOptions = {
    // where cmaps are downloaded from
    cMapUrl: "https://cdn.jsdelivr.net/npm/[email protected]/cmaps/",
    // The cmaps are compressed in the case
    cMapPacked: true,
    // any other options for pdfjsLib.getDocument.
    // params: {}
  };
</script>

You can use any URL that specify PDF.js distribution URL. cMapUrl indicates cmap files base URL and cMapPacked determines whether the cmap files are compressed or not.

iOS/Android

For iOS and Android, no additional task needed.

macOS

For macOS, there are two notable issues:

Deal with App Sandbox

The easiest option to access files on your disk, set com.apple.security.app-sandbox to false on your entitlements file though it is not recommended for releasing apps because it completely disables App Sandbox.

Another option is to use com.apple.security.files.user-selected.read-only along with file_selector_macos. The option is better in security than the previous option.

Anyway, the example code for the plugin illustrates how to download and preview internet hosted PDF file. It uses com.apple.security.network.client along with flutter_cache_manager:

<dict>
  <key>com.apple.security.app-sandbox</key>
  <true/>
  <key>com.apple.security.network.client</key>
  <true/>
</dict>

For the actual implementation, see Missing network support? and the example code.

Widgets

Import Widgets Library

Firstly, you must add the following import:

import 'package:pdf_render/pdf_render_widgets.dart';

PdfViewer

PdfViewer is an extensible PDF document viewer widget which supports pinch-zoom.

The following fragment is a simplest use of the widget:

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Pdf_render example app'),
        ),
        backgroundColor: Colors.grey,
        // You can use either PdfViewer.openFile, PdfViewer.openAsset, or PdfViewer.openData
        body: PdfViewer.openAsset(
          'assets/hello.pdf',
          params: PdfViewerParams(pageNumber: 2), // show the page-2
        )
      )
    );
  }

In the code above, the code uses PdfViewer.openAsset to load a asset PDF file. There are also PdfViewer.openFile for local file and PdfViewer.openData for Uint8List of PDF binary data.

Missing network support?

A frequent feature request is something like PdfViewer.openUri. The plugin does not have it but it's easy to implement it with flutter_cache_manager:

FutureBuilder<File>(
  future: DefaultCacheManager().getSingleFile(
    'https://github.com/espresso3389/flutter_pdf_render/raw/master/example/assets/hello.pdf'),
  builder: (context, snapshot) => snapshot.hasData
    ? PdfViewer.openFile(snapshot.data!.path)
    : Container( /* placeholder */),
)

PdfViewerParams

PdfViewerParams contains parameters to customize PdfViewer.

It also equips the parameters that are inherited from InteractiveViewer. You can use almost all parameters of InteractiveViewer.

PdfViewerController

PdfViewerController can be used to obtain number of pages in the PDF document.

goTo/goToPage/goToPointInPage

It also provide goTo and goToPage methods that you can scroll the viewer to make certain page/area of the document visible:

  @override
  Widget build(BuildContext context) {
    PdfViewerController? controller;
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Pdf_render example app'),
        ),
        backgroundColor: Colors.grey,
        body: PdfViewer.openAsset(
          'assets/hello.pdf',
          params: PdfViewerParams(
            // called when the controller is fully initialized
            onViewerControllerInitialized: (PdfViewerController c) {
              controller = c;
              controller.goToPage(pageNumber: 3); // scrolling animation to page 3.
            }
          )
        ),
      ),
        floatingActionButton: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            FloatingActionButton(
              child: Icon(Icons.first_page),
              onPressed: () => controller.ready?.goToPage(pageNumber: 1),
            ),
            FloatingActionButton(
              child: Icon(Icons.last_page),
              onPressed: () => controller.ready?.goToPage(pageNumber: controller.pageCount),
            ),
          ],
        ),
      ),
    );
  }

goToPointInPage is just another version of goToPage, which also accepts inner-page point and where the point is anchored to.

The following fragment shows page 1's center on the widget's center with the zoom ratio 300%:

controller.goToPointInPage(
  pageNumber: 1,
  x: 0.5,
  y: 0.5,
  anchor: PdfViewerAnchor.center,
  zoomRatio: 3.0,
);

And, if you set x: 0, y: 0, anchor: PdfViewerAnchor.topLeft, the behavior is identical to goToPage.

setZoomRatio

setZoomRatio is a method to change zoom ratio without scrolling the view (***it's not exactly the true but almost).

The following fragment changes zoom ratio to 2.0:

controller.setZoomRatio(2.0);

During the zoom changing operation, it keeps the center point in the widget being centered.

The following fragment illustrates another use case, zoom-on-double-tap:

final controller = PdfViewerController();
TapDownDetails? doubleTapDetails;

...

GestureDetector(
  // Supporting double-tap gesture on the viewer.
  onDoubleTapDown: (details) => doubleTapDetails = details,
  onDoubleTap: () => controller.ready?.setZoomRatio(
    zoomRatio: controller.zoomRatio * 1.5,
    center: doubleTapDetails!.localPosition,
  ),
  child: PdfViewer.openAsset(
    'assets/hello.pdf',
    viewerController: controller,
    ...

Using GestureDetector, it firstly captures the double-tap location on onDoubleTapDown. And then, onDoubleTap uses the location as the zoom center.

Managing gestures

PdfViewer does not support any gestures except panning and pinch-zooming. To support other gestures, you can wrap the widget with GestureDetector as explained above.

Page decoration

Each page shown in PdfViewer is by default has drop-shadow using BoxDecoration. You can override the appearance by PdfViewerParams.pageDecoration property.

Further page appearance customization

PdfViewerParams.buildPagePlaceholder is used to customize the white blank page that is shown before loading the page contents.

PdfViewerParams.buildPageOverlay is used to overlay something on every page.

Both functions are defined as BuildPageContentFunc:

typedef BuildPageContentFunc = Widget Function(
  BuildContext context,
  int pageNumber,
  Rect pageRect);

The third parameter, pageRect is location of page in viewer's world coordinates.

Single page view

The following fragment illustrates the easiest way to render only one page of a PDF document using PdfDocumentLoader widget. It is suitable for showing PDF thumbnail.

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Pdf_render example app'),
        ),
        backgroundColor: Colors.grey,
        body: Center(
          child: PdfDocumentLoader.openAsset(
            'assets/hello.pdf',
            pageNumber: 1,
            pageBuilder: (context, textureBuilder, pageSize) => textureBuilder()
          )
        )
      ),
    );
  }

Of course, PdfDocumentLoader has the following factory functions:

Multi-page view using ListView.builder

Using PdfDocumentLoader in combination with PdfPageView, you can show multiple pages of a PDF document. In the following fragment, ListView.builder is utilized to realize scrollable PDF document viewer.

The most important role of PdfDocumentLoader is to manage life time of PdfDocument and it disposes the document when the widget tree is going to be disposed.

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Pdf_render example app'),
        ),
        backgroundColor: Colors.grey,
        body: Center(
          child: PdfDocumentLoader.openAsset(
            'assets/hello.pdf',
            documentBuilder: (context, pdfDocument, pageCount) => LayoutBuilder(
              builder: (context, constraints) => ListView.builder(
                itemCount: pageCount,
                itemBuilder: (context, index) => Container(
                  margin: EdgeInsets.all(margin),
                  padding: EdgeInsets.all(padding),
                  color: Colors.black12,
                  child: PdfPageView(
                    pdfDocument: pdfDocument,
                    pageNumber: index + 1,
                  )
                )
              )
            ),
          )
        )
      ),
    );
  }

Customizing page widget

Both PdfDocumentLoader and PdfPageView accepts pageBuilder parameter if you want to customize the visual of each page.

The following fragment illustrates that:

PdfPageView(
  pageNumber: index + 1,
  // pageSize is the PDF page size in pt.
  pageBuilder: (context, textureBuilder, pageSize) {
    //
    // This illustrates how to decorate the page image with other widgets
    //
    return Stack(
      alignment: Alignment.bottomCenter,
      children: <Widget>[
        // the container adds shadow on each page
        Container(
            margin: EdgeInsets.all(margin),
            padding: EdgeInsets.all(padding),
            decoration: BoxDecoration(boxShadow: [
              BoxShadow(
                  color: Colors.black45,
                  blurRadius: 4,
                  offset: Offset(2, 2))
            ]),
            // textureBuilder builds the actual page image
            child: textureBuilder()),
        // adding page number on the bottom of rendered page
        Text('${index + 1}', style: TextStyle(fontSize: 50))
      ],
    );
  },
)

textureBuilder

textureBuilder (PdfPageTextureBuilder) generates the actual widget that directly corresponding to the page image. The actual widget generated may vary upon the situation. But you can of course customize the behavior of the function with its parameter.

The function is defined as:

typedef PdfPageTextureBuilder = Widget Function({
  Size? size,
  PdfPagePlaceholderBuilder? placeholderBuilder,
  bool backgroundFill,
  double? renderingPixelRatio
});

So if you want to generate widget of an exact size, you can specify size explicitly.

Please note that the size is in density-independent pixels. The function is responsible for determining the actual pixel size based on device's pixel density.

placeholderBuilder is the final resort that controls the "placeholder" for loading or failure cases.

/// Creates page placeholder that is shown on page loading or even page load failure.
typedef PdfPagePlaceholderBuilder = Widget Function(Size size, PdfPageStatus status);

/// Page loading status.
enum PdfPageStatus {
  /// The page is currently being loaded.
  loading,
  /// The page load failed.
  loadFailed,
}

PDF rendering APIs

The following fragment illustrates overall usage of PdfDocument:

import 'package:pdf_render/pdf_render.dart';

...

// Open the document using either openFile, openAsset, or openData.
// For Web, file name can be relative path from index.html or any arbitrary URL
// but affected by CORS.
PdfDocument doc = await PdfDocument.openAsset('assets/hello.pdf');

// Get the number of pages in the PDF file
int pageCount = doc!.pageCount;

// The first page is 1
PdfPage page = await doc!.getPage(1);


// For the render function's return, see explanation below
PdfPageImage pageImage = await page.render();

// Now, you can access pageImage!.pixels for raw RGBA data
// ...

// Generating dart:ui.Image cache for later use by imageIfAvailable
await pageImage.createImageIfNotAvailable();

// PDFDocument must be disposed as soon as possible.
doc!.dispose();

And then, you can use PdfPageImage to get the actual RGBA image in dart:ui.Image.

To embed the image in the widget tree, you can use RawImage:

@override
Widget build(BuildContext context) {
  return Center(
    child: Container(
      padding: EdgeInsets.all(10.0),
      color: Colors.grey,
      child: Center(
        // before using imageIfAvailable, you should call createImageIfNotAvailable
        child: RawImage(image: pageImage.imageIfAvailable, fit: BoxFit.contain))
    )
  );
}

If you just building widget tree, you had better use faster and efficient PdfPageImageTexture.

PdfDocument.openXXX

On PdfDocument class, there are three functions to open PDF from a real file, an asset file, or a memory data.

// from an asset file
PdfDocument docFromAsset = await PdfDocument.openAsset('assets/hello.pdf');

// from a file
// For Web, file name can be relative path from index.html or any arbitrary URL
// but affected by CORS.
PdfDocument docFromFile = await PdfDocument.openFile('/somewhere/in/real/file/system/file.pdf');

// from PDF memory image on Uint8List
PdfDocument docFromData = await PdfDocument.openData(data);

PdfDocument members

PdfDocument class overview:

class PdfDocument {
  /// File path, `asset:[ASSET_PATH]` or `memory:` depending on the content opened.
  final String sourceName;
  /// Number of pages in the PDF document.
  final int pageCount;
  /// PDF major version.
  final int verMajor;
  /// PDF minor version.
  final int verMinor;
  /// Determine whether the PDF file is encrypted or not.
  final bool isEncrypted;
  /// Determine whether the PDF file allows copying of the contents.
  final bool allowsCopying;
  /// Determine whether the PDF file allows printing of the pages.
  final bool allowsPrinting;

  // Get a page by page number (page number starts at 1)
  Future<PdfPage> getPage(int pageNumber);

  // Dispose the instance.
  Future<void> dispose();
}

PdfPage members

PdfPage class overview:

class PdfPage {
  final PdfDocument document; // For internal purpose
  final int pageNumber; // Page number (page number starts at 1)
  final double width; // Page width in points; pixel size on 72-dpi
  final double height; // Page height in points; pixel size on 72-dpi

  // render sub-region of the PDF page.
  Future<PdfPageImage> render({
    int x = 0,
    int y = 0,
    int? width,
    int? height,
    double? fullWidth,
    double? fullHeight,
    bool backgroundFill = true,
    bool allowAntialiasingIOS = false
  });
}

render function extracts a sub-region (x,y) - (x + width, y + height) from scaled fullWidth x fullHeight PDF page image. All the coordinates are in pixels.

The following fragment renders the page at 300 dpi:

const scale = 300.0 / 72.0;
const fullWidth = page.width * scale;
const fullHeight = page.height * scale;
var rendered = page.render(
  x: 0,
  y: 0,
  width: fullWidth.toInt(),
  height: fullHeight.toInt(),
  fullWidth: fullWidth,
  fullHeight: fullHeight);

PdfPageImage members

PdfPageImage class overview:

class PdfPageImage {
  /// Page number. The first page is 1.
  final int pageNumber;
  /// Left X coordinate of the rendered area in pixels.
  final int x;
  /// Top Y coordinate of the rendered area in pixels.
  final int y;
  /// Width of the rendered area in pixels.
  final int width;
  /// Height of the rendered area in pixels.
  final int height;
  /// Full width of the rendered page image in pixels.
  final int fullWidth;
  /// Full height of the rendered page image in pixels.
  final int fullHeight;
  /// PDF page width in points (width in pixels at 72 dpi).
  final double pageWidth;
  /// PDF page height in points (height in pixels at 72 dpi).
  final double pageHeight;
  /// RGBA pixels in byte array.
  final Uint8List pixels;

  /// Get [dart:ui.Image] for the object.
  Future<Image> createImageIfNotAvailable() async;

  /// Get [Image] for the object if available; otherwise null.
  /// If you want to ensure that the [Image] is available,
  /// call [createImageIfNotAvailable].
  Image? get imageIfAvailable;
}

createImageIfNotAvailable generates image cache in dart:ui.Image and imageIfAvailable returns the cached image if available.

If you just need RGBA byte array, you can use pixels for that purpose. The pixel at (x,y) is on pixels[(x+y*width)*4]. Anyway, it's highly discouraged to modify the contents directly though it would work correctly.

PdfPageImageTexture members

PdfPageImageTexture is to utilize Flutter's Texture class to realize faster and resource-saving rendering comparing to PdfPageImage/RawImage combination.

class PdfPageImageTexture {
  final PdfDocument pdfDocument;
  final int pageNumber;
  final int texId;

  bool get hasUpdatedTexture;

  PdfPageImageTexture({required this.pdfDocument, required this.pageNumber, required this.texId});

  /// Create a new Flutter [Texture]. The object should be released by calling [dispose] method after use it.
  static Future<PdfPageImageTexture> create({required PdfDocument pdfDocument, required int pageNumber});

  /// Release the object.
  Future<void> dispose();

  /// Extract sub-rectangle ([x],[y],[width],[height]) of the PDF page scaled to [fullWidth] x [fullHeight] size.
  /// If [backgroundFill] is true, the sub-rectangle is filled with white before rendering the page content.
  Future<bool> extractSubrect({
    int x = 0,
    int y = 0,
    required int width,
    required int height,
    double? fullWidth,
    double? fullHeight,
    bool backgroundFill = true,
  });
}

Custom Page Layout

PdfViewerParams has a property layoutPages to customize page layout.

Sometimes, when you're using Landscape mode on your Phone or Tablet and you need to show pdf fit to the center of the screen then you can use this code to customize the pdf layout.

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      backgroundColor: Colors.white70,
      body: PdfViewer.openAsset(
        'assets/hello.pdf',
        params: PdfViewerParams(
          layoutPages: (viewSize, pages) {
            List<Rect> rect = [];
            final viewWidth = viewSize.width;
            final viewHeight = viewSize.height;
            final maxHeight = pages.fold<double>(0.0, (maxHeight, page) => max(maxHeight, page.height));
            final ratio = viewHeight / maxHeight;
            var top = 0.0;
            for (var page in pages) {
              final width = page.width * ratio;
              final height = page.height * ratio;
              final left = viewWidth > viewHeight ? (viewWidth / 2) - (width / 2) : 0.0;
              rect.add(Rect.fromLTWH(left, top, width, height));
              top += height + 8 /* padding */;
            }
            return rect;
          },
        ),
      ),
    );
  }

Preview

flutter_pdf_render's People

Contributors

animator avatar chayanforyou avatar codeforce-dev avatar dab246 avatar deakjahn avatar espresso3389 avatar johnstef99 avatar korbinianmossandl avatar lsaudon avatar sp4rx avatar vsabenin-private avatar wemiprog avatar wibtu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_pdf_render's Issues

How to achive minScale/minZoom

I want to zoom out much more and want to show small pages like this...

20210411_200230

I tried setting minScale but it does not seems working...

How to achieve this ?

PdfPage.render documentation documents non-existent parameters

The documentation for PdfPage.render mentions non-existent parameters dpi and boxFit:

  /// If [dpi] is set, [fullWidth] and [fullHeight] are ignored and the page is rendered in the specified dpi.
  /// If [boxFit] is set, the page image is rendered in a size, that fits into the box specified by [fullWidth], [fullHeight].
  /// If [width], [height], [fullWidth], [fullHeight], and [dpi] are all 0, the page is rendered at 72 dpi.

Rendering black screen in iOS (simulator)

Dear developer, first of all, congratulations on the effort.
I've been searching for a simple pdf viewer for flutter, but I couldn't get it to work. In flutter_pdf_render example, I just built it as it is in GitHub, and it gives me black screens, as shown in image below.

Captura de Tela 2019-09-07 às 20 39 20

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.6 18G95, locale pt-BR)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.35.0)
[✓] Connected device (1 available)

• No issues found!

I appreciate for your comments.
Regards

Error when building for iOS

Hi

Using this great on an Android device (on Windows) but when I try to run and deploy to the iOS Simulator on OSX, I'm getting the following error during the XCode build phase:

fatal error: 'pdf_render/pdf_render-Swift.h' file not found
#import <pdf_render/pdf_render-Swift.h>

Apologies - I'm not an iOS dev so I may be missing something trivially obvious.

Hang using PdfDocumentLoader (0.64.1 on Android)

I using this code to display pdf file from network url, but it seems like consumer lot of space?

Background young concurrent copying GC freed 364(78KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 80MB/80MB, paused 17.436ms total 46.478ms
Code

PdfDocumentLoader(
                                pageNumber: 1,
                                data: snapshot.data,
                              )

Crashed: com.apple.main-thread EXC_BREAKPOINT 0x0000000105bab8c0

Hi I'm experiencing the following crash only on ios. I'm unable to reproduce the issue but as far as I can tell the crash is not specific to one pdf.

Crashed: com.apple.main-thread
0  pdf_render                     0x1059eb8c0 $s10pdf_render14PdfPageTextureC9updateTex4page5destX0I1Y5width6height4srcX0L1Y9fullWidth0M6Height14backgroundFill17allowAntialiasingySo12CGPDFPageRefa_S3iSgARS2iSdSgASS2btF + 1536
1  pdf_render                     0x1059e9f0c $s10pdf_render20SwiftPdfRenderPluginC9updateTex4args6resultySo12NSDictionaryC_yypSgctKF015$syXlSgIeyBy_ypN7Iegn_TRyXlSgIeyBy_Tf1ncn_n + 4488
2  pdf_render                     0x1059eea88 $s10pdf_render20SwiftPdfRenderPluginC6handle_6resultySo17FlutterMethodCallC_yypSgctF015$syXlSgIeyBy_ypN7Iegn_TRyXlSgIeyBy_Tf1ncn_nTf4nng_n + 5772
3  pdf_render                     0x1059e6098 $s10pdf_render20SwiftPdfRenderPluginC6handle_6resultySo17FlutterMethodCallC_yypSgctFTo + 76
4  Flutter                        0x1061f8e60 (Missing)
5  Flutter                        0x105c700d8 (Missing)
6  Flutter                        0x105f6cf8c (Missing)
7  Flutter                        0x105f0dd94 (Missing)
8  Flutter                        0x105f0fbf4 (Missing)
9  CoreFoundation                 0x1971a1fa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
10 CoreFoundation                 0x1971a1ba0 __CFRunLoopDoTimer + 1064
11 CoreFoundation                 0x1971a0ffc __CFRunLoopDoTimers + 328
12 CoreFoundation                 0x19719aee4 __CFRunLoopRun + 1936
13 CoreFoundation                 0x19719a21c CFRunLoopRunSpecific + 600
14 GraphicsServices               0x1aed64784 GSEventRunModal + 164
15 UIKitCore                      0x199bdaee8 -[UIApplication _run] + 1072
16 UIKitCore                      0x199be075c UIApplicationMain + 168
17 Runner                         0x104b00688 main + 5 (AppDelegate.swift:5)
18 libdyld.dylib                  0x196e5a6b0 start + 4

Can't build project

Try to build for Android minSDK 24
When build project:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pdf_render:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /snap/flutter/current/usr/bin/ninja with arguments {-C /home/dev/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.11/android/.cxx/cmake/debug/armeabi-v7a bbhelper}
  ninja: Entering directory `/home/dev/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.11/android/.cxx/cmake/debug/armeabi-v7a'
  [1/2] Building CXX object CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o
  FAILED: CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o 
  /home/dev/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi21 --gcc-toolchain=/home/dev/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/dev/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot  -Dbbhelper_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -O0 -fno-limit-debug-info  -fPIC   -DBUILD_FOR_ANDROID -MD -MT CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o -MF CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o.d -o CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o -c ../../../../c++/directBufferAndroid.cpp
  In file included from ../../../../c++/directBufferAndroid.cpp:1:
  In file included from /home/dev/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/jni.h:28:
  In file included from /snap/flutter/current/usr/include/stdint.h:26:
  In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:
  In file included from /snap/flutter/current/usr/include/features.h:448:
  /snap/flutter/current/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
  # include <gnu/stubs-32.h>
            ^~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
Exception: Gradle task assembleDebug failed with exit code 1

Exception has occurred when fast scroll

I try multipage view with ListView.builder.
It is grate.
But exception has occurred when scroll is too fast or when warp in draggalbe_scrollabar and drag scroll thumb.

Exception has occurred.
_AssertionError ('package:flutter/src/widgets/media_query.dart': Failed assertion: line 812 pos 12: 'context != null': is not true.)

Screenshot parts of the PDF

Hey, firstly great plugin. it's working pretty smooth for most of what I need.

However I am stuck when I try to capture screenshot of whatever is displaying on the screen as an image.
I tried wrapping PDFViewer with the Screenshot plugin (https://pub.dev/packages/screenshot) but it just shows me empty screen without any text

My code

class CreateNotesView extends GetView<CreateNotesController> {
  @override
  Widget build(BuildContext context) {
    ScreenshotController screenshotController = ScreenshotController();
    return Scaffold(
      appBar: AppBar(
        title: Text('CreateNotesView'),
        centerTitle: true,
      ),
      body: Screenshot(
        controller: screenshotController,
        child: PdfViewer.openFile(
          controller.notesPdf.path,
        ),
      ),
      floatingActionButton: IconButton(
          onPressed: () {
            print('pressed');
            screenshotController.capture().then((value) {
              print('screenshot Done');
              Get.defaultDialog(
                content: Image.memory(value!)
              );
            }).catchError((onError) {
              print(onError);
            });
          },
          icon: Icon(Icons.camera)),
    );
  }
}

When I take screenshot it shows like this.
As you can see, the outline, borders, drop shadows et al are captured but the actual content inside the PDF is missing from the screenshot. Any tips on how to go about resolving this ?

IMG_9A6D6BE220D5-1

Need support of `/Annots`

Steps to reproduce

  • create a note with GoodNotes
  • while exporting select PDF Data Format Editable instead of Flattened
  • add the exported pdf to assets of the example application
  • run the exmaple
  • the text isn't rendered

Comparison

flutter_pdf_renderer
drive pdf viewer

Null check operator used on a null value (_pages)

Hey, first of all thanks for the great package. I've long searched for a good pdf renderer for flutter and I think I finally found one.

While testing the package with our users, firebase chrashlytics showed 3 different crash reports. I think they all occur because _pages is null. I'm unable to reproduce the issue locally but maybe you have an idea why this issue occurs.

Thanks in advance and have a nice day.

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown null.
       at _PdfViewerState._updateRealSizeOverlay(pdf_render_widgets.dart:1103)
       at _PdfViewerState.<fn>(pdf_render_widgets.dart:1095)
       at _CustomZone.<fn>(dart:async)
       at SemanticsConfiguration.<fn>(semantics.dart:2853)
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown Instance of 'ErrorDescription'.
       at _PdfViewerState._determinePagesToShow(pdf_render_widgets.dart:997)
       at ChangeNotifier.notifyListeners(change_notifier.dart:243)
       at PdfViewerController._setViewerState(pdf_render_widgets.dart:446)
       at _PdfViewerState.dispose(pdf_render_widgets.dart:808)
       at StatefulElement.unmount(framework.dart:4721)
       at _InactiveElements._unmount(framework.dart:2022)
       at _InactiveElements.<fn>(framework.dart:2020)
       at MultiChildRenderObjectElement.visitChildren(framework.dart:6076)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at MultiChildRenderObjectElement.visitChildren(framework.dart:6076)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at _SliverPersistentHeaderElement.visitChildren(sliver_persistent_header.dart:268)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at _InactiveElements.<fn>(framework.dart:2020)
       at ComponentElement.visitChildren(framework.dart:4549)
       at _InactiveElements._unmount(framework.dart:2018)
       at ListIterable.forEach(dart:_internal)
       at _InactiveElements._unmountAll(framework.dart:2031)
       at BuildOwner.<fn>(framework.dart:2785)
       at BuildOwner.lockState(framework.dart:2585)
       at BuildOwner.finalizeTree(framework.dart:2784)
       at WidgetsBinding.drawFrame(binding.dart:875)
       at RendererBinding._handlePersistentFrameCallback(binding.dart:319)
       at SchedulerBinding._invokeFrameCallback(binding.dart:1144)
       at SchedulerBinding.handleDrawFrame(binding.dart:1082)
       at SchedulerBinding._handleDrawFrame(binding.dart:998)
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown null.
       at _PdfViewerState._updatePageState(pdf_render_widgets.dart:1040)
       at _PdfViewerState.<fn>(pdf_render_widgets.dart:1035)
       at _CustomZone.<fn>(dart:async)
       at SemanticsConfiguration.<fn>(semantics.dart:2853)

Network Support

This is a lovely plugin, awesome work! Can you please try to include the support to render pdf files by fetching them from network/url?

⛔ MissingPluginException(No implementation found for method asset on channel pdf_render)

I/flutter (29464): │ ⛔ MissingPluginException(No implementation found for method asset on channel pdf_render)

  • OS: Android
  • Version : 11
  • Flutter (Channel stable, 2.0.3)
    code
 PdfViewer.openAsset(
          'https://firebasestorage.googleapis.com/v0/b/three-6bc5c.appspot.com/o/New%20Microsoft%20Word%20Document.pdf?alt=media&token=7ce24408-c636-4fde-9f39-9e24d835fbf3',
          onError: (_) => Logger().e(_),
        ),

Read password protected files?

Any plan to support password protected files? Like taking second parameter as password when calling PdfDocument.openFile(String filename, String password)

Y-axis flipped on iOS (or Android)

I did a few tests with this package and think I found a bug.

The API for render() does not behave the same way on iOS compared to Android.

When supplying a render sub-rectangle, the Y coordinate on Android origins from the top-left corner of the coordinate system. On iOS this is inverted and starts at the bottom-left corner.

Result is, that when rendering a part of a PDF file on both platforms, you'll get different results.

Worked around this by using a platform-check, but I'd assume that wasn't the plan. Also this is not documented anywhere, so I assume this is a bug.

Thanks!

Crashed: com.apple.main-thread EXC_BREAKPOINT 0x0000000106a94984

Hi I'm experiencing the following crash only on ios. I'm unable to reproduce the issue but as far as I can tell the crash is not specific to one pdf

97% devices are iPhone and 90% has iOS 14

Crashed: com.apple.main-thread
0  pdf_render                     0x106a94984 PdfPageTexture.updateTex(page:destX:destY:width:height:srcX:srcY:fullWidth:fullHeight:backgroundFill:) + 452 (SwiftPdfRenderPlugin.swift:452)
1  pdf_render                     0x106a97f10 specialized SwiftPdfRenderPlugin.updateTex(args:result:) + 341 (SwiftPdfRenderPlugin.swift:341)
2  pdf_render                     0x106a9931c specialized SwiftPdfRenderPlugin.handle(_:result:) + 4876 (<compiler-generated>:4876)
3  pdf_render                     0x106a90a78 @objc SwiftPdfRenderPlugin.handle(_:result:) + 76 (<compiler-generated>:76)
4  Flutter                        0x105e90e60 (Missing)
5  Flutter                        0x1059080d8 (Missing)
6  Flutter                        0x105c04f8c (Missing)
7  Flutter                        0x105ba5d94 (Missing)
8  Flutter                        0x105ba7bf4 (Missing)
9  CoreFoundation                 0x18c3a9fa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
10 CoreFoundation                 0x18c3a9ba0 __CFRunLoopDoTimer + 1064
11 CoreFoundation                 0x18c3a8ffc __CFRunLoopDoTimers + 328
12 CoreFoundation                 0x18c3a2ee4 __CFRunLoopRun + 1936
13 CoreFoundation                 0x18c3a221c CFRunLoopRunSpecific + 600
14 GraphicsServices               0x1a3f6c784 GSEventRunModal + 164
15 UIKitCore                      0x18ede2ee8 -[UIApplication _run] + 1072
16 UIKitCore                      0x18ede875c UIApplicationMain + 168
17 Educa Touch                    0x104169e1c main + 26 (main.m:26)
18 libdyld.dylib                  0x18c0626b0 start + 4

How to define a SWIFT_VERSION

I'm developing an app, and for the first time i'm trying to run in a iOS device, when a run pod install i receive this error:

  • pdf_render does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

I'm using the version 0.57.1

java.io.FileNotFoundException

I am trying to read file from the device memory but it is returning me an error. Here it is:
Error is PlatformException(error, Unsupported value: java.io.FileNotFoundException: flutter_assets//storage/emulated/0/Android/data/cn.wps.moffice_eng/.cache/KingsoftOffice/file/download/05ab545e-7efb-4083-9ee5-f4994862bde8/sample.pdf, null)

Copy & Paste

Does this plugin support for recognise PDF font for copy clipboard purpose?

PdfPage.render() on Web

I'm trying to make a PdfPage render to create the image using the code

Future<ui.Image> generaPreviewPdf(Uint8List pdfData) async {
    PdfDocument documento = await PdfDocument.openData(pdfData);
    PdfPage pagina = await documento.getPage(1);
    PdfPageImage immaginePagina = await pagina.render();
    ui.Image image = await immaginePagina.createImageIfNotAvailable();
    return image;
}

My issue is that on mobile (IOS) this works fine but on web the instruction PdfPageImage immaginePagina = await pagina.render(); does an infinite wait and it never create the PdfPageImage.

No version of NDK matched

Hello. i run your example project. when i run this error happen. how can i solve ?

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':pdf_render'.
> No version of NDK matched the requested version 21.0.6113669. Versions available locally: 21.3.6528147, 21.3.6528147

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
Exception: Gradle task assembleDebug failed with exit code 1

Null check operator used on a null value

Exception:
Null check operator used on a null value

Stack trace:
#0 _PdfViewerState._updatePageState (package:pdf_render/pdf_render_widgets.dart:1121)

Version 1.0.12

MissingPluginException(No implementation found for method data on channel pdf_render)

No matter what I do I always end up getting this error:

E/flutter (13502): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method data on channel pdf_render) E/flutter (13502): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7) E/flutter (13502): <asynchronous suspension> E/flutter (13502): #1 PdfDocument.openData (package:pdf_render/pdf_render.dart:65:33) E/flutter (13502): <asynchronous suspension> E/flutter (13502): #2 _PdfDocumentLoaderState._init (package:pdf_render/pdf_render_widgets.dart:121:32) E/flutter (13502): <asynchronous suspension> E/flutter (13502): #3 _PdfDocumentLoaderState.initState (package:pdf_render/pdf_render_widgets.dart:79:5) E/flutter (13502): #4 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4061:58) E/flutter (13502): #5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3912:5) E/flutter (13502): #6 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3094:14) E/flutter (13502): #7 Element.updateChild (package:flutter/src/widgets/framework.dart:2897:12) E/flutter (13502): #8 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3954:16) E/flutter (13502): #9 Element.rebuild (package:flutter/src/widgets/framework.dart:3731:5) E/flutter (13502): #10 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2341:33) E/flutter (13502): #11 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:775:20) E/flutter (13502): #12 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:279:5) E/flutter (13502): #13 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1040:15) E/flutter (13502): #14 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:982:9) E/flutter (13502): #15 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:898:5) E/flutter (13502): #16 _rootRun (dart:async/zone.dart:1124:13) E/flutter (13502): #17 _CustomZone.run (dart:async/zone.dart:1021:19) E/flutter (13502): #18 _CustomZone.runGuarded (dart:async/zone.dart:923:7) E/flutter (13502): #19 _invoke (dart:ui/hooks.dart:249:10) E/flutter (13502): #20 _drawFrame (dart:ui/hooks.dart:207:3)

My layout:

PdfDocumentLoader(
        data: pdfModel.plan,
        documentBuilder: (context, pdfDocument, pageCount) => LayoutBuilder(
            builder: (context, constraints) => ListView.builder(
                itemCount: pageCount,
                itemBuilder: (context, index) => Container(
                    color: Colors.green,
                    child: PdfPageView(
                        pdfDocument: pdfDocument,
                        pageNumber: index + 1,
                        // calculateSize is used to calculate the rendering page size
                        calculateSize: (pageWidth, pageHeight, aspectRatio) =>
                            Size(
                                constraints.maxWidth - 0,
                                (constraints.maxWidth - 0) / aspectRatio)
                    )
                )
            )
        ),
      );

pdfModel.plan contains a uint8Array which did work on differen pdf libraries like:
https://pub.dev/packages/native_pdf_renderer#-example-tab-
but I really would prefer your library a LOT

Addiditional environment information:
Flutter 1.10.2 • channel dev • https://github.com/flutter/flutter.git Framework • revision f5733f7a62 (5 days ago) • 2019-09-11 21:03:42 -0700 Engine • revision 7ea9884ab0 Tools • Dart 2.5.0 (build 2.5.0-dev.4.0 be66176534)

version solving failed

How to fix?

The current Flutter SDK version is 1.5.4-hotfix.2.   

Because pdf_render 0.64.1 requires Flutter SDK version >=1.10.0 <2.0.0 and no versions of pdf_render match >0.64.1 <0.65.0, pdf_render ^0.64.1 is forbidden.
So, because abc depends on pdf_render ^0.64.1, version solving failed.

pub get failed (1)
exit code 1

pubspec.yaml

version: 1.0.0+1

environment:
  sdk: ">=2.2.2 <3.0.0"
....

build failing in version ^1.0.11. error -> Execution failed for task ':pdf_render:externalNativeBuildDebug'.

This is the error I got in the run window.

* What went wrong:
Execution failed for task ':pdf_render:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /snap/flutter/current/usr/bin/ninja with arguments {-C /home/androiddeveloper/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.11/android/.cxx/cmake/debug/armeabi-v7a bbhelper}
  ninja: Entering directory `/home/androiddeveloper/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.11/android/.cxx/cmake/debug/armeabi-v7a'
  [1/2] Building CXX object CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o
  FAILED: CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o 
  /home/androiddeveloper/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi21 --gcc-toolchain=/home/androiddeveloper/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/androiddeveloper/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot  -Dbbhelper_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -O0 -fno-limit-debug-info  -fPIC   -DBUILD_FOR_ANDROID -MD -MT CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o -MF CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o.d -o CMakeFiles/bbhelper.dir/c++/directBufferAndroid.cpp.o -c ../../../../c++/directBufferAndroid.cpp
  In file included from ../../../../c++/directBufferAndroid.cpp:1:
  In file included from /home/androiddeveloper/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/jni.h:28:
  In file included from /snap/flutter/current/usr/include/stdint.h:26:
  In file included from /snap/flutter/current/usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:
  In file included from /snap/flutter/current/usr/include/features.h:448:
  /snap/flutter/current/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
  # include <gnu/stubs-32.h>
            ^~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.

Zoom feature

I really like your pdf library!

It does everything exactly the way I want it too except one thing:

I really need the possibility to zoom into my files.

Is there a way? If not: Will there be one in the near future?

web - renders blank, with no console error

Can see in the inspector that the js gets loaded.
Works fine on mobile (iOS simulator).
Loading pdf from memory.
Here's how I render using your api (pdfDoc is created by the pdf package):

Scaffold(
appBar: _appbar,
body: FutureBuilder(
future: PdfDocument.openData(Uint8List.fromList(widget.helper.pdfDoc.save())),
builder: (context, snapshot) {
print('LayoutBuilder...');
print(' ****** devicePixelRatio ${MediaQuery.of(context).devicePixelRatio}');
return snapshot.hasData
? LayoutBuilder(
builder: (context, constraints) => ListView.builder(
itemCount: widget.helper.pdfDoc.document.pdfPageList.pages.length,
itemBuilder: (context, index) => Container(
margin: EdgeInsets.all(FlowchartPdfPageMobile.margin),
padding: EdgeInsets.all(FlowchartPdfPageMobile.padding),
color: Colors.black12,
child: PdfPageView(
pdfDocument: snapshot.data,
pageNumber: index + 1,
)),
),
)
: Container();
},
),
);

web ?

Are you planning a web version ?

Flutter Web - sometimes a graphics heavy pdf draws as a blank page

Greetings! To start with thanks for your work on this package. :-)

I noticed some a random issue on one pdf where a particular page would go white until the widget was rebuilt. This could be most easily triggered by resizing the Chrome window. I was able to replicate this with just a PdfPageView widget and in the sample code below. It turns out that when there is a large image in the pdf page (or a couple of smaller ones) that this can happen. Perhaps related to #35

I have created a sample PDF with a large image in it that reliably triggers on Chrome in Windows and Mac. The file is available here https://drive.google.com/file/d/13QwssubETQZhYRMDO6E9OfUBR0pYBoF3/view?usp=sharing
Indeed it can be hard to get it to render until you make the window small. Do you have any suggestions how this could be trapped / automatically recovered from?

pdf_render - version: "1.0.12"

minimal code sample

import 'package:flutter/material.dart';
import 'package:pdf_render/pdf_render_widgets.dart';

void main(List args) => runApp(MyApp());

class MyApp extends StatefulWidget {
@OverRide
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.grey,
body: PdfDocumentLoader.openAsset(
'assets/problemPDF.pdf',
pageNumber: 1,
pageBuilder: (context, textureBuilder, pageSize) => textureBuilder(),
),
),
);
}
}

flutter doctor

[√] Flutter (Channel master, 2.5.0-7.0.pre.110, on Microsoft Windows [Version 10.0.17763.2114], locale en-IE)
• Flutter version 2.5.0-7.0.pre.110 at C:\Code\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3572a7e8b7 (3 days ago), 2021-08-17 11:52:05 -0700
• Engine revision 7dc8eba6ae
• Dart version 2.15.0 (build 2.15.0-15.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Omega\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.

[√] Chrome - develop for the web
• CHROME_EXECUTABLE = C:\Code\FlutterTesting\ChromeCORS.bat

[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• 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 11.0.8+10-b944.6842174)

[√] VS Code (version 1.59.0)
• VS Code at C:\Users\Omega\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.23.0

[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
• Edge (web) • edge • web-javascript • Microsoft Edge 92.0.902.73

• No issues found!

Compilation problem for version >= 0.64.0

flutter doctor:

[✓] Flutter (Channel beta, 1.21.0-9.1.pre, on Mac OS X 10.15.6 19G2021, locale fr-FR)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.48.1)
[✓] Connected device (4 available)

Error:

   /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:19: warning: expression implicitly coerced from
    'FlutterStandardTypedData?' to 'Any'
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:37: note: provide a default value to avoid this warning
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                           ?? <#default value#>
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:37: note: force-unwrap the value to avoid this warning
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                          !
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:37: note: explicitly cast to 'Any' with 'as Any' to silence this warning
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                           as Any
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:19: warning: expression implicitly coerced from
    'FlutterStandardTypedData?' to 'Any'
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:37: note: provide a default value to avoid this warning
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                           ?? <#default value#>
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:37: note: force-unwrap the value to avoid this warning
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                          !
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/ios/C
    lasses/SwiftPdfRenderPlugin.swift:261:37: note: explicitly cast to 'Any' with 'as Any' to silence this warning
              "data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil,
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                           as Any
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:5: warning: 'FLTPDFViewController' is only available on iOS 11.0 or newer
    [-Wunguarded-availability-new]
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
        ^~~~~~~~~~~~~~~~~~~~
    In file included from
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:4:
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.h:11:12: note: 'FLTPDFViewController' has been marked as being introduced in iOS
    11.0 here, but the deployment target is iOS 9.0.0
    @interface FLTPDFViewController : NSObject <FlutterPlatformView, PDFViewDelegate> 
               ^
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:5: note: enclose 'FLTPDFViewController' in an @available check to silence
    this warning
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
        ^~~~~~~~~~~~~~~~~~~~
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:49: warning: 'FLTPDFViewController' is only available on iOS 11.0 or newer
    [-Wunguarded-availability-new]
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
                                                    ^~~~~~~~~~~~~~~~~~~~
    In file included from
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:4:
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.h:11:12: note: 'FLTPDFViewController' has been marked as being introduced in iOS
    11.0 here, but the deployment target is iOS 9.0.0
    @interface FLTPDFViewController : NSObject <FlutterPlatformView, PDFViewDelegate> 
               ^
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:49: note: enclose 'FLTPDFViewController' in an @available check to silence
    this warning
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
                                                    ^~~~~~~~~~~~~~~~~~~~
    2 warnings generated.
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:5: warning: 'FLTPDFViewController' is only available on iOS 11.0 or newer
    [-Wunguarded-availability-new]
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
        ^~~~~~~~~~~~~~~~~~~~
    In file included from
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:4:
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.h:11:12: note: 'FLTPDFViewController' has been marked as being introduced in iOS
    11.0 here, but the deployment target is iOS 9.0.0
    @interface FLTPDFViewController : NSObject <FlutterPlatformView, PDFViewDelegate> 
               ^
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:5: note: enclose 'FLTPDFViewController' in an @available check to silence
    this warning
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
        ^~~~~~~~~~~~~~~~~~~~
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:49: warning: 'FLTPDFViewController' is only available on iOS 11.0 or newer
    [-Wunguarded-availability-new]
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
                                                    ^~~~~~~~~~~~~~~~~~~~
    In file included from
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:4:
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.h:11:12: note: 'FLTPDFViewController' has been marked as being introduced in iOS
    11.0 here, but the deployment target is iOS 9.0.0
    @interface FLTPDFViewController : NSObject <FlutterPlatformView, PDFViewDelegate> 
               ^
    /Users/egylis/Documents/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdfview-1.0.3+3
    /ios/Classes/FlutterPDFView.m:25:49: note: enclose 'FLTPDFViewController' in an @available check to silence
    this warning
        FLTPDFViewController* pdfviewController = [[FLTPDFViewController alloc] initWithFrame:frame
                                                    ^~~~~~~~~~~~~~~~~~~~
    2 warnings generated.
    lib/db/media_data.dart:424:28: Error: The getter 'image' isn't defined for the class 'PdfPageImage'.
     - 'PdfPageImage' is from 'package:pdf_render/pdf_render.dart'
     ('../../Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-0.66.0/lib/pdf_render.dart'
     ).
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'image'.
        var data = await image.image.toByteData(format: ui.ImageByteFormat.png);
                               ^^^^^
```

RangeError

flutter:
#0      List.[] (dart:core-patch/growable_array.dart:254:60)
#1      PdfViewerController.getPageRect (package:pdf_render/pdf_render_widgets.dart:374:55)
#2      PdfViewerController.calculatePageFitMatrix (package:pdf_render/pdf_render_widgets.dart:379:18)
#3      _PdfViewerState._relayout.<anonymous closure> (package:pdf_render/pdf_render_widgets.dart:684:36)
#4      new Future.delayed.<anonymous closure> (dart:async/future.dart:315:39)
#5      _rootRun (dart:async/zone.dart:1346:47)
#6      _CustomZone.run (dart:async/zone.dart:1258:19)
#7      _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
#8      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1202:23)
#9      _rootRun (dart:async/zone.dart:1354:13)
#10     _CustomZone.run (dart:async/zone.dart:1258:19)
#11     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1186:23)
#12     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#13     _Timer._runTimers (<…>
flutter: ----------------------------------------------------`

JumpTo specific page

Hello, can we jump to specific page with getPage() ?

Can you share a snippet for jumping to a specific page when opening a PDF document ?

Error Editor placeholder in source file ?

I try to run my app on simulator and show this message.

im using MacBook Air (M1, 2020) with macos big sur

Xcode build done. 3.7s
Failed to build iOS app
Error output from Xcode build:

objc[8450]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f0148188) and ?? (0x1129602b8). One of the two will be used. Which one is undefined.
objc[8450]: Class AMSupportURLSession is implemented in both ?? (0x1f01481d8) and ?? (0x112960308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:

/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.9/ios/Classes/SwiftPdfRenderPlugin.swift:261:93: error: editor placeholder in source file
"data": data.address == 0 ? FlutterStandardTypedData(bytes: data.data) : nil ?? <#default value#>,

Null check operator used on a null value


flutter:

#0      PdfDocumentMethodChannel.getPage (package:pdf_render/src/pdf_render_method_channel.dart:100:115)

<asynchronous suspension>

#1      _PdfViewerState.load (package:pdf_render/pdf_render_widgets.dart:766:25)

<asynchronous suspension>

flutter: ----------------------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.