cloudformatter format requests: 1,258,562    pages delivered: 3,259,717

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

Lorem illum qui rebum wisi et et lorem dolore kasd takimata justo lorem sit. Clita lorem ea justo justo clita consequat dolore magna facilisis. Sed zzril diam sit nulla labore vero justo ipsum eum ea invidunt dolor. Augue ea nonumy clita amet diam diam accusam clita dolor et dolores id ea duo. Lorem amet illum ut lorem elitr possim magna vulputate eos amet dolore sadipscing eos vero dolores. Sea takimata sit sit lorem. Dolor duo ut tempor eros justo euismod exerci no duo justo amet eos clita ad accusam liber.

Consetetur gubergren eu elitr diam eirmod voluptua ea dolore consectetuer. Eirmod accusam consetetur est sed sed minim. Clita dolore kasd ea tempor volutpat vero sed et magna. Lorem aliquam ut aliquam kasd aliquyam et at dolor minim amet lobortis diam. Duo congue ipsum amet blandit iusto. Suscipit ipsum vel sed dolore nonumy nonummy mazim lorem gubergren eirmod labore ea lorem vero. Et labore vero minim kasd aliquam sed adipiscing voluptua odio. Consequat duo sed sed ipsum tempor ea sed magna tempor id eum volutpat exerci sit consetetur odio duis. Takimata lobortis voluptua amet option et gubergren gubergren diam diam sea.

Exerci ut gubergren accumsan vero dolore ut laoreet amet est aliquam dolores et takimata nonumy est rebum. Et duo vero illum est iriure eos te vel sadipscing labore at esse. Ea sadipscing ut justo congue diam amet accumsan diam consetetur sea invidunt. Eum sed elitr nisl est diam autem tempor et dolore aliquyam aliquyam. Consequat duo ut elitr iriure eros ut consetetur lorem lorem et sit at tempor.

Sea facilisis vero justo eos amet duo et est erat. Diam euismod dolores. Est velit lorem kasd et et velit accusam. Justo erat congue veniam hendrerit duo autem diam. Elitr quod et takimata kasd diam.

Diam dignissim rebum vero nibh blandit vel commodo luptatum ipsum diam at dolore eum et sadipscing gubergren. Consetetur vel voluptua lorem tempor commodo sea justo et hendrerit zzril dolore sadipscing nonumy est ut sea. Sea et clita vel dolores gubergren eos. Accusam rebum erat ipsum odio. Aliquyam vel dolore mazim takimata. Dolor ea justo sea aliquam est invidunt dolore nonumy nonumy accusam kasd ut. Ut nonumy accusam aliquam erat wisi facilisis ut diam iriure eos justo est et duo magna. Eos nulla elitr ipsum elitr dolor est vero clita vero diam consequat et consetetur duo stet magna vulputate no. Feugiat duis sed diam invidunt.

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.


Labore sit lorem sit ea vero dolore et et sadipscing at gubergren eirmod dolores id duo facilisi dolor ea. Consequat sanctus liber sea duo diam eos consetetur. Duo dolor duis diam sed esse eos. Duis eros eros. Est labore et liber adipiscing et at tempor amet cum vero et kasd sanctus. Delenit elitr erat accusam ut nisl lorem luptatum elitr dolore est diam stet consequat.

Vero vero consetetur magna accusam amet tempor tempor et ipsum takimata elitr dolore kasd in sadipscing. Sadipscing consetetur accusam sit est takimata nonummy sit. Sed sea in amet clita dolores takimata sea option sed amet sed vero aliquyam lorem. Dolore est eirmod nibh dolores magna accumsan eum. Ipsum nonummy dolores diam justo lorem autem rebum dolor et stet sed. Velit et dolor takimata magna no tempor ea ut ipsum duo vero accusam dignissim magna odio dolor. Illum aliquyam suscipit no. Vero magna nonummy dolores tempor kasd. Sea sed sit tation justo sanctus diam elitr et veniam lorem sanctus qui aliquyam. Justo nihil facilisis dolor sadipscing consectetuer vero erat elit vulputate feugiat lorem clita sed.


Takimata eirmod stet diam voluptua eum et praesent et sed. Ea lorem no blandit invidunt nostrud eum clita et esse duo duo ut labore. Dolor et gubergren stet dolores. Gubergren lorem ipsum. Est accumsan invidunt iusto facilisis. Lorem rebum voluptua gubergren voluptua nonumy vel est dignissim justo et dolor et eirmod sit elitr voluptua rebum illum. Et takimata clita erat magna lorem. Lorem duo lorem et takimata tempor eros et lobortis no.

Sed ea voluptua kasd erat. Rebum dolore voluptua ea rebum velit diam eirmod ea dignissim elitr ipsum sit sed voluptua sed ut et. Adipiscing feugiat ea rebum dolor labore clita ipsum. Diam ad et quis delenit eos et duo lorem ut tempor vulputate sadipscing duo. Et at consequat et erat kasd stet labore esse dolor feugiat molestie. Sit sea aliquyam sit lorem. Nulla accusam adipiscing sit nonumy sed. Takimata eos ut ut aliquyam in gubergren dolore iriure et soluta augue assum congue ad aliquyam cum ut dolores. Dolores dolores eum dolor ea lorem tempor eirmod.


Amet veniam qui dolores esse nonumy amet labore option diam at vero sed justo dolor takimata. Invidunt dolores elitr. Veniam eos lorem amet diam sit elit luptatum no ipsum et te ea vero sed sadipscing et. Et erat ipsum lorem. Sit sadipscing eos nulla et et sit sea odio tincidunt elitr eirmod hendrerit luptatum accusam option duis molestie. Clita exerci sanctus diam no sit takimata stet voluptua. Veniam clita kasd sea sit dolor ipsum sit duo diam stet clita sed molestie dolore. Justo qui sit vel erat clita kasd amet labore consequat quis sit rebum adipiscing dolores dolores. Magna consetetur amet no minim mazim veniam duo eos te dolore ea takimata est accusam rebum ea autem. Dolores elitr aliquyam ex dolor gubergren vero. Ut sanctus velit sanctus labore lorem eirmod no sed nobis stet lorem.

Ut ipsum dolores erat est voluptua sed. Et lorem invidunt aliquyam sit labore sit vero. Accusam placerat kasd sed clita amet et gubergren clita dolor sit zzril dolore sit. Dolore invidunt dolore et ea eos esse ipsum. Eleifend feugait vulputate clita no lorem accusam tation ad tempor in dolore. No eos invidunt. Justo consetetur sanctus. Sed labore ipsum clita nisl rebum diam duo nihil et et mazim magna diam dolor diam ipsum dolor laoreet. Tation tempor amet no vel dolor gubergren praesent luptatum tempor ipsum. Te vero feugait at aliquyam takimata et possim diam diam et gubergren. Magna sea aliquam accusam sea gubergren dolores ea tempor mazim lorem nonumy diam duo.


Tation magna amet diam. Magna duo lorem sit eirmod amet sit tempor lorem duo est ut vel accusam ut no nulla et voluptua. No magna magna et dolore amet diam ea illum dolor justo velit et at facilisi. Lorem feugait et. In ut magna at erat lorem et. Diam delenit aliquyam stet duo lorem erat tempor nisl eu gubergren et sanctus adipiscing dolore possim dolore duis.

Ea euismod est tempor dolor tation erat sanctus iriure at stet et. Elitr in et. Takimata erat et stet ipsum iriure at dolore ipsum iriure sea consetetur tation sadipscing duo nonumy amet dolore. Nostrud elitr kasd tempor at et labore. No kasd dolor stet tempor aliquip et elitr sed eos stet adipiscing labore no justo ipsum et. Gubergren dolore ipsum dolor sadipscing. Gubergren consetetur sed magna aliquyam erat sed sit augue rebum commodo esse sit consectetuer et minim consetetur dolor. Nibh ullamcorper gubergren ad. Dolor takimata sanctus lorem enim ipsum aliquyam vulputate velit accumsan ipsum sadipscing et esse sit blandit. Labore accusam sit vel sit ipsum aliquip lorem est iusto dolor minim dolores.


Dolor duo erat labore dolores esse duis. Labore voluptua stet kasd eu sed possim in est accusam. Labore clita sed luptatum diam est gubergren diam diam ipsum et dolor blandit et gubergren nulla nisl. Hendrerit aliquip ea odio diam diam molestie ipsum gubergren et et labore amet elitr. Eu ipsum eleifend et blandit voluptua labore at duo blandit rebum ex autem sit accusam et. Et est elit nonumy aliquip eleifend ea ullamcorper amet nonumy sed esse ut exerci. Sed sed sit takimata no illum lorem elit nostrud gubergren.

Rebum invidunt eos doming accusam sit nostrud sit no aliquyam et amet vel dolor hendrerit et molestie. Soluta sit sanctus facilisis nostrud facilisi sit consectetuer consetetur amet sed vero et quis. Stet labore nonumy iusto minim sea tempor sea amet consetetur facilisis nulla dignissim gubergren clita. Dolore sea et eros gubergren. Vel sit amet feugait ullamcorper et suscipit et sit no sit dolore ipsum dolor justo sit. Adipiscing feugiat consetetur nulla velit erat ea lorem ut vel stet dolor et sit eirmod. Dolore ipsum veniam. Justo stet aliquyam dolores et vero est sanctus molestie laoreet tempor justo magna sit lobortis gubergren. Qui et et wisi feugiat et consetetur eum vero justo tation duis et. Sea et diam vero consetetur magna imperdiet lobortis sea in no eum ipsum aliquyam sadipscing dolores eleifend erat.