Skip to main content
Inspiring
September 6, 2023
Question

Adobe InDesign C++ Plugin or UXP ? Which is Faster ?

  • September 6, 2023
  • 4 replies
  • 2200 views

Hi,

 

I am a hard core Adobe InDesign SDK C++ Plugin Developer.

 

If we need to Automate Pagination i.e Place hundreds of images and text, creating cross references, TOC etc for document containing 500 pages, which is based on some complex business logic where the text frame or images should be placed then which is better way to go -

 

1. Automate using Adobe InDesign SDK C++ Plugin 

 

2. Or through UXP Scriping.

 

Which one will be faster ?

 

I suppose Adobe InDesign C++ Plugin should be much more faster as it is tightly integrated with Adobe InDesign.

All callbacks for observer etc should be faster with Adobe InDesign C++ Plugin.

I think for complex tasks InDesign C++ Plugin is the way to go.

 

UXP script is Interpreted and it might takes time to perform complex task for  generating document with lot of contents with more than 500 pages.

Till now, I have not found UXP doing a complex tasks. 

Mostly, it is simple workflow and DAM integration etc. 

 

Please share your thoughts.

 

- Rahul Rastogi

Adobe InDesign SDK C++ Plugin Developer

 

This topic has been closed for replies.

4 replies

Legend
September 9, 2023

The scenario desribed in your CEP Hybrid clarification is already supported by UXP. An InDesign C++ plug-in made scriptable following the SDK (e.g. add a method to the app object) is also scriptable by UXP (unless it explicitly limits itself to ExtendScript) - I tried using a "UXP Plugin".

 

For the speed question, you should further differentiate between UXP and UXP. UXP Script vs. UX Plugin, that is. According to a thread from past month https://community.adobe.com/t5/indesign-discussions/uxp-vs-cep/m-p/14050320 UXP Plugin (at that time) was significantly slower than UXP Scripts, and the suggestion by @Anoop Valomkot was to use UXP Scripts for business logic, similar to CEP calling ExtendScript.

 

That would give you the speed advantage of UXP Script over ExtendScript, plus similar advantages in the communication of UXP Plugin to UXP Script over CEP to ExtendScript.

 

If the alternative is InDesign C++, you'll still be in a different league, both of speed but also notifications - as you mention observers, extensibility - run your own link type, or user experience – create native UI, and plenty other topics. The tradeoff here is development time, including having to recompile for every other version on both platforms.

John D Herzog
Inspiring
September 20, 2023

FYI: I did not find any speed increase with UXP Plugin/UXP Script over CEP/Extendscript. The main difference I have seen as of yet is aesthetic since the dialogs and panels will look like the rest of the app instead of looking like scriptUI. That is to say this is the beginning of UXP for InDesign, and it might get better the more it is refined. Of course, it could also be that I do not know how to optimize the code to take advatnage of the UXP native enviroment.

Peter Kahrel
Community Expert
Community Expert
September 6, 2023

> Till now, I have not found UXP doing a complex tasks. 

> Mostly, it is simple workflow 

 

UXP is still very new and is still developing, so speed comparisons are still premature.

Another possibility is UXP Plug-ins, which appear to be a hybrid. They were introduced in 18.5. (If you're confused you're in good company.) This might be interesting, and speed-wise they may be somewhere between UXP scripts and C++ plug-ins. It's new, hence all these mays and mights.

 

 

Inspiring
September 6, 2023

@Peter Kahrel ,

 

I agree with you, till now, we have never seen CEP or UXP doing complex tasks.

 

Just for your info -

 

When you say Hybrid -

 

CEP Hybrid related -

If we have CEP extension and also require Adobe InDesign C++ Plugin - then we call it Hybrid.

For Eg - DAM Integration -

We create CEP extension for the UI where we show all the images from the DAM.

We also create C++ Plugin to support custom data links that directly connects to the DAM so that InDesign Links Panel can show out of date, missing icon etc. Custom data links cannot be done through CEP and it requires creation of C++ Plugin.

 

From our C++ Plugin, we can expose new scripting functions that can be called from CEP.

 

Such a combination is called Hybrid where we have both CEP extension and C++ Plugin working together. 

 

 

 

UXP Hybrid - 

For UXP, hybrid meaning is bit different.

 

It is possible here also that we can have UXP Addon and C++ Plugin working together in similar way described above for CEP. (this is also Hybrid).

 

But when Adobe says, UXP is hybrid then it means - from UXP, it is possible to execute C++ code.

This C++ Code is a library (dll on windows, on Mac .a file) and it is possible that UXP can load this library and we can call the library functions.

 

Here the C++ code written in library cannot call any InDesign API as it is not based on InDesign SDK. It is just a simple library. For Eg - We can create a library that can manipulate the image for eg - Remove red eye from photo or detect faces i.e anything that you want to do. But it will not call any InDesign API.

 

Such C++ Library is useful when we have complex task to perform. but it will not call any InDesign APIs.

 

 

Hope this makes it clear when Adobe says UXP is hybrid.

 

 

 

 

m1b
Community Expert
Community Expert
September 6, 2023

I didn't know that UXP could do that. That sounds really cool, @Rahul_Rastogi.

m1b
Community Expert
Community Expert
September 6, 2023

Hi @Rahul_Rastogi, the C++ plugin will be significantly faster, and probably more work to implement. If you are an experienced C++ Indesign SDK user, then you may not find the prospect as daunting as I would, being a complete novice.

 

But you should consider whether speed is of utmost importance in your use case, for example. does it matter that a script takes 20 minutes if only needed once a week? Script are easier to code, so the trade-offs may be worth it. On the other hand the SDK will provide access to things that aren't available via the scripting API.

 

Sorry it's a complex question.

- Mark

 

P.S. Robert's idea of building an IDML file is an interesting one, too. In that case you could use any tool you had on hand to build the IDML, but you'd need to have an excellent understanding of the IDML format to do it.

Robert at ID-Tasker
Legend
September 6, 2023

It rather depends on your algorithm / workflow and kind of data and initial contents of your INDD file.

 

In case of text - you can format / style it AFTER placing / importing - or BEFORE - create InDesign Tagged Text and then place / import it. 

 

Or you can go full hardcore - and create IDML file from scratch...