flutter_html_to_pdf icon indicating copy to clipboard operation
flutter_html_to_pdf copied to clipboard

Crash on iOS

Open NickoftheSouth opened this issue 4 years ago • 1 comments

PDF generation generally works but there is an issue which is causing a crash on some iOS devices. Seems to be most common on iPads.

Looks like the root cause may be this issue.

Here's the log from the crash

<NSKeyValueObservance 0x1b091e00: Observer: 0x1b08d1a0, Key path: loading, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x15549f90>
)'
*** First throw call stack:
(0x23b0b91b 0x232a6e17 0x23b0b861 0x242c27a9 0x232c13a9 0x23a1af89 0x23acc06f 0x23a1b229 0x23a1b015 0x2500bac9 0x280ef189 0xea679 0x236c3873)
libc++abi.dylib: terminating with uncaught exception of type NSException

calling code looks like this (where contentToUse is a string of html);

    Directory tempDir = await getTemporaryDirectory();
    String tempPath = tempDir.path;
    String filename = getFilename("content");

    var generatedPdfFile = await FlutterHtmlToPdf.convertFromHtmlContent(
        contentToUse, tempPath, filename);
    return generatedPdfFile;

NickoftheSouth avatar Apr 19 '20 21:04 NickoftheSouth

Same here

margaritageleta avatar Jul 12 '20 19:07 margaritageleta