cloudformatter format requests: 2,958,232    pages delivered: 7,811,902

Pass-Through XSL FO Styling

xportability LLC

Pass-Through XSL FO Styling



We implemented the spacialized attribute fostyle to carry this information. Because the browser just ignores this, you must be careful to structure it correctly for processing. The proper structure is name: value; noting that the ":" after name is followed by a space and the ";" between items is also followed by a space.

In some instances you may wish to pass through XSL FO attributes that are not supported in HTML. This is an example, while the text in the HTML has a brown color applied, we have applied a CMYK color for the PDF generation through the use of the fostyle attribute. All fostyle attributes are applied after HTML css and also after direct attributes and override those in the HTML. This paragraph also has text-align justify in the HTML and font-stretch, font-size-adjust and hyphenate in the PDF output. The fostyle attribute is attached right in the HTML, just like style and uses the same structure internally as style.

The code for the paragraph above looks like this:

<p style="color: brown; text-align:justify;"
    fostyle="text-align-last: left; 
    font-stretch: wider; 
    font-size-adjust: 0.6; 
    hyphenate: true; 
    color: rgb-icc (255, 255, 0, #CMYK, .1, .2, .7, .5);">In some instances ...

Keeps of Various Kinds

Another common use for passing through custom elements is for properties that have specific meaning in a pagination situation like "keeps". There are several forms of keeps that can help you organize content so it is glued together as you like it.

The following are the most commonly used keeps:

  • keep-together.within-page: set to "always" and used to keep a block of content always together in a single page
  • keep-with-next.within-page: set to "always" and used to keep a block of content glued to the next one always together in a single page
  • keep-with-previous.within-page: set to "always" and used to keep a block of content glued to the previous one always together in a single page
  • keep-together.within-line: set to "always" and used to keep a span of content glued always together in a single line

The following shows some demonstrations of these capabilities.

Keeping Together Within a Page

This paragraph, the instructions and the following three para's of LoremIpsum text are surrounded by a <div> with keep-together.within-page as always, like this:

<div fostyle="keep-together.within-page: always;">
    <p>This paragraph, the instructions and the following five para's of LoremIpsum text are surrounded 
    by a <div> with "keep-together.within-page" as "always", like this:</p>...

Et dolores zzril ipsum eum ea congue sed ea. Ipsum labore augue. Sed veniam tincidunt nonumy eos autem ea. Stet dolores lorem ipsum dolores et justo stet lorem no consequat dolore elitr. Sea facilisi nostrud molestie sanctus nostrud exerci vero. Dolor magna takimata. Tempor quis elitr clita placerat sit qui ipsum et eirmod dolor sit magna no sit et consetetur. Nonummy velit dolore at ut congue nibh elitr tempor vel accumsan duo nihil no sed labore. Ea kasd ipsum. Feugiat vero diam at lobortis dolore clita sed blandit quis tempor est assum elitr enim duo.

Stet dolores lorem ipsum et nihil rebum suscipit. Et dolor diam et no sit et. Aliquip erat et. Tempor sadipscing sit justo consetetur eirmod duis no dolores aliquyam et. Et ad aliquyam stet. Justo magna consetetur amet eirmod ipsum consetetur in dolor at in erat. Dolores kasd stet sed facilisis sea ipsum erat accumsan gubergren stet duis nam sadipscing magna elitr takimata sed amet. Adipiscing sed ipsum et ut lorem doming takimata clita illum vero duo nostrud nonumy erat labore eos. Diam eos dolore eos option vulputate eos aliquyam amet velit stet elit justo. Sed clita wisi nonumy te sed facer tempor magna takimata dolores. Eu dolor sed duo ea ipsum et kasd tempor sadipscing placerat sea vel lorem ipsum at dolore sanctus.

Lorem diam feugait ipsum hendrerit diam elitr magna. Dolor voluptua facilisis accusam vero. Velit nonumy dolore at. Veniam tation augue. Et takimata kasd veniam elitr et consetetur et stet nonumy no velit in sadipscing at at. Eirmod lorem nonumy sit ea justo eos. Diam invidunt sit ea aliquyam lorem hendrerit adipiscing sea kasd esse augue magna eirmod hendrerit dolore. Rebum duo zzril lorem clita sit takimata amet voluptua. Lobortis accumsan labore lorem nonumy lorem diam. Augue consetetur at dolore nonumy duo sea ipsum commodo no. Sea adipiscing sit vulputate minim illum sit et est wisi at consetetur lorem.

Voluptua takimata vero aliquip dolor quod ad aliquam aliquyam sed no magna sed commodo clita. Stet ad lorem sit sed sadipscing eirmod diam accusam eirmod imperdiet magna. Sed amet exerci erat magna amet sit aliquyam sit stet dolor rebum stet dolore takimata accusam et eos sed. Nonumy diam sit erat aliquam duo rebum. Tempor elit voluptua sit dolore aliquip.

Et ipsum dolor ea. Dolor dolores ex dolor invidunt erat diam clita ea blandit ea justo molestie erat ad lorem et at stet. Rebum elitr erat invidunt sanctus eirmod. Quod ipsum velit justo voluptua eum eu ullamcorper eu hendrerit sadipscing sit nonumy. Sea vulputate et. Doming ad dolore consetetur. Adipiscing diam labore invidunt minim est invidunt dolore aliquyam laoreet volutpat aliquip consectetuer ut option nonumy at et.

Thus all of this content from the header through this paragraph is together on a single page.

Keep Heading with Para and Table

A common practice in print documents is keeping together headings and some of the following lines of a paragraph so no heading is orphaned at bottom of a page and at least a few lines of text from any paragraph stay together.

What follows this are a series of headings and LoremIpsum paragraphs. The headings all have "keep-with-next.within-page" as "always" which will at least glue them to the paragraph. The paragraphs all have widows of "3" and orphans of "3" which will attempt to glue together at least three lines of paragraph at the bottom and top of any page. The LoremIpsum paragraphs are randomly generated on refresh of the page so you can test various layouts just by refresing and printing again.


Clita justo ut suscipit amet sanctus accusam dolore at nonumy justo consectetuer amet sed nonumy sed sed lobortis dolor. Sadipscing gubergren dolor dolor vulputate nisl consetetur stet dolor et qui hendrerit et gubergren amet. Eos eum diam consetetur labore lorem takimata amet blandit ut dolor et esse. Ipsum diam justo sit et ipsum voluptua diam et kasd clita. Minim lorem feugait clita amet accusam amet exerci consequat volutpat enim sed. Eirmod tempor dolor facilisis ut dolor duo sadipscing sed at gubergren nonumy clita duo sadipscing et. Stet autem dolore dolor ut sit elitr placerat ex iriure magna diam accusam congue ex. Erat est lorem. Luptatum dolor sea consetetur ea molestie rebum gubergren sanctus magna accusam dolor in.

Et at doming magna sit est eirmod ipsum nisl eirmod et sanctus amet vel clita diam. Consetetur ullamcorper veniam praesent ipsum diam elit aliquip sea ea invidunt et eos duis lorem enim ipsum illum dolores. Sed duo et diam sanctus stet sanctus eu vel justo clita vel suscipit sea. Magna te eum lorem et ea vel diam diam dolor consetetur ipsum no stet ullamcorper. Rebum ad tempor et. Tempor invidunt vero ipsum illum stet eos. Ipsum et rebum rebum et et et lorem clita sadipscing diam nulla vero. Ut feugiat et ut dignissim et sed duis magna. Tempor wisi amet nulla ut sit sadipscing invidunt labore.


Diam nonumy et. Suscipit est ut at. Dolore elitr tempor et feugiat magna aliquyam rebum consetetur ut sanctus eirmod. Kasd at takimata nulla aliquyam et eos. Ipsum nulla velit iriure option dolore in nulla dolor et elitr accusam sed lorem amet gubergren. Magna est ea erat sea tempor feugiat illum dolores duo diam.

Dolor lorem eos eirmod veniam dolore justo diam sed sed quis ipsum dolor duo et et. Ullamcorper wisi sit ut ea et sea lorem amet facer no voluptua et duo et commodo. Accusam minim ad elitr at. Elitr veniam tempor diam eos id kasd vulputate sea dolor labore dolore. Dolore aliquyam sed et ea dolores vel consetetur gubergren amet.


Sea amet et erat sea dolor sed eos nonumy est aliquyam clita. Labore gubergren illum ipsum amet gubergren lorem tempor exerci wisi ex gubergren erat luptatum vero eos ut eu nulla. Ut clita takimata erat no labore lorem elitr lorem dolores. Sed enim amet aliquyam sea sit. Gubergren feugait feugiat. Illum duo consequat dolor nulla labore velit sea tempor takimata. Accusam facer et dolor lorem at consectetuer gubergren takimata esse.

Vero sed dolores consequat dolores. Consetetur nam sanctus no vero imperdiet diam option sea lobortis ea velit. Sed eirmod dolor clita est sea sanctus nonumy dolor eum et velit justo aliquyam gubergren. Diam clita lorem et lorem clita sit. Aliquyam luptatum amet stet elitr odio magna kasd duo illum amet in. Duis stet duis sed consetetur ipsum rebum sanctus et est elitr veniam sed. Placerat dolores aliquip accusam duo lorem. Dolore eos dolor sadipscing. Euismod sanctus eirmod nisl takimata possim lorem kasd at amet suscipit elitr sed no molestie duis voluptua.


Et dolor lorem suscipit amet illum te enim amet autem dolores nonumy veniam ut diam in ut justo consectetuer. Amet eos velit kasd in facilisis. Facilisis tempor ea accusam sanctus iriure consetetur. Diam odio esse sadipscing at eum et est ea. Kasd diam sea ea lobortis sit vero exerci. Dolores eum gubergren duis dolores consequat qui magna amet. At kasd consetetur vel tation sit et dolore at sea invidunt aliquyam duo odio sit elit est. Consetetur rebum rebum. Erat sit at ipsum erat.

Diam hendrerit ea diam ut sed eum duo est. Ut molestie dignissim praesent diam quod lobortis et ut vero lobortis euismod duis ut minim. Magna dolore sadipscing elitr est et kasd at et duo est ipsum adipiscing eum sed. Adipiscing ut voluptua doming consetetur diam at et vero kasd ipsum. Duo lorem lorem consetetur erat labore iriure nulla vero stet stet clita vero voluptua et justo justo. In minim labore sed consetetur rebum eu. Diam lorem takimata diam duo eum ex voluptua veniam ut clita diam elitr ipsum ut consetetur nonumy molestie. Ipsum duo justo in vero dolore sed. Diam duo voluptua est vero elit takimata vero placerat suscipit accusam amet hendrerit dolore luptatum dolore ipsum ut. Sadipscing nulla diam exerci dignissim sed at dolore ipsum no sit praesent sit iriure at justo te. Tation cum clita labore vero dolore volutpat praesent sed dolor dolores invidunt ipsum.


Sed lorem ullamcorper labore voluptua ut eu invidunt aliquip et ea aliquyam takimata accusam et rebum sea sed. Diam dolor dolore voluptua odio ea eirmod lorem amet vero lorem sit magna sea illum no. Duo hendrerit amet kasd erat sit gubergren clita te et. Clita placerat lorem dolor clita et dolore. Sed eos sit justo tempor magna et erat ipsum accusam nostrud accusam at.

Aliquyam amet vero et lorem et eos. Clita dolores gubergren sed sea et est nonumy ut augue nonumy velit dolore duo accusam stet gubergren. Nonumy takimata diam ut doming. Amet invidunt sea takimata odio ut imperdiet at blandit feugait velit qui. Nonumy no sea eos.