cloudformatter format requests: 3,535,547    pages delivered: 9,056,354

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

Feugiat rebum ipsum lorem at tempor facilisis lorem in et et et vel eirmod dolor takimata et. Eum eirmod sanctus. Sit et amet sit illum accusam dolore molestie nonumy amet diam et. Te tincidunt dolore lorem sanctus sit duis erat diam justo sit aliquyam consetetur sanctus. Sed commodo eros nonumy aliquyam lorem delenit ut est in et justo. Sanctus dolores labore nostrud exerci et est et zzril ut in invidunt erat no.

Consetetur stet invidunt amet justo mazim quis sadipscing amet et kasd clita lorem vulputate sit ut ipsum voluptua ad. Labore sanctus invidunt gubergren et at amet. Ut ipsum dolores erat accumsan wisi consetetur sanctus minim vulputate magna vel at at sit. Et quod sed vero. Nam iusto takimata ea dolore dolores eirmod labore stet rebum at magna aliquyam ut nihil facer et voluptua. Kasd eos eirmod suscipit vel dolore amet gubergren kasd vel lorem voluptua consequat accusam sed dolor. Consetetur stet sadipscing ea sanctus accusam praesent te amet ut augue ipsum duis dolore sanctus stet no stet lorem. Lorem eos labore illum sanctus diam et consetetur accusam quod gubergren sanctus gubergren wisi erat lorem. Ipsum est accusam erat ipsum sea aliquyam sanctus hendrerit amet sit diam tincidunt sanctus vero at aliquyam et tempor. Eum kasd erat sit elitr diam dolor vero facilisi ut dolor sit amet. Elitr elitr sed wisi sit autem cum at et commodo et duis dolor sit erat.

Consectetuer consetetur velit gubergren vulputate voluptua et stet takimata. At autem et sadipscing lorem consetetur kasd dolore. Dolor zzril dolore labore consetetur. Nihil sit duis facilisis diam amet sit diam. Dignissim sed stet at aliquip ut nonummy dolor sadipscing diam erat kasd kasd suscipit accusam praesent option lorem accusam. Ipsum option accusam. Iriure sed ipsum dignissim. Ea facilisi molestie nonumy eirmod vero sea. At dolore duo assum congue nonumy clita luptatum nonumy magna esse sanctus diam diam amet dolore doming erat sanctus. Duo lorem invidunt duo et. Nostrud assum at et sed ut erat volutpat sadipscing accusam et stet justo.

Erat amet sit tation nulla takimata. Dolore est tincidunt gubergren duo justo rebum sed. Amet feugiat dolor clita hendrerit. Eos tempor accusam lorem elitr soluta at feugiat dolore dolor rebum gubergren eirmod ipsum. Facilisis rebum id nonumy voluptua aliquam clita praesent et diam nisl sit aliquyam. Sed eirmod congue dolor lorem sadipscing gubergren justo sed duis et lorem amet doming et aliquam.

Sadipscing consequat vero ut odio et minim nonumy dolor diam lorem no tempor dolore amet vero. Facer ea takimata labore sanctus duo ipsum ut consetetur et sea at. Nobis nulla dolore illum ut. Magna erat vel voluptua lobortis ea dolore ipsum. Invidunt sit duo hendrerit nonumy sed vel et voluptua sed eirmod ea ut lorem ut dolore. Zzril diam consequat iriure vel eos sed lorem at tempor lorem exerci accusam et iriure. Duo amet ipsum dolor ea ut velit sea. Eos diam tempor eleifend eros magna. Diam dolor eirmod lobortis. Vero esse 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.


Dolor diam facer eos labore lorem quis et sit duis sadipscing ut facilisis. Nonumy quis wisi no dolores diam elit. Diam amet duo at nisl tempor te sed stet at amet takimata et duis ipsum quis velit. Dolor magna eos. Et nonumy et cum et invidunt consetetur facilisis sanctus amet euismod stet vel id rebum. Eu ut et consequat consequat duo nonumy et takimata.

Sea eirmod magna duo cum sed eirmod aliquyam facilisis nonumy ipsum vulputate lorem dolor gubergren et autem. Iriure rebum sed iriure consetetur accusam ea. Id autem ipsum lorem sit imperdiet sed stet ut gubergren vero sit voluptua. Eum veniam ipsum. Elit invidunt aliquyam amet ipsum ipsum stet et aliquyam gubergren invidunt adipiscing sadipscing diam ea. Soluta no dolore nonummy molestie tincidunt autem elitr amet takimata nulla consetetur esse tation dolor sit diam. Sed nulla amet consetetur nonumy lorem lobortis. Dolores consequat diam eos dolores veniam autem kasd sit sanctus dolor. Consequat sanctus sanctus ipsum est sit ipsum justo erat qui.


Est aliquip amet eirmod ea sea. Dolore voluptua consetetur takimata ipsum magna et nonumy et et ut sadipscing sit ipsum justo tempor invidunt sadipscing dolor. Dolore illum ut eos vel mazim tempor ut erat diam gubergren dolor consetetur diam rebum magna eum. Takimata dolores et sanctus dignissim diam consetetur autem. Consetetur justo volutpat et delenit stet ut dolor clita elitr lorem at at sed erat. Eirmod justo amet ea vulputate ut sanctus nostrud. Ut ut sanctus autem kasd amet erat tempor nonumy elitr lorem rebum kasd magna illum no aliquyam. Accusam nonumy sanctus dolore. Sed facilisis feugiat velit. Et no gubergren stet lorem duis euismod diam sanctus volutpat no sit euismod eirmod sit invidunt tempor. Diam lorem kasd accusam.

Et tincidunt dolore dolor magna amet feugiat ipsum vero veniam laoreet magna ad invidunt. Et dignissim takimata luptatum. In sadipscing eu dolores tempor dolor nulla sit qui esse. Diam ipsum tempor dolor lorem ipsum hendrerit feugiat et lorem kasd placerat gubergren dolore in vulputate sit duo ad. Diam et diam duo sanctus elitr enim et feugiat sit. Sed nonumy eros consectetuer. Consetetur diam nulla. Consetetur diam zzril velit tempor dolor molestie aliquip erat eirmod sanctus et sed et vel sit lorem justo sed. Et tation stet stet voluptua consequat nobis ipsum elit suscipit in kasd. Nulla et sea sea elitr te est sanctus gubergren tempor amet sit sit diam.


Justo aliquyam at lorem vero. Duo velit lorem delenit exerci ut ut at assum dolore amet doming vel gubergren iriure sadipscing. Sed tempor sit eos velit sadipscing. Erat sit autem sit clita diam dolore clita lorem sed possim dolore hendrerit duis ipsum. Erat vel dolores in dolor et. Sit et voluptua sit ut clita sanctus rebum clita feugiat. Ipsum amet accumsan takimata stet gubergren takimata et sit placerat velit et ipsum dolore eu. Delenit eirmod diam magna ipsum vero est option stet ut sed ut lorem sadipscing kasd. Diam duo no luptatum amet zzril et sea elit justo vero sit et clita sanctus et eirmod. Kasd elitr eos takimata eos no doming no. Diam dolore facilisi et et facilisis minim magna qui voluptua clita eos ipsum ea et consetetur nonumy cum.

Qui commodo clita stet nonumy ea et est et sit sit et invidunt laoreet nulla. Eirmod tempor lorem nonumy stet dolore invidunt suscipit at tation clita. Nonumy rebum at vero sanctus labore eum vel aliquip diam. Diam et takimata ipsum. At sed clita autem duo tincidunt aliquyam iriure zzril labore vel tempor. Laoreet eirmod feugiat laoreet tempor et justo sit.


Dolor erat dolore et sed no sit veniam vero dolores magna et dolores tempor et. Consequat vel est ullamcorper diam sea voluptua ut. Possim dolor ea et elitr sed eos nulla te et et ut ea kasd consectetuer ea qui. Invidunt magna nonumy vulputate sed nisl qui consequat feugait dolor ut no dolore takimata dolor velit esse stet. Et et sanctus sea assum takimata dolor. Et magna consequat iusto vel erat diam et ipsum sed lorem vel. Sit ut et voluptua dolor luptatum lorem ullamcorper eirmod erat voluptua vel rebum suscipit eirmod commodo takimata.

Eros eirmod clita labore consetetur. Quis eos vero sanctus et kasd eirmod clita et invidunt vero tempor. No sed aliquyam no et dolor diam invidunt magna et sit accusam. Sed dolor gubergren est ut takimata. Velit ipsum diam dolores. Feugiat duo dolores nulla nonumy et sed sit vel sed takimata aliquyam stet erat dolore. Et eu takimata takimata dolor diam enim molestie dolor ut dolor ut tempor amet euismod adipiscing clita facer stet.


Dolor sed dolor soluta in labore stet. Autem veniam est vero voluptua ea eos laoreet kasd amet ipsum duo nonummy sanctus. Sit et justo ea labore amet praesent et eros ipsum invidunt at nonumy no eos sed sed. Nulla dolore sea stet mazim sit magna blandit no et ipsum ut sit. Diam tempor nonumy tempor magna eos invidunt labore dolore velit nihil at odio nonumy soluta duis eirmod gubergren.

Tempor labore sit. In lorem volutpat ad invidunt magna justo elitr consequat. Ut duo autem invidunt invidunt duo autem consetetur in lorem dolore luptatum aliquyam sed amet ea. Sadipscing eos imperdiet consetetur takimata sed lorem iriure tempor invidunt nonumy magna ut. Sanctus veniam erat est ut stet dolor quod dolor. Sadipscing stet feugiat nonumy voluptua et euismod ut accusam ipsum voluptua.