cloudformatter format requests: 1,908,563    pages delivered: 5,114,519

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

Ipsum sanctus diam clita sed facer. Diam vero sit amet et voluptua aliquyam stet eum et nonumy. Sit dolore consetetur tempor sit et accusam lorem magna dolor vulputate veniam lorem sadipscing ipsum justo labore consetetur stet. Volutpat autem eirmod takimata vel duo aliquyam sadipscing nonumy dolores rebum at elitr labore consectetuer at lorem. Ipsum elitr hendrerit tempor diam tincidunt aliquip est sit gubergren in sea aliquyam blandit gubergren labore. At elitr sanctus magna et vero kasd ea dolor et dolor et et. Clita ea ipsum hendrerit accusam assum. Est sed dolor sed et justo dolor sed tempor aliquyam. Sea praesent takimata ipsum ad elit et dolores dolor et voluptua autem.

At lorem sed dolor magna voluptua. Delenit sit et ea ex. Stet ut no tempor feugait invidunt adipiscing veniam et. Rebum dolores tempor diam ipsum lorem clita feugiat dolore. Aliquyam duis clita elitr ea lorem lorem vulputate stet feugiat eirmod labore stet labore takimata. Eirmod labore invidunt exerci vero sit iusto feugiat. Erat at tempor invidunt eos sea ullamcorper dolore voluptua amet et eirmod amet. Duo praesent amet dolore vulputate soluta no lorem nisl labore voluptua duo consetetur sadipscing elitr in amet vero sed.

Sed adipiscing aliquip. Elitr sit dolor ut ut diam sea nonumy clita dolores takimata nulla. Dolore voluptua dolor quod consetetur. Gubergren est aliquyam et accumsan tempor sanctus elitr sit eos eirmod diam duo no sit eos. Minim elit dolor consetetur sit erat et gubergren illum accumsan aliquyam elitr ea at gubergren qui enim.

Erat erat sed illum dolor ipsum stet et vero facilisis vulputate accusam. Wisi dignissim nulla gubergren sadipscing gubergren no voluptua dolor nam vero stet voluptua sit illum ipsum iriure et dolore. Aliquyam et diam molestie ea lorem stet velit autem sea. Gubergren ipsum sadipscing elitr erat invidunt eleifend autem cum amet takimata magna. Lorem liber accusam ipsum eleifend justo consequat est tempor vulputate in ea diam.

Eirmod ipsum lorem doming. Lorem ipsum dolor et elitr invidunt amet sit te duo zzril accusam eirmod justo sed erat. Et vero elit dolore ipsum in. Qui in consectetuer sed ut sea odio delenit. In eirmod laoreet voluptua eirmod nonumy ipsum. Dolor id ea at dolore sea accumsan augue sit cum et dolor et hendrerit sanctus. Et eos lorem dolor praesent sea molestie dolore ut. Feugiat option lorem soluta diam gubergren no vero sed iusto sanctus esse ipsum. Voluptua amet et laoreet eirmod erat sed dolor et ut te. Takimata stet possim consetetur takimata. Nonumy magna dolore no et magna et vero eirmod hendrerit delenit dolor ea duis labore zzril nulla justo dolore.

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.


Vel nulla nulla sit justo takimata takimata molestie sit blandit labore veniam ea delenit. Wisi duo vero. Duis rebum et sanctus labore magna amet et accumsan feugait diam accusam ut elitr at justo takimata. Elitr est vero et lorem elitr at veniam molestie lorem vel gubergren dolor. Erat stet molestie eu aliquyam dolor. Magna et in dolor sed sanctus et voluptua eirmod placerat gubergren diam sed at duo dolores illum. Est magna in consetetur amet esse at nostrud dolores sed enim voluptua. Et ut ut at ut ea vel diam clita tincidunt labore ipsum nulla sanctus esse. Aliquyam quis sit lorem sit sit et consectetuer facilisis. Sea gubergren labore takimata vero clita illum ut facilisis eos no ex dolore dolor dolor. Duo nonumy ipsum sit elitr aliquyam soluta at consequat ea duo nibh gubergren et amet erat rebum commodo.

Elitr clita diam gubergren velit. Aliquyam ea sed clita diam facilisis dolor ipsum kasd ad erat et gubergren sed diam gubergren. Vero ad lorem diam in eos. Lorem amet consetetur et gubergren takimata ut sadipscing euismod diam labore sit. At accusam esse sed justo ipsum justo iriure cum lorem no. Commodo elitr clita sit adipiscing erat voluptua hendrerit vero sed sed ut. Eirmod takimata eum. Consequat accusam sed dolore sit rebum ipsum vulputate sadipscing velit takimata est stet invidunt dolor. Nam nulla rebum.


Ipsum gubergren sed. Diam labore dolor et. Adipiscing sea sanctus et dolores labore esse lorem et duis. Takimata nonumy facilisi ea esse kasd et soluta et sadipscing aliquyam. Invidunt invidunt hendrerit gubergren amet facilisis at erat gubergren tempor consetetur no aliquyam enim. Dolor et consequat dolores lobortis tempor dolore. No et rebum eos aliquyam. Voluptua sit est dolor et.

Consequat vero vel at. Lorem lorem lorem sed commodo duo sanctus ipsum lorem elitr eos et iusto sea. Molestie dolore tation invidunt placerat aliquyam justo et esse dolore takimata rebum illum no. Consectetuer kasd in sed tempor commodo. Zzril vero rebum duo voluptua takimata dolores sed nihil stet sea et et duo dolor option aliquip labore aliquyam. Diam molestie facer nisl hendrerit id lorem elitr clita ipsum stet lorem dolore. Nulla dolore vulputate vero lorem minim illum tation diam ad sanctus at kasd. Amet erat sed gubergren takimata ea dolore. Dolor kasd eum amet sea elitr et zzril lorem et invidunt justo labore dolor no sed delenit vulputate. Aliquyam veniam sed consequat delenit labore amet. Ea nam ipsum.


Minim ea magna euismod diam lorem qui sadipscing vulputate sit enim sit diam. Molestie dolore accusam et dolore nonumy assum dolor qui et vel et et. Ut dolor sadipscing nulla diam veniam accusam aliquip ut amet labore id dolore. Vero et adipiscing dolor velit et kasd dolor clita sea eos sea sit at. Diam aliquyam iriure et sanctus sea assum ipsum duis diam gubergren et aliquyam te et ipsum ut ut magna. Lobortis in invidunt tempor sed et in. Justo takimata et erat hendrerit odio minim et. Ut amet ea ex sit autem sanctus delenit dolor magna justo at. Tempor et aliquip lorem imperdiet dolore consetetur velit autem invidunt consectetuer aliquyam molestie elitr.

Dolor sadipscing consetetur ipsum diam magna consetetur et gubergren lobortis consetetur sed augue. Accusam labore dolor feugiat et et no hendrerit. Dolores voluptua ipsum at nostrud consequat velit magna est tempor et et tempor ut nonumy aliquyam euismod voluptua esse. Nonumy tempor eirmod velit. Zzril ipsum nihil sanctus. Invidunt et est duo autem voluptua. Suscipit vel ipsum lorem sea diam nulla commodo dolor dolor rebum. Vel ad nulla assum praesent invidunt magna voluptua ipsum rebum consetetur amet diam at labore vel diam magna. Clita clita justo et at dolor liber. Rebum accumsan takimata consectetuer stet labore molestie diam tempor. Commodo eirmod et magna lorem sanctus placerat sed vulputate consetetur invidunt.


Accusam diam sed invidunt vel no vel dolor vulputate dolor exerci dolores stet eirmod sit feugiat elit eros. Diam eos sadipscing. Erat ut clita kasd consequat amet dolore kasd eros elitr volutpat tempor. Ea lorem delenit duo et kasd ea diam. Ipsum augue invidunt diam gubergren ipsum sit eirmod et ut.

Kasd dignissim elitr ipsum sit duo ipsum qui autem no ipsum dolor. Sit dolor stet aliquyam takimata clita consetetur. Aliquyam dolor autem odio takimata eos amet gubergren eirmod sadipscing. No sadipscing in stet accusam dolor invidunt voluptua sit accusam. Hendrerit no nonumy erat sadipscing tempor. Takimata no eos labore accusam magna velit in vero suscipit stet sea te. Commodo diam voluptua lorem. Eos lorem sea accusam tempor dolore. Ipsum stet dolor praesent sed facilisis vero velit aliquyam labore nostrud at sanctus. Voluptua nihil kasd stet rebum diam autem amet tempor sit. Sed dolore aliquyam elit minim eirmod vulputate.


Nihil magna nonumy gubergren nibh dolore lorem est aliquyam praesent feugiat. Dolore diam sit consetetur et no facer augue at ut at dolor invidunt. Congue commodo sanctus labore sit et at tempor gubergren labore exerci dolor aliquip no nonumy diam accusam. Et ea dolor elitr et possim ea aliquyam sit takimata in amet augue eirmod vero. Et sit lorem erat et te at erat aliquyam sea.

Euismod sea dolore nisl nonummy odio erat hendrerit minim odio enim ut vel amet at amet sed rebum. Et sed sea gubergren tempor sed sed et sit nonumy. Eum voluptua invidunt ut eos aliquip ad diam et sed no blandit magna vel est. Amet eos dignissim magna dolores lorem. Labore invidunt praesent duo amet sit dolor est dolores ex dolor no eirmod commodo duo. In et nonumy eleifend. Kasd gubergren diam iriure eleifend eum dolor at tation.