These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

combine pdf in website using client side javacript

usracro
Registered: Mar 11 2010
Posts: 2
Answered

Hello,

In the last 3 days I searched for a way to combine PDFs in html code but I couldn't find a solution.
I use client side javascript (jquery) to develop a website (No server side coding).

What I want to do is same as http://www.tescoplc.com/annualreport09/downloads/build_report (Create Your Report button)

My purpose is to create a new PDF document in my website, using "some" sections of an existing PDF document. Let's say that we have a PDF with sections 1, 2, 3, 4. You should be able to choose sections 1 and 3 and a new PDF should be created to include only sections 1 and 3.
When I google (PDF + Javascript) what I find is usually the javascript interface of Acrobat which is unrelated to html coding so, I am totally lost. I only found "jsPDF" javascript library to do similar to what I want but it didn't work even for the "Hello World!" examples (probably it only works for Safari, not in other browsers like Firefox, Chrome, etc.)

As a summary I need to include a .js file in my html (just like I do for jquery) and manupulate PDFs using this library. Is this possible? Any help will be very useful to me.
Thanks in advance.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can use Acrobat JavaScript to combine files in Acrobat Professional. You can look up the possibilities in the Acrobat SDK documentation.

http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp

But this will not work in Reader. Also this isn't an easy task for a PDF displayed in the browser because it requires a certain level of priviledge for the code, which means that the user will need some code installed on thier system. And there are other problems. I wouldn't bother even trying to do it this way.

The page you've listed in your post uses a server side tool to combine files. I strongly suspect it's APMerge from www.appligent.com. But there are serveral server side libraries for manipulating PDF files. Some are even free. Sever side is the way to go.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script