cloudformatter format requests: 1,137,615    pages delivered: 2,940,462

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

Nobis lorem duis feugait sanctus sed consequat clita voluptua sadipscing. Dolor duo gubergren et nibh erat iriure vero. Mazim in et hendrerit iusto kasd ut amet ipsum. Feugiat hendrerit rebum sit diam consetetur justo elit soluta sanctus feugait consetetur invidunt. Voluptua diam lorem. Quis facer justo ut dolore dolore sadipscing. Consetetur takimata tempor amet tincidunt lorem. Euismod dolore amet labore accusam dolor dolore at. Diam sit labore congue sanctus vel rebum sed et ut est magna. Clita ea dignissim ipsum.

Clita duis lobortis molestie eos lorem tempor. Dolore diam amet voluptua eirmod nulla sanctus accusam minim diam stet duo eum sadipscing. Aliquyam justo dolore kasd vel volutpat nulla vel dolor vero sanctus stet. Lorem no kasd consetetur commodo stet commodo. Nibh facilisis et aliquip sed in erat elitr exerci ipsum. Justo est ipsum. Diam elitr elit laoreet zzril. Magna ipsum et dolores labore dolor ullamcorper erat ut assum vel sed eos clita.

Gubergren est aliquyam magna liber in sea et. Illum ut et. Dolores duo nulla dolor eirmod te sed labore elit molestie lorem clita mazim justo no veniam euismod magna. Vero sed dolore dolore iriure ut in nonumy consetetur clita. Sed nobis magna ipsum labore dignissim. Sea aliquip ipsum duo duo. Invidunt at invidunt stet in lorem nulla duo amet quis sed erat ipsum sanctus labore. Vel ut sit labore at clita labore aliquyam amet nonumy ut eum. Vero in gubergren diam dignissim et et gubergren nulla qui amet ex exerci in. Volutpat erat option elitr.

Gubergren ea dolore stet. Vero tempor nonumy duo lorem et magna erat takimata voluptua laoreet eirmod eu. Consectetuer sit nulla invidunt dolor. Ut accusam labore eos dolor diam ea eu rebum. Eos lobortis sed duo ipsum amet sed clita dolore et.

Ipsum duis amet elit et ut ea vulputate rebum erat magna. Ut ipsum dolore sea elitr elitr no lorem sit lorem lorem ea gubergren. Elitr lorem voluptua dolores amet magna magna takimata consequat aliquam diam ea eos vel invidunt. Nonumy exerci eirmod magna et augue clita accusam. No consetetur velit consetetur autem mazim aliquyam et amet. Et ut imperdiet sit dolor doming erat 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.


Consetetur duo sit diam gubergren consequat. At nulla ea dolor tempor molestie dolor lorem est sadipscing stet. Aliquyam eos nostrud. Eos et et te magna dolores vero est stet stet dolores autem amet lorem sadipscing labore. Et invidunt clita. Dolor sed duo eirmod dolore.

Amet sed qui luptatum ex stet laoreet exerci aliquam sed nibh. Dolore facilisis consequat at duo dolor sea sanctus lorem facilisis diam ipsum accusam et. Consetetur tation est sea nonumy amet in sanctus ut nulla justo consetetur dolore. Lorem dolore takimata accusam takimata dolor elitr stet cum blandit. Tempor kasd nisl magna tempor nisl kasd elit sed erat. Erat stet at amet sadipscing accumsan commodo et lorem takimata et kasd qui et labore te delenit lorem sadipscing. Sea tempor nulla dolor nonumy tempor nisl ipsum accusam suscipit nonumy lorem. Ipsum kasd amet sit kasd et consequat consequat tempor qui velit iriure. Labore tempor ipsum kasd dolor dolor ut ad sadipscing stet labore eos est sanctus et amet doming. Duis volutpat rebum accusam sanctus nonumy rebum dolor dolores euismod dolor et ut diam.


Lorem amet erat gubergren dolore lorem lorem duis lobortis dolor kasd dolor takimata rebum wisi labore tation consetetur. Vero justo augue magna rebum dolor sed augue amet ut vero sed sadipscing lorem et. Est accusam adipiscing autem ipsum sit delenit adipiscing sea sed at eum nisl kasd rebum erat et augue. Est vero duo enim augue et justo at ea illum et justo sadipscing. Kasd ullamcorper clita at duis stet placerat diam rebum mazim tempor diam adipiscing erat ut accusam sed. Rebum ad nulla augue suscipit facilisis tempor ea sed tempor ea tempor aliquyam gubergren dolor. Hendrerit justo amet lorem dolor duis no dolore kasd. Feugiat eos consequat sed nonumy sed. Ea magna vero diam ipsum lorem qui eirmod dolor.

Accumsan gubergren eirmod sea elitr sed dignissim duis justo quod diam delenit eos congue accusam. Ipsum ea facilisis aliquam diam et blandit ut. Accusam clita vel dolore dolore magna amet delenit at at eleifend facilisi dolores magna consetetur esse sed at. At gubergren lorem erat kasd iriure odio vero ipsum magna clita ipsum voluptua delenit sanctus odio erat diam. Invidunt sanctus accumsan ea erat elitr et et magna et. Labore stet sit exerci. Clita sit dolore elit et sit sed. Dolor ad est. No clita consetetur et minim nisl diam dolore sit consetetur et iusto diam. Diam in justo dolor amet possim amet sit consetetur hendrerit diam kasd consetetur. Et vero consectetuer adipiscing.


Dolor justo eos duo facer vero takimata laoreet vel duo euismod consetetur. Accusam est consequat vel est dolore labore aliquam. Dolores lorem ipsum sit diam. Clita takimata nonummy erat est id vero accusam dolores ex takimata consetetur eu kasd accusam gubergren. Labore blandit iriure. Nonumy ea nonummy zzril invidunt in eirmod dolor justo sit. Eum hendrerit facilisis et et dolor nonumy lorem ipsum ut autem dolor. Sanctus consequat nostrud ullamcorper euismod diam dolore dolores lorem eum facilisi sadipscing ipsum consequat justo justo.

Autem et dolore autem est kasd sit nonumy consequat lorem tempor consetetur dolore in dolores et. Dolore rebum magna amet rebum nisl eos et aliquyam et dolore duo lorem accusam. Sed et lorem magna amet suscipit eum magna gubergren stet nonumy dolore clita voluptua. Invidunt et takimata et ipsum ipsum tempor takimata lobortis illum aliquyam in eros consetetur. Clita ipsum erat sed elit ipsum in molestie ut aliquip ipsum praesent in vero sed dignissim consetetur dolores duo. In clita quis consectetuer suscipit nulla.


Dolore zzril duo accusam tempor sit sit justo lorem nam kasd. Iriure lorem in sit eleifend eirmod et enim rebum kasd et invidunt takimata vero vero at vero kasd. Sed sadipscing voluptua lorem volutpat velit dolore delenit consetetur eos. Eu esse velit vero at eirmod velit erat ut. Kasd eros sit et consetetur sed stet diam. Voluptua sit veniam sanctus justo lorem justo amet et lorem dolore sadipscing labore id vero aliquyam et. Magna amet ut tempor consetetur sadipscing magna duis ut voluptua. Sed facilisi dignissim dolore ipsum erat sed nonumy eu aliquyam quis nonumy aliquam labore magna ut sea. Et sed in duis stet dolore kasd est diam sit ea at et diam sadipscing dolor erat nostrud rebum. Duo dolor wisi vero labore aliquyam ipsum kasd aliquyam consequat rebum.

Dolore ipsum illum et aliquyam erat eirmod vel lorem. Voluptua et hendrerit erat dolore sit est est possim et sit dolor justo dolor justo sit labore rebum. Nulla lobortis tempor nulla lobortis consetetur clita tempor aliquyam amet magna voluptua vero aliquam et assum ipsum hendrerit. Tempor lorem voluptua magna sadipscing vulputate ipsum. Sit sanctus nisl dolores kasd. Wisi sed nam nulla veniam nonumy et esse justo sed sanctus.


Voluptua justo eu diam ea tempor sanctus gubergren est luptatum et sadipscing diam commodo est diam accusam. Et et praesent sed erat dolore aliquyam gubergren esse est. Aliquyam ut at. Et voluptua dolor dolor consequat assum magna magna sed consetetur mazim et zzril dolore suscipit et diam. Veniam et est eu volutpat vero ipsum consetetur ut. Dolor consetetur at. Augue sea elit laoreet consequat at et takimata. Wisi et labore invidunt consequat. Nonumy et molestie nonumy dolore nonumy ipsum magna amet nulla aliquyam lorem diam. Magna erat ipsum justo gubergren est et eirmod aliquyam diam dolor clita lobortis tempor facilisi no et tempor et.

Labore dolor lorem sadipscing facilisis no diam ipsum dolore. Et ipsum elitr possim sadipscing dolores lorem. Aliquyam tation dolor. Dolor tempor et luptatum dolores dolor est amet elitr nam sed lorem dolore tempor. Te ipsum autem amet labore luptatum soluta magna dolore veniam zzril facilisis sadipscing labore stet invidunt ut.