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

preserve_formatting missing in translate_document() function #107

Open
manic-dimitrije opened this issue May 23, 2024 · 5 comments
Open

Comments

@manic-dimitrije
Copy link

manic-dimitrije commented May 23, 2024

Is there a way to turn on preserve_formatting of our pdf-document, because we have a problem when we translate it: We get back translated pdf with unwanted page breaks. When we try to add property preserve_formatting set on true to DeepL API call, we are getting back error: "unknown property preserve_formatting does not exist". On your Postman collection we can see dat property actually exists, and there when we translate same pdf we are getting it back with good form without unwanted page brakes.

@manic-dimitrije
Copy link
Author

@seratch @mRs- We actually saw that in node implementation there is extraRequestParameters: same as in Text translation options.
While that is missing in python implementation.

@JanEbbing
Copy link
Member

Hi, can you show me where you find this preserve_formatting option in our OpenAPI spec? I can find it for text translation, e.g. here or here/here, but not for document translation.

The extraRequestParameters from the node library is something we want to bring to every library and just haven't gotten to yet, but it is more for our internal use, not for actual users of each library.

If you have an issue with unwanted page breaks in document translations, if you can share the document with me, I can share it with the relevant team and they will work on fixing it.

@daniel-jones-dev
Copy link
Member

Small addition to @JanEbbing's comment:
I noticed that the DeepL Postman collection was mentioned, but the preserve_formatting option is not there either.

@manic-dimitrije
Copy link
Author

manic-dimitrije commented May 23, 2024

@JanEbbing @daniel-jones-dev We forked collection for Postman from your docs https://developers.deepl.com/docs/getting-started/test-your-api-requests-with-postman
And there is preserve_formatting option, when i leave it on true i get response 200.
After that, using Download Translated Document download PDF and that PDF looks so much better when i translate it in Postman then one i get back in app where we use DeepL API.
Screenshot 2024-05-23 at 15 24 10

@daniel-jones-dev
Copy link
Member

@manic-dimitrije I just tried forking our official Postman collection again; I do not get a preserve_formatting parameter on the upload document endpoint. I don't know exactly why you see it there, maybe you have an earlier version where it was incorrectly added. The document upload endpoint does not support that parameter, so if you see it in Postman it is a mistake.

Additionally, the error "unknown property preserve_formatting does not exist" doesn't come from our API; our endpoints generally ignore unrecognized parameters. Did you get that error while using Postman?

I think your best option, as @JanEbbing said, is to share the document with us or our support team so we can share it with the relevant team and they will work on fixing it.

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

No branches or pull requests

3 participants