kleisauke / wasm-vips

libvips for the browser and Node.js, compiled to WebAssembly with Emscripten.
https://kleisauke.github.io/wasm-vips/
MIT License
463 stars 25 forks source link

ab [vips::Error]: no such operation pdfload_buffer VipsOperation: class "pdfload_buffer" not found #56

Open AnoopFranc opened 8 months ago

AnoopFranc commented 8 months ago
        const vipsImage = vips.Image.pdfloadBuffer(attachment, {page: pageNumber});
        const  image = vipsImage.pngsaveBuffer();

I wanted to create preview image for pdf with same scale in node js, but seems like it's not working, throws me an error

ab [vips::Error]: no such operation pdfload_buffer VipsOperation: class "pdfload_buffer" not found

I am using Node - v18.16.0 "wasm-vips": "^0.0.5"

Is this something that is not developed or is it a bug

kleisauke commented 8 months ago

wasm-vips doesn't currently support loading PDF files, since it's dependent on PDFium, which is a bit tricky to set-up given that it uses a non-standard build system (i.e. gclient and gn).

libvips also has the ability to load PDF files using Poppler. However, it's licensed under the GPL, which means you cannot distribute statically linked binaries with it (PDFium doesn't have this issue as it is licensed under the permissive Apache-2.0 license).