How to determine if PDF-XChange is what the PDF is open in  SOLVED

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

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
Paxtell
User
Posts: 13
Joined: Fri May 19, 2023 4:32 pm

How to determine if PDF-XChange is what the PDF is open in

Post by Paxtell »

Good Day,

We are currently in the process of updating a complex XFA form to work with PDF-XChange. We previously were able to make it function consistently between Adobe Acrobat Pro and FoxIt PDF Reader, but are seeing issues unique to PDF-XChange we would like to code around. To do this, we need a method to run code only when PDF-XChange is the viewer being used. FoxIt has their own method, app.isFoxit, which includes "FoxIt" in the value when the PDF is opened in FoxIt. Adobe Acrobat uses app.viewerType, which returns "Exchange-Pro." Unfortunately, PDF-XChange doesn't use the FoxIt method, and app.viewerType returns the same value as Adobe Acrobat. The code for FoxIt we use is below. Is there a similar method that can be used to uniquely identify when PDF-XChange is used? Issues seen include some we saw in FoxIt that we have solutions for, but others are unique (e.g. hyperlinks placed within a Cluster of a Dialog window don't display, method getfocus() doesn't return null within an Exit routine when no object is focused).

//Determine if FoxIt is being used
var FoxIt = false;
if (typeof app.isFoxit !== 'undefined') {
if (app.isFoxit.indexOf("Foxit") >= 0) {
var FoxIt = true;
}//if
}//if
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6829
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: How to determine if PDF-XChange is what the PDF is open in

Post by Paul - Tracker Supp »

Hi, Paxtell

thanks for the post. I have reached out to the dev team for this.
To do this, we need a method to run code only when PDF-XChange is the viewer being used.
Can I get confirmation that it is the PDF-XChange Editor you are referring to not the old and discontinued PDF-XChange Viewer?

Kind regards,
Paul - Tracker Supp
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Paxtell
User
Posts: 13
Joined: Fri May 19, 2023 4:32 pm

Re: How to determine if PDF-XChange is what the PDF is open in

Post by Paxtell »

Thank you Paul!

We are testing with PDF-XChange Editor Version: 9.5, build 368.0 (Apr 6, 2023).

Patrick
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: How to determine if PDF-XChange is what the PDF is open in  SOLVED

Post by Ivan - Tracker Software »

We must return the same value from the app.viewerType as Acrobat does to avoid issues with many PDFs that check that value. The same is true about the app.viewerVersion.

By the way, PDF-XChange Editor provides two unique properties which can be used to determine if the file is opened in the Editor.
The first one is app.pxceVersion - it is an array of four numbers that represent the Editor version.
The second one is app.pxceInfo. It is an object with properties version, variation, name, and platform.

HTH
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.
Paxtell
User
Posts: 13
Joined: Fri May 19, 2023 4:32 pm

Re: How to determine if PDF-XChange is what the PDF is open in

Post by Paxtell »

Excellent Ivan, works exactly as expected. Thank you!
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6829
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

How to determine if PDF-XChange is what the PDF is open in

Post by Paul - Tracker Supp »

:)
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Post Reply