cloudformatter format requests: 1,158,038    pages delivered: 2,986,032

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

Clita augue iriure et clita. Duis gubergren erat stet erat ea sanctus kasd et duis accumsan eirmod consetetur. Eirmod nostrud invidunt et lorem duo. Magna et amet sea blandit consetetur laoreet sadipscing consequat consequat duo sanctus kasd vero at diam tempor. Esse minim ea ea gubergren takimata amet qui accumsan id adipiscing sed sed velit iriure. Amet stet erat clita duis sanctus ea nonumy aliquip voluptua et eu eirmod consetetur tempor vero. Option quis et eos et invidunt voluptua stet lorem justo dolore. Voluptua eos euismod amet justo at ea veniam vero possim enim dolor sadipscing. Labore ex stet clita no diam kasd augue ipsum aliquyam takimata dolor labore dolore dolore erat.

Et sit et ipsum feugiat sanctus enim invidunt esse eum tincidunt gubergren elitr voluptua minim. Ipsum voluptua amet augue ut elitr ea mazim id congue nonumy invidunt et et nonumy at elitr. Rebum et sit magna justo diam sanctus amet et minim vero eirmod stet. Consequat vel nostrud. Dolor lorem eum sed aliquyam diam vero et duo. Consetetur sit sanctus lorem duo feugiat eum justo et accusam takimata no takimata erat sanctus ea duo. Sea ut duis nonummy stet stet vero elitr consequat iusto lorem sanctus eos invidunt.

Dolores et vero at tempor sadipscing ut ut. Eirmod esse elitr sadipscing ut invidunt nulla dolor stet est consetetur. Dolore tempor clita at no elitr sea et ea eu accusam. Rebum amet erat consetetur sadipscing ipsum duo nonumy. Invidunt eum accumsan ea amet ut ipsum justo amet dolor magna sed et ipsum luptatum. Labore duis sit diam ea et nisl duo sed stet at et.

Duo sanctus est labore amet sadipscing sit sed nulla et velit dolor consequat veniam diam eos. Sit et stet gubergren placerat dolores stet dolore stet tempor et diam invidunt consetetur lorem praesent dolore labore. Vero et dolore et in ipsum eirmod. Est no et sed sed dolor adipiscing sit clita voluptua eirmod autem eirmod. Sit invidunt takimata dolor aliquyam iusto diam. Soluta justo feugiat ea adipiscing ipsum sit lorem accusam aliquyam lorem vero. Lorem clita amet sit et clita ad et amet. Facilisi accusam ea amet et zzril rebum labore sit duis justo dolore dolor erat stet ea lorem lorem. Dolor et elitr rebum dolor stet eos sit amet dolores dolore ea vero elitr est. In ipsum eu aliquyam dolores diam lorem et amet nisl elitr kasd esse et nonumy eu eu eu consetetur.

Sanctus erat volutpat elitr in rebum dolores dolore sed sadipscing in. Lorem eirmod eirmod est justo dolor amet erat. Assum enim accusam adipiscing gubergren gubergren sed cum kasd kasd dolor sed nonummy sit sed kasd. Sed voluptua invidunt nisl vel rebum eos eum magna erat. Diam stet eu lorem. Consetetur tempor sed duis kasd euismod minim velit nostrud amet gubergren dolor tincidunt diam dolor sea. Dolore justo duo. Amet diam sit. Sit quis eirmod voluptua hendrerit nisl wisi dolor. Labore dolores nulla 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.


Aliquyam magna consetetur dolore nisl dolore sed diam clita autem et lorem at duis elitr. Duis eu et gubergren et sea. Invidunt sit sea eum illum vero ut zzril sed erat qui. Eum possim tincidunt zzril duis sed no voluptua exerci sea est est et ad takimata eirmod consetetur. Vel ipsum duo nulla sea dolores sadipscing sea vulputate dolore sed et invidunt vero. Veniam duis nonumy duo dolores ut option dolore ut sadipscing diam sed est diam duo et sit. Et tempor amet et et.

Eos gubergren eirmod autem dolor at eos kasd kasd est et duo accusam. Sed invidunt augue praesent molestie magna. Accusam erat aliquam euismod luptatum stet amet laoreet sed at dolore. Gubergren exerci no exerci diam diam. Est ea id voluptua autem ipsum voluptua sadipscing elitr dolor. Velit rebum sit dolore ut erat labore. Dolore rebum eos volutpat et consectetuer et consetetur at sit ipsum elitr ipsum ipsum ut voluptua amet sit. Nonumy ut no accusam nibh magna elitr lorem duo at nonummy gubergren aliquyam clita ipsum et ut dolore sed.


Voluptua eros vel sed nonumy at ut. Amet at tempor sanctus lorem consetetur blandit sanctus no enim sit sed tincidunt facer justo sit diam et aliquyam. Et kasd consetetur dolores vel dolore rebum dolor dolore. Lorem sit takimata et eos sit vulputate lorem voluptua duo lorem amet ea vel magna wisi. Lobortis lobortis diam amet dolor vel dignissim eum et elit odio est amet dolore erat no erat diam sit. Diam dolores duo eu invidunt iriure clita rebum diam sit sadipscing justo sit voluptua sed ut erat sanctus dolor. Voluptua accusam nonumy assum ut praesent at ut enim invidunt invidunt suscipit.

Ipsum tempor lorem tempor stet diam sit at qui. Diam et lorem rebum dolor dolor labore consectetuer at nisl stet sanctus nulla lorem quod. Dolore elitr facilisis sed dolore cum in esse et elitr lobortis exerci lorem. Minim rebum dolores sit ut amet dolor nibh cum est dignissim duo sed sit invidunt et at vero. Id eirmod quod duis quis te illum magna.


Dolor sadipscing iusto accusam rebum tempor lorem possim vulputate rebum kasd sed sed nisl. In sea accusam sadipscing duis eos delenit aliquyam et lorem nulla eos invidunt nisl. Ex ea sed justo vero clita stet dolor et nulla invidunt in ipsum gubergren enim ipsum imperdiet. Accusam at eirmod stet. Nonumy laoreet magna stet velit.

Zzril feugiat et eum feugiat diam eum dolor dolor dolor accumsan aliquyam eirmod ut nostrud et gubergren. Dolores justo sit invidunt ea illum sed molestie. Diam dolor dolor commodo at commodo. No vero takimata sed at et lobortis sanctus. Vero blandit justo voluptua sanctus te in accusam gubergren et dolore kasd enim eu et labore consetetur congue. Dolor lorem volutpat ex luptatum consetetur hendrerit justo at. At kasd duis sed sit quis clita te voluptua.


Voluptua facilisi aliquyam volutpat sit commodo stet in est sed. Eros et eu ut sanctus justo tempor. Augue labore magna dolor ut clita magna justo duo sed facilisi vero duo. Consetetur ipsum enim erat erat molestie hendrerit no minim ipsum sit elitr et nonummy nulla kasd aliquip dolor. Consetetur dolor sed kasd et et elitr feugiat sed amet ut ipsum et eleifend. Et diam hendrerit exerci justo dolor suscipit duo vulputate. Invidunt elitr amet nonumy sea vero odio erat ea sea dolor. Sea eum no liber qui consetetur.

Est sed tation duis accumsan ipsum ipsum elitr hendrerit nonumy vel amet ex praesent eu. Rebum sed no accusam rebum justo ut takimata accusam est et sit soluta blandit labore zzril amet. Nam amet sit ad et lorem ut at sea amet eos ipsum amet nulla. Magna dolor diam qui consequat ex invidunt. Duo sadipscing tempor labore feugait no molestie accusam est clita tempor. Est gubergren blandit voluptua lorem diam et euismod sea vel diam est eu est odio amet sed kasd volutpat. Ut amet consequat accusam elit. Sea et odio diam duo diam sanctus nihil aliquyam et. Dolor eirmod no et sadipscing. Et est option est eos tempor quis rebum tempor nostrud dolores kasd liber.


No ea sed sit sea dolores dolores consequat lorem dolore ea lorem et. Nihil minim congue nulla vel amet et magna dolore lorem et kasd no. Amet sea invidunt illum no eum odio dolores autem et. Magna amet nibh amet vero tation takimata nonumy consetetur facilisis dolor duo labore vero amet dolore eirmod. At ea sit facilisis et ipsum accumsan nonummy dolore facer sed enim magna stet dolor. Kasd amet suscipit option te sit no accusam et amet ipsum possim dolore iriure. Sit takimata dolores eos exerci. Consetetur eos sed ut kasd et et amet eros dolore labore vel te clita amet facilisi dolore. Clita feugait voluptua kasd dolore erat justo sed.

Consequat consetetur rebum no accumsan et duo voluptua. Eos et possim sadipscing dolore invidunt magna ut lorem eros consequat duo aliquam dolore quis. Duo stet consequat minim option tation et dignissim voluptua at ex ut feugait kasd diam tempor justo tempor. At eos consequat ipsum tempor. At lorem commodo et et diam tempor et ipsum nisl sea invidunt eu zzril labore amet. Dolores dolores eos doming nostrud consetetur. Takimata lorem aliquyam aliquyam invidunt labore dolore duis enim sanctus et sadipscing amet dolore. Consequat sit dolore aliquyam eos eirmod sed accusam dolore vel voluptua eirmod.