The Situation:
My Script creates a weekplanner with the masterpage as template.
What's happening in the script is:
- Create Page
- Apply Masterpage
- Override each item
- Change content of each item
- do this for the whole dates-array length
The Problem:
The position of the masterPageItems after overriding gets messed up. I've made two screenshots as demonstration.
Now the real weirdness about this is, that it gets messed up on a "custom-size" document, but it doesn't get messed up on A4-Format...
I've already tried to restore the geometricBounds of each item after overriding it, but this doesnt seem to work either...
Do you have any idea what could be causing this behaviour?
The masterpage: https://i.stack.imgur.com/u0PAh.png
Messed up after overriding: https://i.stack.imgur.com/0AWvh.png
EDIT: As proof that restoring the geometricBounds doesn't work, I did the following:
function OverrideMasterItems(currPage) {
var allItems = currPage.masterPageItems;
var itemPos;
for(var i=0;i<allItems.length;i++){
try{
itemPos = allItems[i].geometricBounds;
allItems[i].override(currPage);
allItems[i].geometricBounds = itemPos;
$.writeln("Original itemPos: " + itemPos);
$.writeln("New itemPos: " + allItems[i].geometricBounds);
if(itemPos == allItems[i].geometricBounds) {
$.writeln("same position");
}
}
catch(e){}
}
}
As you see I assign the items original geometric bounds again and in the console it says that it's the same value - but it looks like in the screenshots. Also it doesn't write "same position" - which means the if-statement isn't true...