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

C++ PlugIn for InDesign Server with Page Loading Event Handling

Community Beginner ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

I wanted to register eventhandlers for all the page loading events whenever an IDML document is opened in the InDesign Server application.

 

I tried registering event handlers using ExtendScript but it didnt worked out. I got only document specific events e.g. beforeNew, beforeOpen, afterNew, afterOpen etc.

 

So, I want to achieve this using C++ PlugIns functionality in the InDesign Server application. Please let me know of any pointers which I can refer to create the plugIn for InDesign Server and register eventhandlers for page loading events. I could not find any specific sample code in the PlugIns SDK Kit relative to event handlers.

 

 

TOPICS
How to , SDK

Views

109

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
Participant ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

Hm, not sure about how you'd specifically detect opening an IDML doc. But to see how to respond to document events, there are a few ways but the easiest is a document responder. See the `DocWatch` sample plug-in, specifically the `kDocWchResponderServiceBoss` boss and the `kDocWchResponderImpl` on that boss, which is implemented in `DocWchResponder.cpp`.  You could try looking at the before open doc signal and querying the document name to see if the extension is .idml. That's not a foolproof way (there can easily be IDML files without the ".idml" file extension, especially on Mac) but better than nothing. On Mac, you could also look at the file type to try to catch that case.

 

If you're interested in firing events back to scripting, see the `SnpHelloCSXS.cpp` snippet. That shows how to send a message from C++ that can be caught in the scripting interface.

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
Contributor ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

LATEST

As mentioned by @Lawrence Horwitz , refer DocWatch Sample i.e implement Document Responder.

Capture "kAfterNewDocSignalResponderService".

 

You will be able to access UIDRef of document.

 

On kDocBoss, refer interface IDocFileType from there you should be able to infer whether it is idml or not.

 

- Rahul Rastogi

 Adobe InDesign C++ Custom Plugin Architect

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