Skip to main content
doobeedoobee
Known Participant
April 14, 2017
Answered

How do I open another file and print it?

Hi. I've tried to work this out but I'm stuck

I have a menu.PDF that has several buttons on it. When you press on a button, it executes a javascript that opens a few PDFs and prints them.

    var otherDoc = app.openDoc("Form.pdf", this);

    var pp = this.getPrintParams();

     this.print(pp);

Issues :

1. On my mac I am only able to open the file if I use a relative path. Using /Users/xfolder/Desktop/OMR/Form.pdf doesn't work

2. It prints the menu.pdf, not the file that opens

Could you please tell me what I'm doing wrong? Thanks very much

This topic is closed to new replies. Start a new post to keep the conversation going.
Bernd Alheit
Bernd AlheitCorrect answer
Community Expert
April 14, 2017

2. use otherDoc not this

8 replies

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
April 14, 2017

2. use otherDoc not this

Translate
doobeedoobee
Known Participant
April 14, 2017

Thanks very much for your quick reply. I tried :

    var otherDoc = app.openDoc("Form2.pdf", this);

     var pp = otherDoc.getPrintParams();

       otherDoc.print(pp);

But it doesn't work. The PDF opens but it doesn't print

Translate
try67
Community Expert
Community Expert
April 14, 2017

Are both files located in the same folder?

Does the file open, but doesn't print? Or does it not open at all?

Is there an error message in the JS Console when you run this code?

On Fri, Apr 14, 2017 at 9:47 AM, doobeedoobee <forums_noreply@adobe.com>

Translate