pdftoimage icon indicating copy to clipboard operation
pdftoimage copied to clipboard

PdfToImage with inline_pdf and saving to IO

Open reiz opened this issue 1 year ago • 2 comments

This works fine:

images = PDFToImage.open('somefile.pdf')

But how can I init it with an inline PDF content? Without having a file? I'm working in a cloud environment and I get PDF content via a stream from another service. I don't want to write it to a file first. Something like this would be awesome:

images = PDFToImage.new( pdf_content.to_s )

And saving to an IO wold be nice to. Maybe like this:

io = StringIO()
page.resize('150').quality('80%').save( io )

reiz avatar Jul 26 '24 08:07 reiz

How can I use this Gem without having a file and without writing to a file?

reiz avatar Jul 26 '24 09:07 reiz

@robflynn is this possible to do with the poppler library? I'm not sure I've properly understood it, but happy to take a stab at a PR if you could point me broadly at what I need to look at!

simmerz avatar Oct 12 '24 17:10 simmerz