So my question is "Exists a way to hold the rendering only of the progress bar and not of the rest?"
I thank in advance whoever will answer the question.
Copy link to clipboard
If you are using the C++ SDK for doing the heavy lifting then why use JS just for the progessbar or other trivial things. I would suggest moving all in to the C++. Talking sepcifically about progress bars, they are provided natively by the C++ SDK as well, see TaskProgressBar and RangeProgressBar in the SDK.
I would love to recreate it in C++, but i don't know how to make panel with text, checkbox, checklist, buttons and images.
I am not suggesting recreating your whole panel using C++. What I suggest is that if progress bar is the issue here and without it your JS and C++ combination is working fine then you could consider replacing the JS progress bar with a C++ progress bar. It's quite easy and needs no more than creating an object of the class with required params, updating the params to move the progess bar. Also, did you find merit in opening the document without a window, try it that might help.
Oh sorry Manan, I aswered about this before but the answer has not been loaded, sorry for making you repeat the same thing 2 times, anyway I also tried to implement a progress bar also in C++, but the execution times don't change.
The problem is that I'm obliged to show the status of the impagination, so I'm searching a way to block the mechanism of InDesign that show me the page, I want to keep the graphical at minimum (to be as fast as possible) during the impagination and see only the status of that through a progress bar.
I've attached 2 image the first rappresent the paging when i don't use a progress bar, the second rapresent the paging using a progress bar in js or C++, but what I would like is the mix of both, because i want a progress bar, but i don't want to see the render of page.
Copy link to clipboard
Regarding stopping the rendering of the page. Try opening the document without a visible window, that way since the document is not shown at all, so InDesign would not have to do any tasks related to the rendering.
If you opened the document like that, the progress bar would also disappear, or not?
No it should not. We are just instructing that we don't want a UI window to display the document. Regarding the progress bar it's just an object on stack that displays the progress based on the value you set for the progress. So this should work in my opinion, you should give it a shot and see the results.
Look in the method you use to open the document it will have an argument that specifies whether to open a window for the document or not. Alternatively you could open the document without window using JS and then tweak your code to work on the frontmost document, that way you will be able to test the workflow quickly and if it does work then you can search for API in the C++ sdk.
In JS the details of the method for opening the document can be seen at the following link.
Copy link to clipboard
Some thoughts. I work in Acrobat plugins and have found progress bars cause a slow down. Acrobat does not render the page but it takes time to render a progress bar. These may not apply to InDesign.
1. if you tell InDesign to update the progress bar yourself, do this less often. Check the clock and only do it after a time has passed for the last update.
2. If InDesign supports a custom progress bar callback, use this instead. Two possibilites
(a) call an InDesign progress bar, but less often
(b) implement your own progress bar in platform UI (Mac or Windows directly) without updating InDesign at all.
3. Use a platform UI progress bar and hide the InDesign window. Be sure to set an exception trap so it is always shown again, even on failure.
first of all, thank you and for the excellent ideas anyway, regards proposal 1 and 2.a, they are interesting but I had already implemented and in fact I have reduced the execution time but I have not solved the problem anyway, while as regards proposal 2.b and 3 are very very interesting but I have no idea of how to implement it(if you know how to do it you could direct me to the material to study, I would be grateful).
If I understand correctly you intend to use a progress bar of the Mac and not an internal one of InDesign, and I think it can absolutely work, but first i want to search a method internally of InDesign (like blocking the rendering of pages) then if I can't find it or if it not possible, I will surely do as you said.
Thank you very much for the proposals made.
hm… I think you could increase execution time by NOT SHOWING the Pages panel.
Instead, before running your main code, zoom to a spread and perhaps to a blank area on the pasteboard where nothing happens.
( ACP )