• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

find if an opened InDesign document is for print or web

Explorer ,
Apr 13, 2020 Apr 13, 2020

Copy link to clipboard

Copied

I have the UIDRef of an opened InDesign document, I would like to know if the document is a print or web document. How can use the Getintent() to do that? or is there another way to get this information.

 

Thank you in advance,

Joe

TOPICS
SDK

Views

200

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2020 Apr 13, 2020

Copy link to clipboard

Copied

There is an intent property in document preferences, which returns a number.

1768846448=Print

1768846445=Mobile

1768846455=Web

 

var di = app.documents.item(0).documentPreferences.intent;

if (di == 1768846448) {
	$.writeln("Document intent is set to Print")
}else{
    $.writeln("Document intent is set to Mobile or Web")
}

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 20, 2020 Apr 20, 2020

Copy link to clipboard

Copied

LATEST

Thank you Rob for your suggestions. I wrote the code below, do you see any issues with it?

 
        InterfacePtr<IPageSetupPrefs> iPageSetupPrefs(static_cast<IPageSetupPrefs *>(::QueryPreferences(IID_              IPAGEPREFERENCES, documentRef)));
 
if (iPageSetupPrefs == nil) {
ASSERT(iPageSetupPrefs);
return false;
}
 
DocumentIntent docIntent = iPageSetupPrefs->GetIntent();

if (docIntent == kPrintIntent) 
     return true;
else
     return false;

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines