Jump to content

EvanF

Registered Users - Approved
  • Posts

    7
  • Joined

Posts posted by EvanF

  1. What would be the best way to vertically space 3 elements where element 1 needs to touch the top of the text area, element 3 needs to touch the bottom of the area, and the element in the middle is spaced evenly between the baseline of the first and begenning of the last. Ideally the TOP will expand once the size gets too tight to space the middle element, but not shrink beyond a "minimum" height.

     

    ______________________________ TOP
    [Element 1]
     >Variable Line 1
     >Variable Line 2
                        ....> Even Spacing n
    
    [Element 2]
     >Variable Line 3
     >Variable Line 4
     >Variable Line 5
     >Variable Line 6
                        ....> Even Spacing n
    
    [Element 3]
     >Variable Line 7
     >Variable Line 8
     >Variable Line 9
    ______________________________ BOTTOM

     

    Is this something a table might be suited for?

     

    Do I maybe do a textMeasure and programatically apply spacing after or before; or line-height for those gaps for even spacing?

     

    Thanks!

  2. Before you get too far into this, you need to make sure you are composing the output on Producer or Producer API for x and y movement.

     

    Thanks for the direction!

     

    I talked with my BRM, I see that the Creator doesn't have the ability to preview the x and y properly. It was explained to me that the FusionPro Creator/Expression were to allow MarcomCentral customers to preview their work before uploading to the site, but this certainly doesn't seem to be the case. Pretty disappointed I'll have to upload these before I can truly preview them. (Cumbersome workflow...)

     

    Yes, this should be done in the OnRecordStart callback rule.

     

    Also, as Thomas notes, you need to compose with FP Direct/Producer or FP Server/Producer API.

     

    Please be more specific about exactly what the expected results are, and how they're different from the actual results.

     

    You could also do this with a table, or with repeatable components, or by simply modifying leading.

     

    I don't have time to debug the rule for you. I suggest adding some calls to the Print function, so that you can debug the rule by examining the log file to see what's really happening.

     

    Also, be mindful of your units. According to both the FusionPro Rules Guide and the Building Blocks dialog, the x and y properties specify the position in hundredths of points, of which there are 7200 per inch (72 points per inch times 100). So if you want to position a frame, say, two inches from the top of the page, you would set the y property to 14400. You might consider placing some "dummy" frames, with no content, on the page to act as markers, so that you can align the target frame with the dummy frame, so that you don't need to do math in the rule.

     

    Thanks Dan for the input, I'll try to be a bit more explicit with explaining the issues. Main issue was the units, I now remember this from the FusionProTextMeasure.

     

    Your code looks like it should theoretically work assuming you're composing this on a server like has been previously mentioned. You did, however, misspell "suppress" so that's probably why your frames aren't suppressing.

     

    Good catch, that fixed that part of the issue.

     

     

    Fixing the spelling, point values, and uploading the template to MarcomCentral I've got it working. Just a little disappointed I'll be forced to upload before I can preview the layout using this format.

     

    It was suggested I build the card in "layers" and just hide things, but depending on how many groups of items I need to suppress or "move" this sounds like it'll be even more work to edit/maintain.

  3. 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

  4. You can do this without writing a rule at all. One way is to just type whatever you need into the Text Editor, and put a tab in between the two parts. Then click the Tabs button, and in the Edit Tab Stops dialog, add a right-aligned tab stop, with the position just a bit less than the width of the frame.

     

    Can you provide a sample of this as it doesn't seem to work as you describe. As the solution Step provided isn't quite working as intended.

  5. I have a right justified Email, and I need to align the Cellphone line to the left most extents of the Email line.

     

    I have a formatting issue I've been trying to tackle, however the FusionProTextMeasure seems to be limited by a defined point size, so when copyfit takes over the measurement is no longer accurate. I'm not sure if this is even the best way to approach this as I'm quite new to FusionPro.

     

    This approach calculates the size of both lines, subtracts them to get the difference and tosses that into a rindent tag format for the cellphone line.

     

    var rightIndentSize = function () {
       // Default Pt Size
       var ptSize = "6 pt";
    
       // Email Size
       var emailString = "email: " + Rule("Email_Format");
       var emailTM = new FusionProTextMeasure;
       emailTM.pointSize = ptSize;
       emailTM.font = "Helvetica";
       emailTM.useTags = false;
       emailTM.CalculateTextExtent(emailString);
    
       // Cellphone Size
       var cellString = "cell: " + Rule("Cellphone_Format");
       var cellTM = new FusionProTextMeasure;
       cellTM.pointSize = ptSize;
       cellTM.font = "Helvetica";
       cellTM.useTags = false;
       cellTM.CalculateTextExtent(cellString);
    
       // Calculate difference in size
       var tmWidth = (emailTM.textWidth - cellTM.textWidth);
       return tmWidth;
    }
    
    return "<p rindent=" + rightIndentSize() + ">" + "cell: " + Rule("Cellphone_Format") + "</p>";
    

     

    I'd like to have this work with copyfit as some of the emails are bound to get quite long. Also it would be nice if the rules weren't hard coded for font sizes, might make the rules a little more versatile.

     

    Any help is much appreciated.

     

    Thanks,

    Evan

    Archive.zip

×
×
  • Create New...