We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Convert document to PDF using endpoint?

Hi, tried to search the documentation, but couldn't find what I want.

Is there an endpoint in the any of the webservices that can be used to generate a PDF based on a Word document in CRM?

RE: Convert document to PDF using endpoint?

No, SuperOffice does not have an API to convert a stored word document into a PDF. I believe some partners built application to do that in onsite installations. There is at least one in the online appstore.

Best regards.

Von: Tony Yates 23. Jun 2020

RE: Convert document to PDF using endpoint?

Ok, it would be nice if the built in NetServer functionality that uses Aspose for converting was exposed in the API as well. In customizations we often need to create a PDF of something. Typically for sending a contract or agreement of sorts to a customer. The approach we've used for years is to install wkhtmltopdf on the same server, and calling it via crmscripts runProgram method. Obviously this doesn't work in Online.

Also, for our apps in the appstore we also need to do some automatic PDF generating, and it would have been nice to be able to use the PDF generating mechanism that SuperOffice allready has.

The approach we're going to use is to call out to a API we're hosting somewhere to do the PDF generation there instead. If CRMScript/RestAPI had a way for us to create the PDF, we wouldn't need to send data anywhere else.

Von: Frode Lillerud 25. Jun 2020

RE: Convert document to PDF using endpoint?

GET /api/v1/document/123/content

vs

GET /api/v1/document/123/pdf

 

Would that work for you?

i.e. Existing documents as PDFs on demand?

This would error on things like XLS and PPT documents, anything not supported by the PDF generator we use, obviously.

Von: Christian Mogensen 25. Jun 2020

RE: Convert document to PDF using endpoint?

Christian, that would be a great addition! We normally use the same approach that Frode mentioned but a build-in way would be great.

Would it be possible to also make this work with input on demand? For example when you want to convert HTML to PDF in CS.

Von: David Hollegien 25. Jun 2020

RE: Convert document to PDF using endpoint?

I think SuperOffice should stick to converting things it controls, not provide a general PDF conversion service.

Von: Christian Mogensen 25. Jun 2020

RE: Convert document to PDF using endpoint?

Yes, /api/v1/document/123/pdf would be highly welcomed!

And to do that I assume you'd need to tack on a new method on the DocumentAgent? Somewhere along the lines of DocumentAgent.GetDocumentPDFStream? If so then that would also be available in CRMScript over time I hope.

Von: Frode Lillerud 26. Jun 2020