You need to sign in to do that
Don't have an account?
Luke Osmundson 2
Fill out existing user-submitted PDF form programatically
I am looking for a way to fill out PDF forms programatically (and for free, so not Conga). We have a way to fill out DOCX forms, so either we need a way to convert DOCX to PDF client side, or a way to merge data into a PDF. This needs to be accomplished with a single click from the user, and uploaded directly to a file sharing site without any further user intervention. The program also needs to be Win10 compatible, so ActiveX is not a viable solution. It also should function without any preexisting custom code on the computer at hand, although it can be assumed that Adobe Acrobat and Microsoft Word will be available on the computer. I also need to be able to take in an arbitrary PDF document or Word document as the input, which prevents the use of the renderas feature as being a solution.
I am capable of writing custom code for this, however as far as I know, there is no PDF library for Javascript (excluding Node.IO) or Apex. I already have functioning code that edits the text in the DOCX, I would just need to convert it to PDF clientside somehow.
I am capable of writing custom code for this, however as far as I know, there is no PDF library for Javascript (excluding Node.IO) or Apex. I already have functioning code that edits the text in the DOCX, I would just need to convert it to PDF clientside somehow.
This can be done using Visualforce. You create a visualforce page which has the look and feel of the pdf you need. In your apex controller, you can set the field values from the user-submitted form (for example by the use of url parameters).
You can then in Apex retrieve the contents of that page as pdf and send it to any webservice you want (or save it as an attachment in SF).
The code to do so can look like this:
Hope this helps!
Best regards,
Martijn Schwärzer
Ps. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer