Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Adobe form - Pages - Table layout into multiple page

Avatar

Level 1

Hello,

I have an Adobe form that can be displayed on 1 or multiple pages.

The Adobe form is composed of a header, a table, a total, a "References" block and a footer.

The header and the footer are present on each page.

The "References" block is only displayed on the last page.

The number of pages depends on the number of items into the table.

For example :

a) 1 page

 

1781924-adobe-form-1-page.png

 

b) 2 pages

 

1781926-adobe-form-items.png

 

My problem :

If the Adobe form contains various pages, logically, the table has to be displayed on various pages. Two things have to be taken into account :

  • In the table, each item has a description which may contain 1 to various lines.

For example :

 

1781927-adobe-form-2-pages.png

 

  • Each table on each page must have the same size.

I think it would be laborious to control how many lines each item contains.

I would like to put the "References" block only on the last page and keep the same size for each part of the table on the multiple-pages document.

Does anyone have a solution for this ?

Thank you !

Pmsow

 

 

 

 

1 Reply

Avatar

Level 10

Hi, 

 

it's not that difficult to keep tables the same size. The layout processor can determine the exact size of every object via script. This can be used to "transfer" the value to other objects.

 

This is a calculate script to copy the cell heights of Table1 over to Table2. 

You possible have to modify this script to work with your form. 

 

var cUnit = "mm",
nCellHeight = -1,
oInputRows = Table1.resolveNodes('#subform.[layout eq "row"]'),
oOutputRow = Table2.resolveNodes('#subform.[layout eq "row"]'),
i;

if (oInputRows.length === oOutputRow.length) {
for (i = 0; i < oInputRows.length; i += 1) {

// get the height of the first draw object in the row

nCellHeight = xfa.layout.h(oInputRows.item(i).resolveNode('#draw'), cUnit);

// set the same height to the first draw object in the other table

oOutputRow.item(i).resolveNode('#draw').h = nCellHeight.toString().concat(cUnit);
}

// Recreate the layout, to see the effects

xfa.layout.relayout();
}

 

The visibiliy of the reference block can be easily set. You only need to determine if it's on the last page or not. Put this into the layout:ready event of the reference object.

this.presence = (xfa.layout.page(this) < xfa.layout.pageCount()) ? "invisible" : "visible";