PDF To Docx

srujancherr
Tera Contributor

Hi,

We are currently working on a proof of concept (POC) in our Personal Developer Instance (PDI) within ServiceNow. As part of this POC, we are generating a PDF file from an HTML Template and attaching it to the Risk Response Task table.

However, instead of a PDF, our requirement is to generate and attach a Word (DOCX) document. We would like to know if there is a native or recommended way in ServiceNow to convert a PDF file to a Word (DOCX) file.

To explore alternatives, we attempted two different approaches:

  1. Custom Azure-hosted Solution: We developed our own solution to convert PDFs to DOCX, hosted on Azure. While the integration with ServiceNow was successful, the resulting file was corrupted. Upon checking Azure logs, it appears that the file being received is already corrupted at the time of transmission.

  2. Open Source API (ConvertAPI): We also integrated ConvertAPI to achieve the conversion. Unfortunately, the result was the same — a corrupted Word document was returned.

Given these challenges, we are seeking guidance or a working solution to successfully convert and attach a Word (DOCX) file in the Risk Response Task record in ServiceNow.

We would greatly appreciate any support or recommendations you could provide.


4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @srujancherr 

unfortunately, ServiceNow has no OOTB solution for converting file formats and your approach to leverage external services is the most promising one.

However, I would create the DOCX file directly from the HTML and CSS code and not request a conversion. Maybe this would return a correct DOCX file.

Maik

srujancherr
Tera Contributor

HI @Maik Skoddow ,

Thankyou for your reply,

Can you elaborate more or detailed steps to return a correct docx file directly from html and css code

Sorry, I cannot because you have not provided any implementation details and the solution depends on the API of the chosen provider.

Maik

srujancherr
Tera Contributor

Hi @Maik Skoddow ,

 

My solutions were not working, can you help me with any working solution to implement,

here is my requirement, I will get a generated pdf file in risk response table, i want that pdf file to get converted to docx
or

 

I have a HTML Template table, from that table when i click on a UI Action, automatically I need a word document from content in HTML Template record