Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
> 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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I didn't know that UXP could do that. That sounds really cool, @Rahul_Rastogi.
Copy link to clipboard
Copied
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.
By @Rahul_Rastogi
Will it be ONE WAY communication - UXP -> dll - or both ways - will there be a response - true / false - sent to UXP from the dll?
Or maybe something more than just true / false? Some kind of interaction - I know you've said that dll can't interact with InDesign - I'm talking about enhanced UI... if I should be worried about my ID-Tasker being obsolete...
Copy link to clipboard
Copied
@Rahul_Rastogi and @Peter Kahrel UXP Hybrid plugins are meant for JavaScript to exist alongside C++ and establish communication between the two worlds. It would require a separate UXP SDK.
Having said that, the UXP hybrid plugin support is not yet available in InDesign.
Could you point me to a doc that you are referring to for development? There is probably a miscommunication there and I would like to correc it.
Copy link to clipboard
Copied
@Padma Krishnamoorthy - yes, you are correct. I read the documenation of UXP for Photoshop -
https://developer.adobe.com/photoshop/uxp/2022/guides/hybrid-plugins/
I thought as UXP and UXP SDK is generic i.e independent of app, it might work for InDesign as well.
@m1b - I have never tried this, so I can't comment much on this as of now.
Copy link to clipboard
Copied
@Rahul_Rastogi The bindings for UXP SDK does not exist in InDesign as of today. Therefore, you won't be able to use it as a generic SDK for the time being.
Copy link to clipboard
Copied
Hi @Padma Krishnamoorthy -- It wasn't based on any particular document, it was my interp[retation of what I've read and heard in the forums. Sorry if I misrepresented it.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now