gettalong / hexapdf

Versatile PDF creation and manipulation for Ruby
https://hexapdf.gettalong.org
Other
1.25k stars 70 forks source link

StringIO support when opening existing PDF #320

Closed kapso closed 4 months ago

kapso commented 4 months ago

Is this the only way to create HexaPDF::Document instance using StringIO?

I could not find anything in the docs.

form = HTTP.get(FORM_URL).to_s
HexaPDF::Document.new(*[], io: StringIO.new(form))
gettalong commented 4 months ago

Yes, you can directly pass any IO instance to HexaPDF::Document.new. The HexaPDF::Document.open method can additionally be used when opening files.