fix(pdfengines): single file for watermark/stamp, and add the feature to the downloadFrom one

This commit is contained in:
Julien Neuhart
2026-03-18 23:22:31 +01:00
parent b98378311f
commit 410c1dfd7f
11 changed files with 173 additions and 77 deletions

View File

@@ -560,6 +560,32 @@ Feature: /forms/pdfengines/merge
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@download-from
Scenario: POST /forms/pdfengines/merge (Watermark via Download From)
Given I have a Gotenberg container with the following environment variable(s):
| PDFENGINES_WATERMARK_ENGINES | pdfcpu |
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| downloadFrom | [{"url":"http://host.docker.internal:%d/static/testdata/watermark.png","field":"watermark"}] | field |
| watermarkSource | image | field |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@download-from
Scenario: POST /forms/pdfengines/merge (Stamp via Download From)
Given I have a Gotenberg container with the following environment variable(s):
| PDFENGINES_STAMP_ENGINES | pdfcpu |
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| downloadFrom | [{"url":"http://host.docker.internal:%d/static/testdata/page_2.pdf","field":"stamp"}] | field |
| stampSource | pdf | field |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@webhook
Scenario: POST /forms/pdfengines/merge (Webhook)
Given I have a default Gotenberg container