Copy link to clipboard
Copied
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
2. use otherDoc not this
Copy link to clipboard
Copied
2. use otherDoc not this
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
Hi try67.
Both files are in the same folder. The file opens but doesn't print.
There is an error message that says otherDoc is not defined.
Thanks for your help
Copy link to clipboard
Copied
I've just found out about needing to set disclosure to true. I'm trying to do this but am finding that I can't get document level scripts to run. I'm using a test script with an alert but the alert isn't happening...
Copy link to clipboard
Copied
Have you set the disclosed property?
Copy link to clipboard
Copied
Hi Bernd.
I just found out about that. I went to Tools>Document JavaScripts and added a test script :
function test()
{
this.disclosed= true;
app.alert("test");
}
The alert is not happening and the otherDoc variable is still not defined. Am I missing something obvious? Thanks
Copy link to clipboard
Copied
Fixed it. Changed it to just
this.disclosed= true;
app.alert("test");
It all seems to be working now. It's now printing from the other PDF.
Thanks very much for your help
Find more inspiration, events, and resources on the new Adobe Community
Explore Now