I have got an html form in SharePoint. I need to generate a pdf from it on a button click. Any suggestions which approach to follow here?
-
What do you mean with 'an HTML Form', a SharePoint List item? Is this SharePoint Online or on-premise? Do you have the ability to deploy your own custom code, or 3rd party solutions? There are loads of different options, but all include custom coding or off-the-shelf 3rd party products.– Jeroen RitmeijerCommented Dec 23, 2018 at 17:57
-
We could go with third party paid solution but client will only pay one time. Not recurrently.– mohd tahirCommented Dec 24, 2018 at 12:33
-
For low volume there is a free version (SP Online, Flow, API) at muhimbi-online.com/Pricing (Disclaimer, I work on that product)– Jeroen RitmeijerCommented Dec 26, 2018 at 0:53
4 Answers
The following JS plugins with source code for your reference.
We were having similar requirement in project and we used pdfmake plug-in which is very flexible and easy to use.
You can find it's documentation in below link:
Also you can play with this plug-in using below link:
Useful links:
Note: This is not a promotional answer. This is free and best plug-in to generate pdf files.
-
But I didn't see any option for using dynamic styling like bootstrap to generate the pdf. This is nice plugin but might not work for our scenario. Commented Dec 23, 2018 at 10:57
This is not be possible without using any third party service. I will suggest you find any third-party tools and this tools configured with SharePoint and then you can use it.
The client side libraries had page break issues with the SharePoint. I had to finally generate the pdf server side in an azure function and call this function from my content editor webpart.