Mac OS X 10.9.5
FusionPro VDP Creator 9.3.6
Acrobat 11.0
I'm trying to get some graphics frames and text frame to reposition and suppress themselves based on data input.
For this basic example I've outlined three rows. Each row consists of a GraphicFrame and a TextFrame. First row is A, second is B, third is C.
If there is no content provided for row C I'm wanting to move the y position of the two frames from the rows above down one positions.
If there is no content provided for both row C and row B I'm wanting to move the y position of the frame from above down two positions.
Do I need to bind all these actions to some kind of event?
Things don't seem to be working as desired. I know I can achieve a similar layout using a bottom justified textFrame and suppressing lines as they aren't needed. But ultimately the goal of this is to get successful manipulation of the suppression and x,y position based on data input. Appreciate any input.
////////////////////////////////////////////////////////////////////////////////
//
// GraphicsFrame TextFrame DefaultPosition
// ROW A: [__ gf_A __] [__ tf_A __] x:1.24 y:0.514
// ROW B: [__ gf_B __] [__ tf_B __] x:1.24 y:0.833
// ROW C: [__ gf_C __] [__ tf_C __] x:1.24 y:1.15
//
// Simple test data:
//
// Record[0]: [A: "One", B: "Two", C: "Three"]
// Record[1]: [A: "One", B: "Two", C: ""]
// Record[2]: [A: "One", B: "", C: ""]
//
////////////////////////////////////////////////////////////////////////////////
// Locate all the frames needed for positioning
var sectionA = [];
var sectionB = [];
var sectionC = [];
sectionA.push(FindTextFrame("tf_A"));
sectionA.push(FindGraphicFrame("gf_A"));
sectionB.push(FindTextFrame("tf_B"));
sectionB.push(FindGraphicFrame("gf_B"));
sectionC.push(FindTextFrame("tf_C"));
sectionC.push(FindGraphicFrame("gf_C"));
// Determine the layout changes based on record content
if ( !Field("C") ) {
// Missing input data in Field C
if ( Field("B") ) {
// Containing input data in Field B
// Shift A & B one space down
sectionA[0].y = 0.833;
sectionA[1].y = 0.833;
sectionB[0].y = 1.15;
sectionB[1].y = 1.15;
sectionC[0].supress = true;
sectionC[1].supress = true;
// sectionA.map( function(frame) {
// frame.y = 0.833;
// });
// sectionB.map( function(frame) {
// frame.y = 0.115;
// });
// sectionC.map( function(frame) {
// frame.supress = true;
// });
return "One Shift";
} else if ( !Field("B") ) {
// Missing input data in Field B
// Shift A two spaces down
sectionA[0].y = 1.15;
sectionA[1].y = 1.15;
sectionB[0].supress = true;
sectionB[1].supress = true;
sectionC[0].supress = true;
sectionC[1].supress = true;
// sectionA.map( function(frame) {
// frame.y = 1.15;
// });
// sectionB.map( function(frame) {
// frame.supress = true;
// });
// sectionC.map( function(frame) {
// frame.supress = true;
// });
return "Two Shifts";
}
} else {
// Shift no spaces
return "No Shift";
} EvanF_SupPosTest.zip