You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The files its creates are hugh! A 2.4Mb file comes out as 23.2Mb...Maybe a files compression thing, and also not very high on the list given the size of todays harddrives, but nonetheless...
showed very promising results however, reducing a generated PDF from 55MB to 5.7MB.
It might be possible to get ghostscript to work via wasm and use that to optimize the PDF, as demonstrated by laurentmmeyer/ghostscript-pdf-compress.wasm. The downside of that is having to download the ghostscript wasm build, which is around 18MB. But compression could be made optional with a checkbox and things only loaded if necessary.
The text was updated successfully, but these errors were encountered:
It turns out that just switching the card images from PNG to JPG already sufficed.
I actually also got Ghostscript to work in WebAssembly, but that turned out to be unusably slow with larger PDFs, so this approach was abandoned (and frankly, also a bit overengineered and backwards).
Problem
Solution
Apparently that's a known and so far unsolved issue with pdf-lib, see for example Hopding/pdf-lib#1338.
A first test on the command line with
showed very promising results however, reducing a generated PDF from 55MB to 5.7MB.
It might be possible to get ghostscript to work via wasm and use that to optimize the PDF, as demonstrated by laurentmmeyer/ghostscript-pdf-compress.wasm. The downside of that is having to download the ghostscript wasm build, which is around 18MB. But compression could be made optional with a checkbox and things only loaded if necessary.
The text was updated successfully, but these errors were encountered: