Skip to content
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

Add merge route #67

Merged
merged 2 commits into from
Jun 17, 2024
Merged

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