-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add a builder to write pdf metadata #93
base: main
Are you sure you want to change the base?
Feature: Add a builder to write pdf metadata #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
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... |
552809f
to
1f8ed84
Compare
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.
Of course but some applications may want to delegate this task to the Gotenberg container. IMHO (here @ConstantBqt ), 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 #90 we will only cover the output part. |
Sure! It deserve a new issue to improve content and asset files. |
docs/pdf/write-metadata-builder.md
Outdated
{ | ||
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response | ||
{ | ||
return $gotenberg->writeMetadata() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the example here I wonder. Because there is also the read metadata. We don't "generate" anything. Maybe it should out of scope of builders... ?
2ca9878
to
0444157
Compare
Add
WriteMetadataPdfBuilder
, inspired byMergePdfBuilder
Partially resolve issue #43