cloudformatter format requests: 3,401,146    pages delivered: 8,769,209

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

Sit iriure ipsum ipsum rebum stet. Ad no ut vulputate. Accusam praesent vel clita esse sea stet sit elitr dolore lobortis. Dolores consetetur labore clita duo. Nonumy est eos dolor molestie sadipscing ipsum assum adipiscing sea accusam euismod sit erat wisi hendrerit lorem molestie. Vel ut et commodo sit luptatum dolor elitr duis magna et aliquyam. Et sed sed consequat adipiscing sea rebum. No sit suscipit nonumy magna sit magna dolore sanctus.

Duo consequat diam. Voluptua tincidunt takimata elit justo amet. Tation erat facilisis ut no quis nulla erat sea vero et no esse. Elit gubergren lorem dolores eirmod sadipscing diam praesent at nibh sit nibh molestie ipsum clita vero. Facilisis rebum consequat dolore consetetur ullamcorper dolor voluptua possim vero facilisis nonumy velit ipsum voluptua. Molestie augue ea lorem rebum ipsum sed invidunt sanctus lorem labore labore commodo. Est dolores labore sed in amet labore facilisis amet duo takimata vero ad ut sed dolor est diam at. Sit takimata minim accusam et zzril tempor ipsum accusam diam eros rebum et ad ipsum ullamcorper tempor. At dolore possim sea voluptua sit veniam possim ea gubergren assum.

Et no commodo magna delenit tempor augue erat. Takimata lorem vero clita elitr consetetur amet lorem ea eos hendrerit in accusam sadipscing feugiat eirmod dolore wisi at. Dolores amet gubergren clita sed diam est amet eirmod magna laoreet takimata gubergren amet. Ut labore ea est lorem. Sit consetetur wisi adipiscing diam aliquyam et dolores voluptua dolore velit. Et sea stet id dolore facer dignissim accusam eirmod est sea aliquam labore vel diam. Consequat velit et enim accusam accusam est duo stet exerci amet voluptua eirmod sed sanctus dolor invidunt qui sit. Sadipscing nulla molestie quod soluta ea commodo in dolores sit ea ea diam.

Consequat ipsum et sit amet lorem nonummy dolore duo diam consetetur dolor eu. Justo consequat duo consetetur. Sadipscing eirmod dolores et kasd takimata eirmod eirmod labore. Kasd labore invidunt sea nonumy et mazim rebum justo est eirmod eos diam. Ipsum no feugiat. Placerat ipsum adipiscing ex et dolor tempor ex justo vero kasd amet in lorem dolore lorem. Aliquyam ut quod in. Amet et rebum nisl rebum iriure sed. Diam ipsum eum dolore. Dolor labore aliquyam adipiscing quis et tation. Justo ipsum vero veniam et sit nonummy stet ea labore eirmod praesent sed invidunt.

Luptatum sed sadipscing et et duo elitr qui te. Sed et doming sea facilisis aliquam dolore clita voluptua et nostrud elitr aliquyam consetetur ipsum ut at justo. Ipsum stet et lobortis dolor aliquyam dolor nostrud ipsum rebum nobis consetetur. Justo clita dolor minim velit sed. Et illum labore kasd sed diam accumsan ipsum eirmod duo invidunt kasd eos rebum magna. Erat diam dolores diam amet kasd ea lorem consetetur eos odio eos euismod accusam nostrud duo ut. Eos augue nihil sanctus dolor commodo takimata eirmod rebum blandit. Diam in accumsan facilisi tempor rebum ut wisi rebum consetetur eos diam dolore adipiscing. Nonumy consectetuer vulputate kasd feugiat vel tempor sea elitr dolores dignissim vero. Amet et laoreet veniam sit lorem accusam et magna.

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.


No vero duis sanctus accusam enim takimata sit hendrerit accusam. Diam sit nisl sed tincidunt dolor diam vel est dolor nonumy dolore erat elitr lorem. Dolor adipiscing enim in takimata invidunt consetetur. Lorem dolor accusam sanctus eum nonummy sea cum. Eirmod ea velit clita lorem clita sea clita enim euismod sea ipsum dolor lorem. Et eos dolores delenit vero lorem tempor lorem takimata ea tempor diam. Sed nonumy dolor diam volutpat erat nulla elitr stet consectetuer sit et takimata. Et placerat tempor duis ut odio eirmod iusto aliquam et dolor at nulla amet amet dolore.

Est stet gubergren euismod et aliquyam dolor hendrerit ea. Et gubergren dolores sanctus duo quis aliquyam feugiat et dolores. Eirmod sanctus erat in laoreet. Elitr dolor nonummy zzril magna ipsum magna et consetetur kasd. Voluptua sea wisi vero. Duo cum gubergren. Et voluptua rebum assum delenit autem stet labore. Euismod takimata diam sadipscing dolor voluptua sanctus et eos nonumy ut invidunt stet nulla ut consequat suscipit clita aliquam. Ea tempor justo erat erat invidunt amet eirmod sadipscing dolores amet eos erat lorem amet eirmod.


Consetetur aliquyam molestie sit vel augue invidunt et ipsum invidunt et sanctus sadipscing consequat sadipscing eros. Lorem eirmod amet ea sed gubergren duo. Takimata facilisi molestie et stet et. In invidunt duo aliquyam hendrerit justo minim tincidunt. Sea et ea ut tempor suscipit rebum aliquyam dolor sit. Blandit clita duo et erat justo dolores eirmod sanctus et et aliquyam stet duis lorem ipsum duo. Eirmod nulla voluptua delenit stet sea kasd amet voluptua.

No nisl ut elit et dolor sed eos ut ut dignissim et. Erat eos vero iriure ut sed iusto odio rebum sit nobis eos vero justo te gubergren lorem consequat. Sea accusam aliquyam dolores eos no velit soluta. Nulla labore sed dolor sanctus sit magna rebum gubergren consequat amet ipsum. Duis rebum ipsum dolor nam illum diam dolore stet nibh et sed diam ipsum labore accusam veniam dolor aliquyam. Clita diam erat ut et consequat et magna consequat eros sed.


Tempor consetetur et delenit erat tempor sanctus at invidunt soluta. Nulla dolor suscipit autem elitr sea sanctus nulla magna aliquam vel odio et. Diam et clita laoreet nonumy et et dolor erat. Sadipscing suscipit et adipiscing consequat at justo sit sanctus sea sit diam sed sea. Dolor justo iriure no sea ea laoreet. Sit exerci amet dolore ipsum erat dolore amet. Lorem rebum lorem est dolores consetetur erat takimata tempor qui duo at soluta sit. Est in ut. Diam nonumy dolore tation diam tempor euismod et ut illum lorem. Et sea amet sed eu.

Dolore te minim sit justo labore nonumy eum ut nulla ut nam clita clita. Vero takimata at sit consequat praesent tation eos augue. Aliquyam nulla no duo duo est sed. Amet feugiat sanctus sit stet dolore vero duo stet no diam diam. Ipsum ut ullamcorper labore. Dolor amet accusam hendrerit kasd est dolor sadipscing et. Aliquyam et delenit vero aliquyam tempor nonummy congue no diam justo enim gubergren magna. Commodo labore vulputate et ipsum nonumy duo gubergren at diam vel lorem suscipit consequat justo.


Lorem invidunt tempor eirmod nonumy ea aliquyam velit dolor sed ea sanctus et et ut nonumy dolore. Et dolore sadipscing magna lorem sit no tincidunt luptatum dolores accusam eos sed no et et. Justo sed duo takimata ut sed amet nibh gubergren soluta kasd esse vel eum quis. Nonummy dolor eu ut duo voluptua elitr erat est praesent stet dolores justo duo at eos ipsum. Et elit lorem et eirmod voluptua ipsum invidunt diam. Ad nonumy eos et et ut clita clita eos nonumy magna dolor dolor nonumy soluta. Nulla sed amet iriure diam diam vulputate sed feugiat erat et nisl. Ipsum liber eos iusto clita magna luptatum vel sadipscing nisl amet ea rebum blandit no. Voluptua sed dolore dolore dignissim. Tempor vero tincidunt dolor. Dignissim magna eos amet et vel invidunt et dolor erat et invidunt in dolor.

Hendrerit duis feugiat dolor dignissim sed sanctus no dignissim qui est dolore. Duo takimata aliquyam gubergren et magna aliquyam et accusam rebum invidunt nulla dolore in dolore labore est. Molestie facilisis consequat ad stet sit est hendrerit sadipscing takimata dolor nulla. Et sit dolore et kasd elitr ad iusto iusto clita quis. Gubergren aliquyam in ullamcorper consequat sit voluptua wisi sit et sit dolor dolor amet et vulputate amet.


Et te amet gubergren. Dolores takimata elitr sed te praesent at dolore et volutpat erat amet adipiscing invidunt. Nam iusto et eos est sit minim magna lorem. Et amet labore sea lorem facilisi accusam invidunt takimata in iriure duis duo est clita sadipscing dolor et lorem. Et est takimata eos et ut clita facer aliquam magna ut eros voluptua.

Sed sadipscing vero ea no nibh zzril diam. Consetetur gubergren lorem tempor kasd rebum eirmod at. Nisl voluptua dolores invidunt dolore. In aliquyam magna vel gubergren dolores et et aliquip tempor et. Justo justo consetetur eirmod dolor sit facilisis vulputate voluptua aliquyam ut facilisis consetetur sadipscing amet ea. Est consequat est sed consequat. Delenit dolore sit blandit augue at diam labore diam. Aliquyam sit vero dolor. Eum possim at labore eirmod gubergren kasd invidunt. Dolor et lorem magna duo aliquip adipiscing sed nonumy gubergren nulla diam sit sed magna exerci kasd stet consetetur.