Page 1 of 1

Saving/printing Form as PDF

Posted: 11 Sep 2018
by vegard.grutle
Hi!

Is there a way to use one of these functions

Code: Select all

fd.saveAsPDF()

Code: Select all

fd.printForm()
to save/print PDF with a dynamic name.

I have a SLT field called "Transmittal ID" (TransmittalID) wich holds the name of the PDF i would like save/print.

Thanks in advance!

Vegard

Re: Saving/printing Form as PDF

Posted: 11 Sep 2018
by Nikita Kurguzov
Dear Vegard,
If you want to save PDF file with a specific name, please, put the name inside like this:

Code: Select all

fd.saveAsPDF("invoice.pdf") 
In your case, it would be something like this:

Code: Select all

fd.saveAsPDF(fd.field("TransmittalID").value() + ".pdf") 
Print code only prints the form in the browser, it has nothing to do with saving as PDF.

Re: Saving/printing Form as PDF

Posted: 11 Sep 2018
by vegard.grutle
Thanks Nikita!

It work beautifull when slightly modifying it

Code: Select all

fd.saveAsPDF(fd.field("TransmittalID").value())
Is it possible to programmatically save this PDF in a nominated library with a on click function on a button? I have a library called "TransmittalCoverSheetLibrary" where i keep my PDFs.

Thanks!

V

Re: Saving/printing Form as PDF

Posted: 12 Sep 2018
by Nikita Kurguzov
Dear Vegard,
Unfortunately, that's not possible with JS. You might be able to achieve similar result with our different products Workflow Action Pack or with Actions, using either Workflow or Flow. These products allow you to generate PDF file from template, using item's fields as data fill in the template.

Here's an example for Workflow Action Pack - https://plumsail.com/docs/workflow-acti ... plate.html
And here's an example for Actions - https://plumsail.com/docs/actions/v1.x/ ... plate.html

It might be easier to manually upload PDF files, though.

Re: Saving/printing Form as PDF

Posted: 12 Sep 2018
by vegard.grutle
Hi,

Well received. Thanks for the prompt feedback!