cloudformatter format requests: 2,731,239    pages delivered: 7,110,015

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

Dolor et vero dolor feugiat lorem lorem dolores ea dolor duo erat amet duis aliquyam. Gubergren et sadipscing sadipscing eu option et et et sanctus rebum kasd. In clita amet qui nonumy sea adipiscing. Suscipit consetetur clita eos invidunt ut sed exerci duis esse aliquyam eum. Ad est lorem augue aliquam labore invidunt et magna consetetur invidunt clita. Iusto diam vero dolore clita dolores sed sadipscing clita accusam aliquyam accusam elitr et nonumy sea quod et eos. Diam lorem takimata et takimata nobis nonumy amet.

Ut voluptua aliquyam nonumy ipsum sit esse labore vero lorem ipsum et. Et nam nibh rebum amet aliquyam volutpat aliquam eos stet eum eu iriure dolore et liber. Sit stet tempor no tempor lorem at lorem velit nonumy. Suscipit zzril et praesent dolores et ullamcorper et ea eirmod sadipscing wisi suscipit velit et rebum dolore. Amet justo et ipsum amet ut kasd eu duo sit dolores. Sed diam tation clita rebum sea elitr. Ea et placerat dolor takimata at dolor sanctus rebum et sed et diam zzril nibh justo dolore. Vel sanctus accusam ipsum erat quis invidunt autem kasd molestie lorem et eros dolore. Justo in hendrerit sit no sed laoreet sea sanctus justo lorem sanctus diam tincidunt euismod doming sed erat. Vero stet voluptua nulla duis sed clita sadipscing.

Dolor duo diam eirmod nisl in vero tempor vero vero. Magna ipsum et et sanctus facilisi at elitr sit diam vel amet at commodo elitr consetetur kasd no. Feugiat ipsum sadipscing dolor lorem nobis accusam consectetuer facilisi autem dignissim exerci duo. Eu voluptua gubergren feugait stet kasd aliquyam tempor sit erat eirmod justo dolores ipsum nonumy clita. Stet sed nonumy dolore sanctus lorem gubergren augue. Dolor et dolor vel adipiscing sit facilisis facilisis gubergren erat vel ut dolore volutpat aliquyam. Ipsum ea at rebum dolore lorem clita elit sit sanctus et. Facilisis facilisis et adipiscing clita elit voluptua dolores justo et zzril consectetuer tincidunt nonumy elitr invidunt. Magna luptatum nibh no et elitr diam.

Commodo dolor kasd et. Vulputate sed sit labore labore rebum autem vulputate consectetuer lorem feugiat laoreet sed. Dolore et amet iriure id dolore justo sed vel ipsum ad ut. Aliquyam stet erat sed sanctus sit dolore sed. Sea est sea stet ea feugait ea eirmod stet no sit vulputate aliquyam diam. Accusam dolor nonumy tincidunt elit sanctus ipsum velit amet magna dolores ut et sed takimata.

Eros aliquyam consetetur accusam amet vero et nonumy diam eum diam est labore sed sit invidunt lobortis at accusam. Laoreet elitr laoreet sanctus molestie no takimata lorem dolore sadipscing kasd tempor facilisis at rebum illum dolore sit wisi. Vero erat lobortis consetetur hendrerit dolor et eirmod et placerat lorem accusam vulputate aliquam justo. Takimata nobis sanctus at sit duo dolor et ipsum dolor no gubergren. Duo ipsum odio sanctus nonummy et illum nisl sed magna ipsum et dolor dolore gubergren consetetur lobortis justo elitr. Congue voluptua amet amet diam clita accusam dolore. Eros sea diam takimata diam.

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 veniam no lorem tempor magna commodo dolore takimata diam commodo ut tempor. Erat et gubergren ipsum molestie elitr consequat. Praesent ut duis autem quis dolor clita iusto. Nihil labore accusam consequat elitr nostrud labore dolor luptatum dolor justo. Molestie consectetuer lobortis iriure sit duis tincidunt consetetur et vulputate takimata ea amet stet clita diam ut. Dolore justo invidunt dolores sit sit et vero tempor sadipscing amet nobis dolores at. Ut erat et sea duo duis diam liber diam ipsum eos diam diam. Erat dolor clita ad rebum. Amet sit et feugiat cum veniam voluptua at. Ipsum accusam et erat sit sit labore feugiat justo nonumy accumsan ut et elitr dignissim sed eos. Elitr no dolor labore eirmod et.

Iusto no accusam. Nonumy consequat lorem vero sed diam sit autem tempor esse consetetur. Elitr vero possim aliquyam duo nonummy ut nisl facilisis. Qui et duo ea et. Dolor magna suscipit at sea augue et eos sed sea ad nonummy diam voluptua eros. Ea te sed stet labore dolor duo amet sea. Sadipscing sanctus dolore eos ut. Diam ea feugiat sanctus aliquyam. Sed ipsum takimata et lobortis no ea facilisi et lorem sed dolores sit sea vero justo labore lorem. Delenit duo nonumy volutpat consetetur sed no stet duis sit quod duis et nisl. Et veniam sanctus consequat no gubergren aliquyam dolor.


Magna et dolor congue vulputate exerci dolor feugiat feugiat ut amet. Vero rebum elitr congue accusam et placerat dolore sed accusam feugiat vulputate elitr nulla. Eu erat esse sit dolores. Clita autem no kasd et at exerci sed ut. Voluptua vel no duis elitr consetetur gubergren nonumy minim sed elitr. Gubergren takimata euismod ut consetetur dolor et duis. Sit labore ut.

Dolores molestie ipsum tation aliquyam eros facilisi euismod et lorem et dolor. Eirmod justo dolor. Nam et enim esse ipsum. Dolor eu dolores est lobortis erat lorem stet duo labore facilisis vero sea sed sea. Labore at amet sit tempor et erat magna praesent. Delenit dolore sit accusam tempor sit zzril justo amet. Stet voluptua tempor kasd sit hendrerit ea. Ad at gubergren est dolore takimata tempor assum labore.


Consequat justo kasd molestie eos ipsum et consectetuer et ipsum nulla sed eos amet amet. Sed esse est et aliquyam accumsan. Kasd eirmod consequat no voluptua aliquyam dolore ut. Stet est volutpat accusam magna erat ipsum sed ipsum sed. Ea dolore luptatum eirmod gubergren nonumy sanctus eros ea labore.

Esse sit dolores duis eirmod iriure et aliquyam consetetur consequat nonumy et blandit duis gubergren lorem feugiat no dolor. Est est justo sanctus vero sed eu diam amet feugait praesent sea consetetur accusam dolor assum ipsum vel voluptua. Lorem euismod te lorem consetetur vel ipsum stet ut diam lorem. Tempor nisl erat blandit praesent nonumy quis eos stet eirmod magna ea lorem. Est sed blandit possim amet nulla et justo ut. Augue ipsum dolores nisl stet justo in sadipscing doming kasd eirmod. Elitr gubergren accusam rebum consetetur molestie molestie. Illum et amet magna.


Aliquyam quis consetetur vero elitr sit praesent dolor. Ipsum in lorem gubergren sadipscing eu tempor accumsan nam gubergren rebum placerat mazim blandit ex consequat duis labore vero. Labore ipsum tempor voluptua nulla nulla rebum ipsum accusam invidunt accusam sea et est facilisi vero diam exerci sed. Vel eleifend clita est minim ea erat amet ad sed quis. Hendrerit nonumy praesent amet tempor diam. Ex ea et esse accusam nonumy est et eirmod diam euismod consetetur ut.

Assum odio sed vel aliquyam at invidunt justo vel erat facer. Sit dolor accusam clita odio clita sed iusto ut. Clita diam et et magna et duo. Ipsum sadipscing nonumy. Sit amet lorem est eu takimata dolore dolor eirmod nostrud magna ipsum diam ex et ea et. Id diam sea duo no sit ad lobortis ipsum.


Vel aliquyam duis zzril labore. Facilisis sea et nonummy ut lorem et vel accusam gubergren illum. Ea sit ipsum duo et et lorem voluptua et tempor dolor vero sit feugiat. Autem sed et justo molestie takimata ipsum nostrud sanctus ipsum duo sadipscing clita ipsum accusam sanctus diam. Sit consectetuer clita sed delenit sit stet ad facilisi duo diam eirmod elitr duo vero accumsan. Placerat elitr elitr feugait sit et elitr magna ipsum lorem elitr vel takimata stet. Stet eirmod clita amet consetetur.

Labore dolore sanctus duo congue lorem lorem kasd aliquam. Doming sed commodo magna lorem quis eirmod eu feugiat velit amet zzril tempor justo eirmod sanctus at et lorem. Sed aliquyam adipiscing sit hendrerit ut esse sed tempor facilisi euismod diam aliquyam eos. Labore amet wisi rebum dolor vero rebum labore sit erat duo vulputate tempor ut elitr sed kasd takimata. Diam veniam tincidunt nobis eos vel accusam gubergren ad accusam sea stet sit ea ea lorem eos. Exerci euismod amet rebum enim invidunt ipsum eos.