Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Dynamic Headers?

Avatar

Level 2

I've got a set of forms that are going into one easy to use PDF. There are a couple of flowable content areas, some of which will probably require extra pages.  Each page has its own header, ie, "Staff Positions....Form 1" (where "Staff Positions" is on the left, "Form 1" is on the right, spaced out evenly).  Typically, when an additional page has been used, we've adjusted headers to read "Staff Positions (Cont).......Form 1".  For the life of me, I can't figure out the best way to add the "(Cont)" onto each header for the subsequent pages.  My thoughts are:

  1. Add a separate master page for each (Cont). So if Form 1 flows, set the pagination overflow to use Master Page "Form 1 - Cont".  This Master Page will have a smaller content area and a static text field (in case 3 or more pages are required, the header sits on the Master Page).  However, are there any potential issues with having too many Master Pages? For this particular file, in total, it would result in maybe 7 Master Pages.
  2. Set up a hidden Text Field, copying the normal header but with the "Cont" added.  Use this is as an overflow leader via the pagination. However, if it's status is set to hidden (don't want to see it when not needed), what event would trigger it to become visible, and where and how does that get coded?  And would this make the initial hidden instance suddenly visible?
  3. Use the same Text Field that I have for my current header, and use it as a leader as well.  However, instead of coding to swap visible/hidden, use code to insert "Cont" onto the header.  I'd probably have to redesign the headers a bit, but not the end of the world.  However, the issue here is the same as the previous: Where and how is this coded?

Are there any other / better options?  I'm trying to simplify as much as possible (for the sake of smaller file sizes and more efficient operation), so I'm always open to suggestions.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Would it be possible to structure your form to use a Table object? This would handle repeating the header at the top of each page, then you can change the heading text when the table spans a page.

See this example https://acrobat.com/#d=p-BTpkDl*5rAVEfo03PdPA

This uses a floating field in the header to contain the text "continued" or is blank and the following code in the initialise event of the floating field.

if (xfa.layout.pageSpan(Table1) > 1)

{

    this.rawValue = "continued";

}

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

Would it be possible to structure your form to use a Table object? This would handle repeating the header at the top of each page, then you can change the heading text when the table spans a page.

See this example https://acrobat.com/#d=p-BTpkDl*5rAVEfo03PdPA

This uses a floating field in the header to contain the text "continued" or is blank and the following code in the initialise event of the floating field.

if (xfa.layout.pageSpan(Table1) > 1)

{

    this.rawValue = "continued";

}

Regards

Bruce

Avatar

Level 2

For those pages, it's very likely that I could do just that!  Even without a table setup, I would think I could use the same pageSpan and floating fields to accomplish the same goal.  I had bookmarked a discussion on floating fields for a separate purpose, and didn't even think of applying it to this.  Appreciate the help!

Quick edit: I added a floating field to a text field that was already being used as a header.  I changed the pageSpan(Table1) to pageSpan(NameOfPage) and it is a thing of beauty. You, sir, are a rock star.

Message was edited by: SisypheanEfforts to clarify that the method worked.