Skip to main content
November 14, 2016
Question

Using Javascript to insert pdfs

How do I insert 6 other pdf documents into a different open pdf file using javascript?  All the files are in the same directory/

This topic is closed to new replies. Start a new post to keep the conversation going.

10 replies

November 15, 2016

Nothing.  The file doesn't attach to the open document.

Translate
try67
Community Expert
Community Expert
November 15, 2016

What is the output in the console itself? Something must be written when you run the code...

Translate
November 15, 2016

I am running the code using the console window.

Translate
try67
Community Expert
Community Expert
November 15, 2016

OK, and what happens when you run it, exactly?

Translate
try67
Community Expert
Community Expert
November 14, 2016

Read the documentation of the insertPages method of the Document object.

Translate
November 14, 2016

I have tried using the following but I can't get it to work..

this.insertPages({nPage: -1, cPath: "Report1.pdf", nStart: 0});

Translate
try67
Community Expert
Community Expert
November 14, 2016

What does "can't get it to work" mean, exactly? Are you getting an error message? If so, what does it say?

Also, from where are you running this code?

Translate