fix(pdf): flatten an unchecked box that stores no off appearance

This commit is contained in:
Julien Neuhart
2026-11-30 09:56:54 +01:00
parent e17473e8a3
commit b5b9c3c5a5
4 changed files with 15 additions and 3 deletions

2
go.mod
View File

@@ -12,7 +12,7 @@ require (
github.com/gobwas/ws v1.5.0
github.com/gomarkdown/markdown v0.0.0-20261124143954-1814b856890d
github.com/google/uuid v1.6.0
github.com/gotenberg/litho v0.0.22
github.com/gotenberg/litho v0.0.24
github.com/hashicorp/go-retryablehttp v0.7.8
github.com/labstack/echo/v5 v5.4.7
github.com/labstack/gommon v0.5.0

4
go.sum
View File

@@ -122,8 +122,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
github.com/gotenberg/litho v0.0.22 h1:Fqv6vXjtUZ7new9QBGDfQca+yBq543wn8UlsADnsL2g=
github.com/gotenberg/litho v0.0.22/go.mod h1:UHwIc1GVEcDdfIz004OeHOG6t9YD/otgO/gtCu5nD3s=
github.com/gotenberg/litho v0.0.24 h1:SBlYNrnL1S0ZSEglJRrQ2mAeiBsJNr5RhBP6EhCkxYg=
github.com/gotenberg/litho v0.0.24/go.mod h1:UHwIc1GVEcDdfIz004OeHOG6t9YD/otgO/gtCu5nD3s=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 h1:vzlTzzi4tHLa/JQdIE5LeXw6SEX5EVVhq/VPqKHnKOk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0/go.mod h1:FHXQZnW5pA0txiMr3jApv9uNJzZ+7mYZd+u+PPenCFU=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=

View File

@@ -22,6 +22,18 @@ Feature: /forms/pdf/{flatten-form|set-form|form}
Then there should be 2 PDF(s) in the response
Then the response PDF(s) should be flatten
# Word documents exported through Acrobat PDFMaker give a check box an
# appearance for its checked state alone. Unchecked, it draws nothing and
# leaves with the form.
Scenario: POST /forms/pdf/flatten-form (Unchecked Box Without An Off Appearance)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdf/flatten-form" endpoint with the following form data and header(s):
| files | testdata/form_off_checkbox.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then the response PDF(s) should be flatten
# A value the form's own font cannot draw, outside Windows-1252, is drawn
# with a font installed in the image, and an empty field's border is drawn
# too, so nothing of the form outlives the flatten.

Binary file not shown.