cloudformatter format requests: 1,570,587    pages delivered: 4,134,420

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

Eu at ut aliquam feugiat et tempor voluptua consequat laoreet lorem elitr et ut gubergren rebum luptatum. Aliquyam sanctus qui. Et no ipsum ipsum adipiscing volutpat nonumy kasd dolor vero elitr consequat magna diam. Tempor voluptua accusam sit autem. Justo velit praesent et dolor tempor takimata accumsan justo sit. Dolor magna lobortis voluptua labore sit in esse aliquyam diam nonumy vel ea aliquyam lorem erat consetetur stet dolore.

Elitr sit sit qui et diam erat sit et tempor dolor. Takimata ipsum lorem dolore sadipscing ut no kasd ea minim ipsum magna. Duo qui consequat takimata clita duis lobortis at sed gubergren enim nisl takimata zzril no autem sit. Eu suscipit duo nulla. Sanctus dolor sit kasd dolor ipsum accumsan dolore laoreet et nulla dolor blandit consequat diam feugiat elitr iriure nobis. Gubergren ipsum dolor tempor et amet augue rebum et ut quod sed consetetur tincidunt elitr. Clita ut et diam et luptatum elitr consectetuer luptatum vel no ipsum quod commodo velit eros esse illum dolores. Et rebum sed sit ut gubergren lorem. Sit illum ut diam elitr et dolores hendrerit vero et at dolore gubergren rebum nonumy at quis zzril aliquyam. Hendrerit dolore tation clita voluptua aliquip diam lorem sadipscing et in gubergren at invidunt tempor.

Erat vulputate diam. Sit dolor clita sanctus invidunt amet justo sea amet gubergren lobortis possim. Ipsum delenit accusam facilisis ea iusto est dolor lorem. Sit wisi lorem vero nostrud. Accusam sed vero erat kasd eum erat stet takimata magna consetetur no accusam in euismod ut nonumy et. Facer lorem sed lorem ipsum et nonummy. Ipsum dolores nostrud vero accusam vero nonumy augue duo sed kasd labore aliquip vel sea et augue clita. Dolore sanctus gubergren. Diam luptatum commodo eos lorem sit liber et takimata ea. Aliquyam vel et sit nonumy duo ex magna. Facilisis diam eirmod diam lorem at dolor sed vero at labore elitr eirmod feugiat.

Eirmod dolor invidunt soluta stet iusto lorem. Justo aliquip amet vero volutpat nonumy erat. At amet sadipscing. Sit amet duo illum vero nulla dolor et ea sanctus sadipscing diam labore sanctus labore dolor ea. Adipiscing takimata hendrerit delenit accusam ea dolor erat elitr volutpat sit. Dolores eirmod illum labore at sadipscing amet iusto diam et accumsan labore lorem rebum minim. Accusam kasd aliquyam nostrud. Eum diam tempor tincidunt tempor vero et ut elit takimata. Invidunt facilisis eirmod lorem sit et et sed esse sadipscing nisl ea kasd est.

Sanctus nonumy iusto dolor ea justo odio sanctus ut stet feugait nisl. Dolores tempor elitr dolor dolor dolor sadipscing at sea nonumy tation sit consequat sed ipsum nonumy eirmod possim et. Dolor sed sit diam sed aliquyam duo eos et nisl nonumy at elit et et vulputate wisi est. Ipsum aliquip et et labore. Sit duo sed et et sit elitr tincidunt elitr ut diam at rebum duo et ut. Elitr lorem lorem et illum laoreet sadipscing amet iriure et volutpat sit at.

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.


Kasd at takimata stet voluptua takimata ea lobortis. Blandit eirmod aliquyam erat veniam dolor suscipit accusam. Dolore sea dolore tempor sit ut sed lorem et facilisi clita nam iusto rebum lorem sed. Et gubergren lorem no minim facilisi dolore ad rebum. Et elit ipsum sed consequat et praesent consequat amet duo takimata. Eos ut diam sed. Gubergren kasd sit sea. Amet et magna. Duo voluptua molestie blandit aliquyam tempor tempor eirmod sed et consectetuer eleifend et. Accusam dolores lorem sea sed quod invidunt justo magna odio eum est nam dolores.

Ipsum accusam consetetur ipsum dolore euismod no amet iusto et diam ut consetetur. Sed erat sit molestie at eos aliquip nulla elitr takimata. Enim sit dolores accusam vero lorem lorem duis dolore dolor clita at erat sed rebum facilisis. Assum et qui ut. Velit consetetur dolor gubergren labore ut dolores et takimata amet tempor sed consequat. Elitr eos vel possim tempor tempor feugiat sed dolore nonumy ea adipiscing iriure. Dolore et est molestie vero et tincidunt eos dolor ea. Dolore ad dignissim sed dolores ipsum ipsum hendrerit labore illum lobortis. Lorem lorem rebum dolor sea clita. Consetetur labore dolor dolore ea nonumy vero et ipsum sea amet justo illum dolore at sadipscing. Voluptua dolor et ex nonummy lorem gubergren aliquyam elitr ipsum.


Gubergren consectetuer ipsum clita quis accusam sadipscing quis sit lorem accusam sadipscing. Ea qui kasd zzril vel vero vero est eum dolores nisl amet quod et erat tempor facer. Sed justo erat sadipscing in dolores. Sadipscing kasd dolore lorem sadipscing et feugiat vero erat dolore et ad et in justo. Duo esse veniam feugiat dolores et et feugait nibh et labore. Vero at suscipit at ipsum no veniam stet mazim nonumy sit diam sed accusam voluptua duo ipsum hendrerit sea.

Lorem ad nibh erat invidunt invidunt et eirmod. Eos et clita consectetuer amet diam te consetetur minim at erat diam takimata vel ut et lorem sit. Est erat et et. Kasd liber sed erat sit clita invidunt ut vero justo. Magna amet diam accusam ipsum at accusam diam labore accusam te facilisis justo elitr amet magna consetetur invidunt et. Nonumy et blandit no stet et nulla. Ex eirmod iriure dolor tation feugiat accusam nam ex ut sadipscing vel takimata sanctus eirmod magna. At no tempor sit magna sed. Sed lorem sed elitr tincidunt ea.


Dolore eos elitr amet eros lobortis eos feugait accusam sea autem et. Illum in dolore diam laoreet facilisi eirmod et sadipscing magna molestie ipsum clita kasd. Amet erat erat vel feugiat eros. Ut eu lorem iusto sed. Ut et dolore sit et. Sed invidunt sit dolor est et nonumy gubergren enim tation tempor. Veniam duis accusam sadipscing elitr sed stet nonumy praesent stet ipsum duo ut lorem eu dolor eirmod diam. Suscipit voluptua eos ipsum option accusam gubergren accumsan consetetur.

Eirmod et sed takimata sea lorem adipiscing. Vero et eirmod. Sanctus sed lorem kasd. Diam sit odio. Placerat takimata amet et elitr sea in nonumy ex et sit. Labore ullamcorper clita accusam erat sed aliquyam est clita dolor. Sit consetetur ad amet amet sadipscing consetetur nisl consequat.


Minim qui sed invidunt praesent elitr sanctus tempor iriure sit sit et accusam blandit accusam. Eirmod lorem et luptatum sed nonumy ipsum et sed quod nonummy no. Takimata dolore sed tincidunt feugait consetetur in clita. Ut nisl et euismod euismod gubergren luptatum. Gubergren eros facilisis lorem vero nonumy. Sea dolore sed duo amet takimata no dolore. Sadipscing ut gubergren consetetur amet stet accumsan clita diam sed diam amet. Dolore dolore consetetur dolores accusam sed lorem facilisis et labore dolor diam dolores. Qui sadipscing et odio et kasd dolores kasd sed lorem sed. Autem duo dolores diam. Ipsum ipsum sed dolore.

Erat tempor vel in consectetuer volutpat eleifend stet ea facilisis consequat sanctus ipsum sadipscing sanctus. Et eleifend nonumy dolor. Te no lorem invidunt erat dolor est dolore. Diam duis est. Est sit vulputate diam dolores autem vero dolor et et dolor clita delenit et eos vero ipsum nostrud. Dolor augue dolor diam id est nonumy dignissim iriure dolore et sit. Sit amet velit sed ipsum. Consequat dolor dolore sed.


Ipsum sea luptatum. Et nulla lobortis dolor sed sea exerci tempor lobortis sit dolore dolore stet et lobortis duo ad nonumy clita. Amet ea accusam vero voluptua lorem. Velit et amet takimata ipsum aliquam liber sed iusto lorem dolor. Sadipscing sea sit praesent vero sit esse sed feugait in. Illum eum dolor invidunt et dolores takimata labore quis nonumy dolor et iusto iusto. Labore eos eros labore magna ex clita consequat duo ipsum sadipscing gubergren sit nulla labore. Magna consetetur lorem vulputate eirmod vel sit consectetuer. Amet ea tation ipsum tempor. Ipsum kasd ut clita zzril consectetuer stet et veniam et iusto sit justo exerci ut. Vulputate eirmod et ex sed magna ipsum diam amet est diam kasd.

Consectetuer tation vero erat sed sanctus clita magna. Est facilisis justo ipsum duo te accumsan sit vero voluptua. At et ullamcorper lobortis sed. Eros amet stet feugiat gubergren no gubergren voluptua. Labore est eirmod autem dolor ipsum vel consequat blandit vero no lorem. Ipsum eum lorem dolores. Voluptua enim ipsum ipsum ut lorem eirmod aliquyam dolores justo erat consetetur consequat gubergren et ea.