How to convert Word files to PDF?

  • 5 October 2015
  • 4 replies
  • 9 views

Badge +9

Hello,

Trying to create my first Nintex workflow. Can somebody explain to me or point me to some resources how to use the Convert document action to convert Word documents in one library to PDF files in another. I might be failing on the Output URL - how to create a correct Output URL in this case?

Thanks,


4 replies

Badge +9

this is working when you have permissions to both document libraries:

Badge +9

Thank you for your response. Will this work for multiple documents? How can I keep the original name of the Word file?

--------------------------------------------------------

Update:

The workflow generates an error but the file is successfully converted to PDF. Here are my settings:

convertPDF.png

The only problem I have now is to install missing fonts on the server as the converted file has some substituted fonts.

Badge +5

Igor,

When using the Convert Document Nintex action - which is based on Word Automation Services - you have to use encoded URLs and encoded Filenames. The Name field for items is not encoded - meaning it doesn't substitute spaces " " with "%20" - which you would see if you hovered over a documents link or icon in a list. Unless there is a hidden encoded name field I'm not aware of, you can use the Encoded Absolute URL for the item. It includes the full URL path, filename, and extension: http://my.domain.com/Shared%20Documents/my%20document.docx

You then use the Regular Expression action to Split the full URL at the forward slash "/" and save the results to a collection. The last item in the collection will be the encoded name.extension

If the domain/document portion of the URL doesn't change inside the workflow, you can also use the Regular Expression and the Replace Text method to replace the http://my.domain.com/Shared%20Documents/ with nothing (an empty Replacement text field), and get the same results.

One additional regular expression/split is needed to remove the file extension from the name, using the period "." as pattern. Be sure to enclose the period in brackets or it won't be recognized properly: [.] Again the results will go into a collection. The last item in the collection is the extension and the remaining item is the encoded name.

Hope this helps.

Gerard

Badge +5

Javier,

The action in Nintex supports the SharePoint Word Automation Services. This SharePoint service only support Word documents. See the following: Word Automation Services Overview

If you or someone you know can do a little development, there is a reasonable solution here: Converting Office Documents to PDF with the Office Interop Assemblies

As a final alternative, there are third-party tools that provide the conversion capability for all three.

Regards,

Gerard

Reply