Skip to main content
January 23, 2017
Question

Creating PDFs via Javascript

  • January 23, 2017
  • 2 replies
  • 528 views

I have a Lotus Notes Application which I use LotusScript (Similar to VB) to take a PDF template and fill it with data and save. Our company is moving away from Lotus Notes and I am moving the application into Oracle APEX. I have been trying to find coding examples to do what I have done in Notes in either Javascript or ActiveX. I currently have Acrobat Pro and will be getting DC sometime soon. Can anyone provide any information where to find some examples?

I have searched Google and Adobe but everything I am finding deals with C#, Java, or other software. I am limited to PL/SQL, javascript, or using ActiveX.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
January 25, 2017

Using JS you can open a file using openDoc method of the app object, and then (under some circumstances) you can access the fields in it using the getField method of the Doc object, and read/write their values using the value property. This is all documented in the JavaScript for Acrobat API Reference, which is a part of the Acrobat SDK.

Karl Heinz  Kremer
Community Expert
Community Expert
January 24, 2017

Chances are you can automate Adobe Acrobat using the IAC API (that's the "Interapplication Communication" interface), which uses ActiveX. Take a look here for some information about how you would interact with forms (which I assume you mean when you use the term "template"): Reading PDF Form Fields with VBA - KHKonsulting LLC

The link is about both reading and writing from and to form fields.

January 24, 2017

Thanks Karl but I looked through the IAC and I cannot find any examples of using ActiveX or Javascript. I have used VBA code successfully in Lotus Notes but we have moved to an Oracle platform and I have to use either javascript or activeX. I can create the documents in Word using ActiveX but the users were wanting PDFs. Also in the IAC is looks like you can only read the PDF and not set the fields like I can in the VBA script.