Closed Aerofluxx closed 5 months ago
0.2.3 is a new release that fixes the PdfPage.render (Web)'s behavior difference from other platforms. Please check it.
Hey :)
I'm sorry but I'm still getting
TypeError: Cannot perform %TypedArray%.prototype.set on a detached ArrayBuffer
dart-sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart 691:31 [_setRangeFast]
dart-sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart 735:7 setRange
dart-sdk/lib/convert/byte_conversion.dart 81:5 add
dart-sdk/lib/async/zone.dart 1594:9 runUnaryGuarded
dart-sdk/lib/async/stream_impl.dart 339:5 [_sendData]
dart-sdk/lib/async/stream_impl.dart 271:7 [_add]
dart-sdk/lib/async/stream_transformers.dart 63:11 [_add]
dart-sdk/lib/async/stream_transformers.dart 13:5 add
packages/dio/src/progress_stream/browser_progress_stream.dart 33:15 <fn>
dart-sdk/lib/async/stream_transformers.dart 209:7 add
dart-sdk/lib/async/stream_transformers.dart 111:7 [_handleData]
dart-sdk/lib/async/zone.dart 1594:9 runUnaryGuarded
dart-sdk/lib/async/stream_impl.dart 339:5 [_sendData]
dart-sdk/lib/async/stream_impl.dart 515:13 perform
dart-sdk/lib/async/stream_impl.dart 620:10 handleNext
dart-sdk/lib/async/stream_impl.dart 591:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7 <fn>
on the same code that works without any probs on MacOS Build.
Can i provide you with any further information for debugging? Just let me know :)
Thank you!
Edit:
Just to let u know, I'm having this in my index.html and also made a flutter clean before I've tried it again.
<!-- IMPORTANT: load pdfjs files -->
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js" type="text/javascript"></script>
<script type="text/javascript">
pdfjsLib.GlobalWorkerOptions.workerSrc =
"https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.worker.min.js";
pdfRenderOptions = {
// where cmaps are downloaded from
cMapUrl: "https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/cmaps/",
// The cmaps are compressed in the case
cMapPacked: true,
// any other options for pdfjsLib.getDocument.
// params: {}
};
</script>
Any news / ideas on this topic @espresso3389? :)
I don't know what's happening on your code but the log shows me that the error is caused by dio package.
packages/dio/src/progress_stream/browser_progress_stream.dart 33:15
pdfrx does not depend on dio and it may be caused by CORS or something?
Got you!
Strangest thing for me is, that the same code is working fine with your pdf_render package. There I'm getting no dio errors, which means to me, that pdfrx does something different in web on creating the image.
Also same code works fine on MacOS build. I can exclude a CORS problem (disabled security for debugging locally).
Goooooosh ... thank you for the kind tip. I was blind or something.
I had to deep copy my Uint8List file bytes because after handling the createPdfThumbnail, the original bytes array was empty.
Hello,
I'm trying to switch from pdf_render over to pdfrx but having some troubles doing this.
My "old" thumbnail generation was something like this
Changing to pdfrx it will be
And getting this error (but only in flutter for web, working fine on MacOS build)