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

fix: do not added inches unit for Gotenberg compatbility (<8.3) #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pierregaste
Copy link

No description provided.

@pierregaste
Copy link
Author

Gotenberg added the notion of unit for margins and page sizes starting with version 8.3 (https://github.com/gotenberg/gotenberg/releases/tag/v8.3.0).

On older versions, if you specify margins and/or a page size, you get an error from Gotenberg:

Invalid form data: form field 'marginTop' is invalid (got '0mm', resulting to strconv.ParseFloat: parsing "0mm": invalid syntax)

For these older versions, you can only work with inches. I therefore suggest not sending the "inch" unit in order to maintain backward compatibility on these versions.

In my case, it is Platform.sh that is still stuck in version 8.2.

@Neirda24
Copy link
Contributor

Hi @pierregaste . Thank you for your contribution.

we discussed this internally. Supporting previous version is not only about sending units or not. Some methods would have to not be usable or with a warning. this is too much complexity to handle right now.

regarding the few lines that were modified. we could indeed make it optional to not send something that will default natively on gotenberg side. then this would have to be applied to other methods as well. could you investigate a bit which should be changed ? I'll try to find some time late next week to investigate myself.

@pierregaste
Copy link
Author

Hi @pierregaste . Thank you for your contribution.

we discussed this internally. Supporting previous version is not only about sending units or not. Some methods would have to not be usable or with a warning. this is too much complexity to handle right now.

regarding the few lines that were modified. we could indeed make it optional to not send something that will default natively on gotenberg side. then this would have to be applied to other methods as well. could you investigate a bit which should be changed ? I'll try to find some time late next week to investigate myself.

Yes, I agree! Make most sense in this way. I'll try to add this option in this PR instead of this previous modifications.

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.

2 participants