Handling Streams instead/complementary of files
Get a readable stream (pdf) and return an other readable (png) to let developer pipe it in the writable of its choice.
I am working on it for my own need, but it need a re-design of the core abstracting the conversion and providing methods to configure input and output types (files or streams).
Did you already worked on it or not at all ? Do you want pull requests when I will achieve it, or you prefer it stay in my fork ?
Or do you want we release it together ?
I'm very sorry for my late response @rbecheras. I've taken a bit long holiday.
Streaming input/output is a very good idea. I've not worked on that, but patches are welcome!
BTW, I found a module imagemagick-stream (https://github.com/eivindfjeldstad/imagemagick-stream), which may meet your need. Have you checked?
What happend to this? @mooz @rbecheras?
Does this library support stream processing?
I like to use it in combination with multer s3 stream upload to generate a preview of an PDF as thumbnail. Is this anyhow possible?
Just for the benefit of others coming here with a similar requirement, I used the following (imperfect) process for getting a Buffer into pdf-image and working with the output via temp-write:
const fs = require('fs');
const tempWrite = require('temp-write');
const PDFImage = require("pdf-image").PDFImage;
const filepath = tempWrite.sync('unicorn');
const Body = new Buffer(...)
fs.writeFileSync(filepath, Body);
var PDFImage = require("pdf-image").PDFImage;
var pdfImage = new PDFImage(filepath, options);
pdfImage.convertPage(0).then(function (imagePath) {...
@manuelfink Hey:) Have you found a good solution for your use-case, I currently face the same issue.