Saving/printing Form as PDF

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

11 Sep 2018

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

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

11 Sep 2018

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.
Cheers

User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

11 Sep 2018

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

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

12 Sep 2018

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.
Cheers

User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

12 Sep 2018

Hi,

Well received. Thanks for the prompt feedback!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests