flutter_pdf_render
flutter_pdf_render copied to clipboard
Help, Get worker.min.js leak when resize flutter web
Dont know whats wrong with my code
Expanded(
child: openedFile != null
? PdfViewer.openData(openedFile!,
viewerController: controller,)
: Container())
index.html script. i have qrcode scanner, and google maps api too but it is normal. I suspect that the bug is from worker
pdfjsLib.GlobalWorkerOptions.workerSrc =
"https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.js";
<script src="https://unpkg.com/@zxing/[email protected]" type="application/javascript"></script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
<script src="https://maps.googleapis.com/maps/api/js?key=API-KEY"></script>
<!-- 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>
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.22631.2715], locale id-ID)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.4.4)
[√] Android Studio (version 2023.1)
[√] VS Code (version 1.85.0-insider)
[√] Connected device (3 available)
[√] Network resources
• No issues found!
I thinks it is related to #126 too because its flash and re download the pdf.js . Maybe bug when rebuilding viewer 🤔