Forum How do I...?

Multi-page divs

mark_anderson_us
Hi All

I designed a Bill of Lading (BOL) that originally supposed to be a single page. It has to align with a pre-printed NCR form, so everything uses absolute position divs. Now the requirements have changed and each line item occupies 2-3 physical lines (vs. one in original spec) and has a space after (so each item is 3-4 times the original size). To complicate matters, one XML that will be transformed to PDF contains multiple BOL's (e.g. 1 truck with multiple stops). I have no control over the XML I am fed and cannot use javascript. I transform from XML to HTML with CSS using XSL 1.0 and then feed output to PrinceXML.

The bottom of each page contains the total no of pallets, total weight, etc.. When the items span two pages, the totals should not appear on page 1, and should appear after all content on page 2. I tried to illustrate the concept in the attached diagram.

BOL.jpg


- The green is the "header" (ship from, ship to, carrier, etc.) and will be on every page
- The gray is the variable length content
- The dark blue is the totals
- The light blue are suppressed totals (but reserved space)

BOL 1's items occupy more than one page, so I need to suppress the totals section on page 1 (light blue), but block out the space (as the pre printed form still has boxes there). I then need to continue the content onto page 2 and display the totals on page 2 (assuming they fit).

Then repeat for all other BOL's in the XML presented to generate a single PDF

What happens now is the content in the grey section extends to the bottom of the page (even though the gray div stops about 2 inches from bottom). (I'm sure that's easy to solve with overflow). The big problem is I need the gray content to flow on to page 2 and the totals to be suppressed.

I'm kind of stuck on how to do this conceptually. Right now the totals are just a regular div. I'm not sure if moving them to the footer would help, and if so, how to suppress on required pages.

Any suggestions appreciated

Regards

mark
  1. BOL.jpg110.1 kB
    3xBOL in One PDF (1x2page, 2x1page)

Edited by mark_anderson_us

mark_anderson_us
I did some more tinkering with this and solved some of it

I now have static divs for the green areas, a table for the variable content and a footer to reserve the space for the blue areas.

The problem I have left, is that I need to get 3 XSL variables in the footer or be able to position a div after the table in the footer (e.g. outside the page area bounds).

I tried using a named page for the div that contains the blue area, but it always starts a new page (in BOL 1, there would be 3 pages and the totals would be on their own on page 3)

Any suggestions?

Regards

Mark
mikeday
If it's just regular text that needs to end up in the footer, what about using the string-set property on an element in the body, and then generated content with string() in the footer to show it?
mark_anderson_us
Hi Mike

I tried that, but didn't work for some reason. It's actually 3 fields, so unless I use a monospaced font (not sure client will accept it), I'm not sure it will suffice
mikeday
Okay, how about string-set that gets captured by an element in the document that is flowed to the footer?
mark_anderson_us
Could you give me an example Mike? Never used string set and couldn't get it to work with
jim_albright
Look at the Samples -- OSIS. Book and chapter use string set. Works great.

Jim Albright
Wycliffe Bible Translators

mikeday
Actually you may not even need string-set, if it is just text inserted by the XSL that repeats on every page. Do you know how to flow elements to the footer?