node-pdf2img icon indicating copy to clipboard operation
node-pdf2img copied to clipboard

Output to base64?

Open QAnders opened this issue 6 years ago • 3 comments

Thanks for this, it works just fine if you follow the instructions for install! Also note that ImageMagick does NOT work on other platforms than Linux (it works fine in Ubuntu subsystem on Windows 10 though).

I'd like to request a feature to return the created image as base64 instead of saving it to file on disk. E.g.:

{ result: 'success',
  message: 
   [ { page: 1,
       name: 'test_1',
       size: 17.275,
       content: '/9j/7QBEUGhvdG9zaG9...base64-encoded-image-content...fXNWzvDEeYxxxzj/Coa6Bax//Z'
     },
     { page: 2,
       name: 'test_2',
       size: 24.518,
       content: '/9j/7QBEUGhvdG9zaG9...base64-encoded-image-content...fXNWzvDEeYxxxzj/Coa6Bax//Z'
     }
   ]
}

QAnders avatar Aug 11 '17 07:08 QAnders

It already exists support in https://github.com/didikeke/gm-base64/. Maybe something to work from?

QAnders avatar Aug 11 '17 07:08 QAnders

It's a good idea. It will be included in the next release.

fitraditya avatar Aug 21 '17 05:08 fitraditya

Hi, I made pdf to image converter that supports this feature you can go check it out at: https://github.com/yakovmeister/pdf2image

yakovmeister avatar Apr 12 '18 05:04 yakovmeister