tif to PDF with designer

Hi all,

I am currently trying to convert a tif file to a PDF file with the designer. Within the designer I created a simple script:

// get data from workflow

var strResource = automation.jobInfos.JobInfo9;

//var strResource = “D:\patrick/test.tif”;

// Replace all backslashes with frontslashes

var Regex = new RegExp(‘//’, ‘g’);

strResource = strResource.replace(Regex,‘/’);

// load tiff file from file

var tifResource = ‘file:///’ + strResource;

var numPages = resource(tifResource).pages;

// reversed for loop so that the pages appear in the correct order

for (var i = numPages; i > 0; i–){

tifResourcePage = tifResource + ‘?page=’ + i;

results.after(‘<img src="’ + tifResourcePage + ‘" style=“width: 595.275591pt; height: 841.889764pt;”>’);

}

// hide our placeholder

results.hide();

however how do I get this to work within the workflow? I dont need a datamapper and I created a outputpreset with generic PDF so it creates a PDF, but the workflow keeps saying it needs a a meta file to let it work, as far as I know that needs a datamapper to do it but I dont need a datamapper to let the designer do its job.

Can anybody help me out here?

1 Like

Already got a working solution however maybe there is a smarter way,

The way I do it now, is create a new file in the workflow itself with an XML layout with a tag I let a simple datamapper generate a meta file with the 1 record inside of it, connected the design and load the image from the location provided by the record.

Anybody knows a better solution :-)?

Hi,

I’m just curious. Why are you wanting to convert a tiff like this? Why in the designer when you could use a plugin in Workflow to convert tiff files to PDF?

Regards,

S

Uhh because I dont know how to do that :-).

How can I do that?

Hi,

I have not used them but the other day I spotted some plugins that might help you out. They are in the OL resource downloads at the bottom of the page HERE. Under “Downloadable resources” select plugins. There is a plugin called TIFF Printer that can be used with say for example the Microsoft Print to PDF printer. There are other TIFF plugins there too to play with.

Again I have not used it and those plugins are not supported by OL. (even though OL hosts them.)

Another method that you could try is have a third party TIFF to PDF converter installed on the Workflow PC and use the External Program plugin to execute the converter. Should work but again I have never tried it.

Just some ideas, hope they help.

Regards,

S

Also, you can use the “Create Preview PDF” task in Workflow (found in the OL Connect category) to generate your PDF without any metadata. Select JSON string as the source of data and then specify an empty JSON object { }.