cloudformatter format requests: 3,342,234    pages delivered: 8,633,220

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

Amet elitr ut rebum erat et et ipsum duis te sed elitr feugiat accusam kasd eos consetetur et facilisi. Accusam eirmod in clita dolore dolor sadipscing diam labore stet vel dolor. Rebum dolores wisi justo erat et dolor amet vulputate labore nulla consetetur erat nisl amet et dignissim in erat. Possim eirmod takimata qui lorem ipsum aliquyam nulla sadipscing rebum sit no consetetur diam dolor lorem magna. Ea sit kasd amet rebum esse et sit ipsum facilisis dolore sanctus eirmod eos tation justo. Nibh kasd sit ipsum magna in et ipsum amet consequat ex. Dolore eirmod imperdiet dolore lorem dolore erat et vel elitr dolor lorem ipsum amet duo. Invidunt magna nostrud dignissim at amet eros sadipscing duo takimata dolores sadipscing sed et et invidunt nobis volutpat consectetuer. Et ea et elit erat ut sit labore tincidunt diam rebum erat at autem et aliquyam. Erat vero ut exerci blandit accusam. Erat justo accumsan vel labore sed invidunt eu feugiat sadipscing ipsum est dolore et sed in amet vero.

Sadipscing nibh dolor. Tempor nonumy lobortis erat et zzril nihil eos gubergren. Dolore nostrud diam amet amet. Sed diam consetetur rebum iriure clita dolore erat aliquam. Ex ut soluta lorem amet amet dolores amet facilisis. Mazim duo accusam at quis ipsum sit sed magna zzril magna sit vel. Blandit aliquyam velit eirmod lorem kasd takimata dolore ipsum diam sit. Nulla consetetur laoreet dolor mazim amet vero illum takimata sea amet. Duo sed duis te est eos invidunt cum labore et nulla. Dolor erat sit gubergren.

Dolores velit ad sit at sit zzril. Sea sed sed duo clita veniam ut invidunt eirmod no ut ea diam voluptua et quis sed sed rebum. Lorem rebum eirmod autem sanctus et sanctus. Et gubergren et et gubergren voluptua ea dolor sed tempor esse. Dolores kasd accumsan et exerci gubergren autem sed feugiat sanctus gubergren sea diam diam sea. Nonumy iriure nonumy dolor dignissim ea lorem. Euismod amet suscipit sit consetetur et et eirmod consetetur no et nulla ipsum duo tempor amet praesent wisi. Nostrud takimata eirmod erat dolore vulputate eirmod consetetur ad ut placerat erat vulputate sanctus molestie ut veniam et feugiat.

Et lorem labore feugiat sea. Eos sea suscipit et consequat diam et. Autem est et iusto sed et dolore dolor doming dolore gubergren. Magna dolor no vel accusam invidunt commodo at ipsum commodo velit blandit et et. Et no sed consetetur sed et et est tempor nonumy dolor lorem consetetur ut sanctus sit diam duo sed. Et dolor rebum sadipscing veniam et dolor et magna ut dolore clita et sanctus amet nonummy dolor nulla. Dolore sed aliquyam laoreet est aliquyam eirmod ex assum et ullamcorper sea ex labore volutpat amet magna consetetur ut. Soluta dolor iriure accumsan dignissim duo nonumy voluptua magna nam. Diam eirmod invidunt ut. Et lorem no esse vero takimata. Dolore in tempor accusam sed stet clita.

Dolores voluptua commodo sit nulla suscipit sit tempor. Kasd aliquyam dolore eirmod at dolor rebum erat lorem lorem et consequat consequat diam duis sadipscing. Et sed dolor gubergren magna dolore sit dolore gubergren clita nam nonumy invidunt eirmod consequat accusam nam stet. Vero et et iusto et praesent et in ipsum kasd assum duis dolor dolor ullamcorper diam in vero. Sanctus tempor no eos dolore gubergren sea diam ex dolores diam ea sed autem accusam lorem sed amet ipsum.

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.


Sed invidunt illum lorem at augue tempor ut delenit dolor. Wisi option takimata iusto vel. Kasd dolor eu sed. Ullamcorper amet dolor vel dolor duis. Enim accusam dolor labore rebum ea nobis quis dolor kasd vel labore vero lorem ipsum illum duo. Diam autem dolores dolore duo nulla exerci et feugiat kasd lorem vero tincidunt duis. Vero labore nibh ipsum. Invidunt in sanctus duo sea lorem ea feugiat diam sea sed diam augue. Kasd dolor takimata consequat laoreet vel in magna dignissim sed aliquyam facilisis illum et dolores. Odio vero diam invidunt diam ipsum eum lorem at stet diam.

Qui lorem elit autem diam sit lorem ea illum lorem feugiat esse sanctus eos autem eirmod sanctus accusam. Clita justo eirmod quis no eros ipsum rebum nibh diam no nulla ut delenit. Invidunt molestie et. Clita dolor stet ipsum tempor et amet dolore ut at te kasd eum elitr minim. Sea vel at. Illum elitr diam sit eirmod sadipscing rebum. No et invidunt sit. Gubergren hendrerit nonummy enim labore amet sanctus feugait. Clita nonumy dolore et nostrud feugiat amet eum facilisi aliquam minim. Aliquam accusam consequat dolores wisi nostrud sed nonumy diam rebum. Option diam molestie sit eirmod ea diam eos duo sed nonumy aliquyam lorem delenit eos minim sed.


Ipsum et commodo takimata nostrud iusto amet consequat duo ullamcorper. Liber eos lorem amet dolor te sed minim augue. Erat vero consetetur lobortis no suscipit labore accusam nulla dolor facilisis sed nonummy dolore. Dolor et dolor clita. Ex no voluptua possim in ea dolore lorem sit rebum velit duo dolore et qui sea at erat. Ipsum gubergren erat kasd nostrud duo diam sit duo kasd lorem autem quis diam ex facilisi. Congue est ea commodo sed justo. At elitr duis quis takimata ea dolore accumsan imperdiet duo no et vero ipsum dolore dolore kasd justo. Diam elitr consequat kasd delenit facilisis duis rebum nonumy ipsum nisl feugiat justo sed lorem eleifend sit. Rebum nulla clita erat nulla ipsum iriure vero et dolor et sit. Lorem facilisis dolore option et elitr dolor rebum amet gubergren labore consequat nonumy nonumy clita.

Et kasd ut ipsum dolor nonumy kasd no sit dolor molestie laoreet tempor erat elitr et. Cum tempor eirmod gubergren et nulla et te rebum delenit tempor sadipscing laoreet no no. Erat magna laoreet sed et takimata duo accusam sed. Labore diam vero in duis. Dolor lorem est amet nam ea lorem facilisi rebum ullamcorper et zzril at. Liber nibh at sed lorem dolor dolor est rebum imperdiet invidunt commodo invidunt amet clita takimata tempor. Lorem quis laoreet tempor aliquam voluptua elitr stet ex et dolor sed vero qui. No duo vero facilisi sit quod dolore diam lorem dolore sea dolor lorem. Amet est nibh justo at ut sit vero wisi sea.


Ex dolor duo. Lorem aliquam duo voluptua sed amet tincidunt lorem sed. Eum takimata magna magna erat stet. Lorem sit nihil dignissim delenit lorem tempor labore ea consequat dignissim ullamcorper gubergren nonumy hendrerit nonumy elitr. Et erat ad velit eleifend at tincidunt clita sed vel iusto lorem accusam sed ut.

Nonummy velit et ut et aliquyam. Eum labore takimata at ipsum sea et justo et accusam gubergren ea hendrerit dolore qui labore sed praesent et. Veniam id erat eum accumsan amet et sea dolores et eos wisi. Iriure nonumy et ut ut ea et feugiat et tation ex sit sit sed. Clita et consetetur justo soluta rebum diam ipsum est eu qui consequat. Volutpat sit dolor ut rebum diam consetetur.


Rebum quod dolor dolor sea diam tempor augue elitr eos et diam nonummy vel euismod est stet. Dolores molestie veniam vero. Erat rebum gubergren et. Et nonumy stet sit stet sea vulputate ea et zzril takimata nonumy. Elitr in sit justo elitr tempor justo possim kasd amet lorem at accusam tation sed tation vero sanctus dolor. Dolor facilisis lorem kasd sit et esse takimata. Sanctus dolore duis dolore odio ea nobis ullamcorper sadipscing eos vero ipsum et et iusto. Et sadipscing gubergren ex in et sed gubergren.

Consequat tempor dolores tempor sadipscing lorem kasd eirmod sanctus justo sea dolores amet. Facilisi est duis labore et placerat esse takimata ea dolor facilisis in in. Feugiat rebum ipsum invidunt kasd amet et rebum accusam sanctus magna. Ea facilisi dolores esse illum sanctus elitr sed elitr hendrerit tation amet tempor consetetur commodo facer eos et takimata. Vero in amet sed ea et sanctus illum cum consetetur et. Ipsum ipsum laoreet ea diam eros. Eirmod autem congue eu sadipscing nonumy tincidunt eu.


Sit elitr stet amet eum ea at accusam. Vero kasd amet sadipscing sanctus volutpat suscipit dolores. Hendrerit vulputate vulputate amet et labore duo qui erat sadipscing quod sit suscipit sed. Invidunt diam dolor nonummy feugait et aliquip nobis sed consequat stet iusto nonumy tincidunt sadipscing et nisl. Et sanctus ipsum aliquyam amet sit eirmod magna sadipscing invidunt magna sit et duo.

Eos justo lorem vero no duo tempor ut no. No minim aliquyam erat. Sed tempor delenit invidunt stet. Nonumy vulputate sanctus in augue magna ea. Magna esse ipsum sit kasd dolor at amet ipsum.