Convert HTML file into PDF using Connect template

Hello

I am facing some problem, not sure how to solve that, what I am doing wrong.

I have random HTLM file which I want to convert into PDF format using Connect designer template.

What I already have:

  1. Passing path to HTML file from workflow to %2 automation variable

  2. I create some Data Mapper which has “PathToFile” filed which is java script field and handle following code:

var path = ‘’;

path = automation.jobInfo.JobInfo2;

path;

  1. After that inside my template I have following script:

var pathToHtmlFile = record.fields.PathToFile;

var mysnippet = loadhtml(‘file:///’ + pathToHtmlFile);

results.replaceWith(mysnippet);

  1. Later inside workflow I am trying to use Data Mapper and Template to produce some PDF output.
    a) Already reciving error like:

W3001 : Error while executing plugin: HTTP/1.1 500 Internal Server Error LoggedApplicationException: There was an error running the content creation process caused by null

test

What I am doing wrong?

  • Can I directly pass automation.jobinfo2 into template script?
  • Do I have to use all in one?

Please advise.

What you are doing seems legit but in cases like this, it is better to open a technical support ticket so one of our technician can remote in and look at the overall environment.

BTW, when you set the content of automation.jobInfo.jobInfo2 to your Datamapping field, you only need to write a single line of code like this in your script:
automation.jobInfo.jobInfo2;

I already make it work without any technical support tickets (have no time for this)

Inside data mapper i have following Path variable which takes the path from automation,jobinfo2

Later the template will use following data mapper and will load the html file and convert this to PDF

Glad you have a solution then…keep us posted.:grinning: