Open ConstantBqt opened 4 months ago
I wonder though if it is worth the effort these routes ? Because we already provide a way to set metadata on generate. It requires to put the whole PDF into memory, send it though http to gotenberg and download it again as a stream response potentially. Might not be worth it. @Jean-Beru : WDYT ?
IMO this is useful to update the metadata an existing PDF file. I imagine this scenario:
Someone needs to modify thousands of its company's PDFs to change the metadata Copyright or Keywords.
Someone needs to modify thousands of its company's PDFs to change the metadata Copyright or Keywords.
But then I would recommend to directly use a binary for this scenario. It requires too much memory + http bandwidth for such small and edge cases...
I wonder though if it is worth the effort these routes ? Because we already provide a way to set metadata on generate. It requires to put the whole PDF into memory, send it though http to gotenberg and download it again as a stream response potentially. Might not be worth it. @Jean-Beru : WDYT ?
Putting whole PDF in memory is not mandatory. HttpClient accepts callback and resources as body: https://symfony.com/doc/current/http_client.html#uploading-data.
But then I would recommend to directly use a binary for this scenario. It requires too much memory + http bandwidth for such small and edge cases...
Of course but some applications may want to delegate this task to the Gotenberg container.
IMHO (here @ConstantBqt :trollface: ), this endpoint can be implemented as a very simple builder. The hardest thing is to know how split our code between file generation (screenshot, pdf, etc.) and data retrieval (read metadata, async, etc.)
Our implementation of the http client does not yet covers memory efficient input. even with https://github.com/sensiolabs/GotenbergBundle/pull/90 we will only cover the output part.
Our implementation of the http client does not yet covers memory efficient input. even with #90 we will only cover the output part.
Sure! It deserve a new issue to improve content and asset files.
Add
WriteMetadataPdfBuilder
, inspired byMergePdfBuilder
Partially resolve issue #43