I used the pdf package in my Flutter web project. It is completely working while I run it in debug or release mode, but when the web is deployed, it is not working. We can see it is clickable, but nothing happens after clicking.
Currently, when I click on the button, I can see it is clicked, but nothing happens. I want to generate a pdf while clicking, and this problem only arises when the web is deployed.
I tried to put this code in the index.html file, but nothing happened.
<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>
Snehil Tejani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1