How to mark overflow
Hey,
I'd like to have a script that goes through the document and places a string in each paragraph or table that has overflow. Any ideas how I can achieve this?
Thanks.
Hey,
I'd like to have a script that goes through the document and places a string in each paragraph or table that has overflow. Any ideas how I can achieve this?
Thanks.
Here is a general-purpose function for getting parent Page for an object. Once you get the Page object, you can test its Page.PageNum property.
function getPage (obj,doc) {
var frame = 0, cell = 0;
var objType = "", prop = 0;
while (obj) {
frame = obj;
objType = obj.constructor.name;
switch (objType) {
case "SubCol" :
obj = obj.ParentTextFrame;
break;
case "Tbl" :
obj = obj.FirstRowInTbl.FirstCellInRow;
break;
case "Row" :
obj = obj.FirstCellInRow;
break;
case "Cell" :
case "Pgf" :
case "AFrame" :
obj = obj.InTextFrame;
break;
case "TextLine" :
case "TextFrame" :
case "UnanchoredFrame" :
case "Arc" :
case "Ellipse" :
case "Group" :
case "Inset" :
case "Line" :
case "Math" :
case "Polygon" :
case "Polyline" :
case "Rectangle" :
case "RoundRect" :
if (obj.FrameParent.ObjectValid()) {
obj = obj.FrameParent;
} else {
obj = 0;
}
break;
case "XRef" :
prop = doc.GetTextPropVal (obj.TextRange.beg, Constants.FP_InTextObj);
var obj = prop.propVal.obj;
break;
default:
// Prevent endless loop if unknown object type is found.
obj = 0;
break;
}
}
if (frame) {
return frame.PageFramePage;
} else {
return 0;
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.