Is there any proper way to save a generated pdf into a file? #180
Answered
by
Neirda24
kozmaoliver
asked this question in
Q&A
-
First I tried this: $pdfResponse = $this->gotenberg
->html()
->content('@pdf/base.html.twig', [])
->paperStandardSize(PaperSize::A4)
->generate();
file_put_contents($filePath, $pdfResponse->stream()->getContent()); But then I realized that the getContent() returns false here. |
Beta Was this translation helpful? Give feedback.
Answered by
Neirda24
Aug 15, 2025
Replies: 1 comment 2 replies
-
Hi @kozmaoliver . Did you had a look at https://github.com/sensiolabs/GotenbergBundle/blob/1.x/docs/processing.md ? If you want to store a pdf to a file you could use a FileProcessor. It provides example inside a controller and outside. The |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
kozmaoliver
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @kozmaoliver . Did you had a look at https://github.com/sensiolabs/GotenbergBundle/blob/1.x/docs/processing.md ? If you want to store a pdf to a file you could use a FileProcessor. It provides example inside a controller and outside. The
generate
method returns a SplFileInfo object of the dumped file.