[javascript] find current active document  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Post Reply
Mathew
User
Posts: 564
Joined: Thu Jun 19, 2014 7:30 pm

[javascript] find current active document

Post by Mathew »

The app.activeDocs() method returns a list of active documents, but is there a way for a function to know which of them is currently in front? The only way I've found so far is to pass this to the function when calling it. Is there a property or flag somewhere that gives it?
User avatar
Roman - Tracker Supp
Site Admin
Posts: 331
Joined: Sun Nov 21, 2004 3:19 pm

Re: [javascript] find current active document  SOLVED

Post by Roman - Tracker Supp »

Hi Mathew,
To get the foreground document when it cannot be referenced as this, you can use the app.doc property.
Mathew
User
Posts: 564
Joined: Thu Jun 19, 2014 7:30 pm

Re: [javascript] find current active document

Post by Mathew »

Thank you, Roman! I did not know that property of app existed.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10935
Joined: Wed Jan 03, 2018 6:52 pm

[javascript] find current active document

Post by Daniel - PDF-XChange »

:)
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
Roman - Tracker Supp
Site Admin
Posts: 331
Joined: Sun Nov 21, 2004 3:19 pm

Re: [javascript] find current active document

Post by Roman - Tracker Supp »

app.doc is an undocumented property, however Adobe Acrobat implements it as well.
Post Reply