JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hi,
since PDF-XChange Editor 9.0.353 my JavaScript buttons for printing all opened documents don't work anymore.
I had create two buttons - one for printing with dialog and one for printing without dialog.
How can I resolve these issues?
Many thanks
Andy
since PDF-XChange Editor 9.0.353 my JavaScript buttons for printing all opened documents don't work anymore.
I had create two buttons - one for printing with dialog and one for printing without dialog.
How can I resolve these issues?
Many thanks
Andy
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hello AndyK,
I can confirm that my similar script has also stopped working!
Checking with our devs now on what is causing this!
Kind regards,
Stefan
I can confirm that my similar script has also stopped working!
Checking with our devs now on what is causing this!
Kind regards,
Stefan
- Ivan - Tracker Software
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
In build 353 we implemented proper handling of doc.disclosed property, as a result, app.activeDocs property returns an empty array.
In build 355 we will release implementation of app.trustedFunction, app.beginPriv, and app.endPriv methods which will allow to make your code work after some modifications.
In build 355 we will release implementation of app.trustedFunction, app.beginPriv, and app.endPriv methods which will allow to make your code work after some modifications.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hi Ivan,
when did you plan to release build 535?
Thanks
Andy
when did you plan to release build 535?
Thanks
Andy
- TrackerSupp-Daniel
- Site Admin
- Posts: 8613
- Joined: Wed Jan 03, 2018 6:52 pm
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hi, AndyK
We do not yet have a timeline for when 355 will be released, but as we just released build 354 last week, it will not likely be in the next few weeks. You will be looking forward probably a month or more.
Kind regards,
We do not yet have a timeline for when 355 will be released, but as we just released build 354 last week, it will not likely be in the next few weeks. You will be looking forward probably a month or more.
Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hi,
is there a simple workaround to modify scripts like this...
is there a simple workaround to modify scripts like this...
Code: Select all
{
var ad = app.activeDocs;
if (ad.length)
{
for (var i = 0; i < ad.length; i++)
{
var pp = ad[i].info;
var file=ad[i].documentFileName;
// :
// :
// :
}
console.println("ok");
}
else
{
app.alert({
cMsg: "No pdf document has been loaded... @%$!",
cTitle: "Information Cleaner",
nIcon: 3, nType: 0
});
}
}
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hello Puffolino,
I am afraid that no - there's no solution in the current build, or we would have provided it already
Kind regards,
Stefan
I am afraid that no - there's no solution in the current build, or we would have provided it already
Kind regards,
Stefan
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
My workaround is to paste the script into the javascript console (CTRL+J) and run it from there. A bit of a pain, but the script can access the current documents.
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Working fine from console on all open documents: (at least for me)
Code: Select all
var ad = app.activeDocs;
var t = app.thermometer; // Acquire a thermometer object
t.duration = ad.length;
t.begin();
for (var i = 0; i < ad.length; i++)
{
t.text = "Print Document # " + (i+1);
t.value = i;
if (typeof ad[i].numPages != "undefined")
{
var pp = ad[i].getPrintParams();
// uncomment the next line to print without dialog for each document
// pp.interactive = pp.constants.interactionLevel.silent;
ad[i].print(pp);
}
}
t.end();
It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hello Ovg,
Yes - the console is with different permissions than when you add the script to a button!
As stated above - we are aware of this and with some modifications to the code from build 355 such JS code will be able to work correctly through a toolbar button once again.
Kind regards,
Stefan
Yes - the console is with different permissions than when you add the script to a button!
As stated above - we are aware of this and with some modifications to the code from build 355 such JS code will be able to work correctly through a toolbar button once again.
Kind regards,
Stefan
- Paul - Tracker Supp
- Site Admin
- Posts: 6901
- Joined: Wed Mar 25, 2009 10:37 pm
- Location: Chemainus, Canada
- Contact:
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Does 356 work for you guys?
Best regards
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Yes, with a new script from Stefan, but unfortunately without toolbar buttons.
➜ https://forum.pdf-xchange.com/viewtopic.php?p=152500#p152500
═══
I would be really happy if this feature would be integrated directly into PDF-XChange Editor. So such programming laymen like me would not have to deal with such code.
Last edited by AndyK on Fri Jul 23, 2021 4:54 pm, edited 5 times in total.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Hello AndyK,
As mentioned in the other topic - the "silent" printing can not be made to work through a button any more - as we are now following the specification more strictly, and it explicitly states that "intents" can not work for JS added buttons.
Kind regards,
Stefan
As mentioned in the other topic - the "silent" printing can not be made to work through a button any more - as we are now following the specification more strictly, and it explicitly states that "intents" can not work for JS added buttons.
Kind regards,
Stefan
Re: JavaScript - printAllOpenedDocs dont work anymore since v9.0.353
Thanks for fixing, working fine now!!!
It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
- Tracker Supp-Stefan
- Site Admin
- Posts: 17948
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact: