Skip to content

Conversation

StevenRenaux
Copy link
Collaborator

@StevenRenaux StevenRenaux commented Jun 14, 2024

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()
        ;
    }

Copy link
Contributor

@Neirda24 Neirda24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Jean-Beru
Copy link
Contributor

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.

@StevenRenaux StevenRenaux merged commit 338204d into sensiolabs:main Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implements the merge PDF route
3 participants