GotenbergSharpApiClient icon indicating copy to clipboard operation
GotenbergSharpApiClient copied to clipboard

Convert single office file to pdf

Open reinisleitis opened this issue 3 years ago • 1 comments

As I understand you have to use GotenbergSharpClient.MergeOfficeDocsAsync for converting office files. But there is limitation that only allows 2 or more files to be converted. There is check for that: https://github.com/ChangemakerStudios/GotenbergSharpApiClient/blob/2464c8bcd0af9198c208b1e0fa1b1d0468b7dfa7/lib/Domain/Requests/MergeOfficeRequest.cs#L39-L40 Although Gotengberg docs shows that you could also use only one file. Is there a reason for this limitation or should I use some other method?

reinisleitis avatar Mar 08 '22 13:03 reinisleitis

I ran into this as well, can confirm that the gotenberg API allows to merge just one document and this is the only way to convert office docs, there is no other method in the client for doing a single document. Also it ends up sending a request with no form content if you try to do this leading to a very confusing error. Recommend allowing 1 valid merge item and throwing and exception if there are none. @Jaben @chrismo111, permission to open a pull request or something?

dualmindblade avatar Jun 20 '22 18:06 dualmindblade

A fix has been added for the v7 branch.

Jaben avatar Aug 28 '22 23:08 Jaben

Released in v2.0.1

Jaben avatar Aug 30 '22 04:08 Jaben