sensiolabs / GotenbergBundle

A Symfony Bundle for interacting with Gotenberg. Integrates natively with twig, router, PHPStorm and more !
MIT License
35 stars 10 forks source link

Add merge route #67

Closed StevenRenaux closed 4 months ago

StevenRenaux commented 4 months ago

close #44

    #[Route('/merge', name: 'pdf_merge')]
    public function merge(GotenbergPdfInterface $gotenberg): Response
    {
        return $gotenberg->merge()
            ->pdfUniversalAccess()
            ->pdfFormat(PdfFormat::Pdf1b)
            ->files('document.pdf', 'doc_pdf.pdf')
            ->generate()
        ;
    }
Jean-Beru commented 4 months ago

I'd like a future improvement that would take n PdfBuilderInterface's to be able to merge them. All thos would have to leverage the asynchronicity of HttpClient. cc @Jean-Beru

Good idea. Let's create an issue to define this behavior. IMHO, we'll have to handle PDF order. Ex: "i want to merge intro.pdf, generated invoice 1, generated invoice 2, outro.pdf.