Can you please let me know what is wrong with below code?
This code is working fine in indesign desktop version but indesign server cc 2017 queue getting quit. Your help would be much appreciated. Thanks in Advance.
textFrame = element.placeIntoFrame(page, [0,0, pageHeight, pageWidth]);
Hard to tell by just looking at this line of code. Did you debug the code, what error do you get? Did you check if all the objects used are valid, it's possible that some objects might be invalid on IDS due to API differences so the issue could be somewhere else as well and it's just that the crash happens at this point when you try to use the object.
Thank you @Manan Joshi for your response.
These page, typeAreaHeight typeAreaWidth variables are constant for all the image placement.
page = document.pages.item(0); marginPreferences = page.marginPreferences; top = marginPreferences.top; bottom = marginPreferences.bottom; left = marginPreferences.left; right = marginPreferences.right; typeAreaHeight = document.documentPreferences.pageHeight - top - bottom; typeAreaWidth = document.documentPreferences.pageWidth - left - right;
The next thing that I would suggest in addition to what has been already said is to isolate the problematic code. Try to create a small snippet of code with values that you capture via the debugger and use those hardcoded values to identify what operation, API is specifically failing. Try the same operation/code snippet on some other document/another IDS machine etc and see if it causes crashes. So basically it's about identifying what piece of code under which circumstances crashes and then trying to find the solution. Speculating remotely we can only provide generic pointers about where to look and how to look for potential issues.
Thank you Manan.
Don't just watch the code, also have a look at the XML - both elements and attributes. Are namespaces correctly declared? Are the namespaces using the exact URL that they are supposed to use? And so forth. Eventually start from a clean XML structure, add elements and attributes by script until it breaks.
Place that line in a try/catch construct and log the error message.
This is already in side try block and do not go to catch block, if I press F11 on that line queue gets quit while debugging on indesign server cc 17 but on local machine it is running well.
You mean that InDesign crashes?
Thank you so much for your quick response.
Yes, I mean indesign server queue quit.
That's two different things. Does the queue quit? Or does InDesign Server crash? If it crashes please share the crash reports.
Queue quit only. I have 6 queues and one bye one quit all if I run 6 times.