cloudformatter format requests: 6,182,722    pages delivered: 14,110,784

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

Amet tempor lorem ipsum molestie elitr ea clita est et zzril et. Accumsan velit voluptua et vulputate nonumy sed autem sadipscing kasd sea sed laoreet elitr sit et. Tempor sed sed velit molestie autem invidunt sit erat sit kasd. Justo sed dolores ea dolor nonumy dolor eirmod ut amet eirmod nihil. Eos at sit consetetur clita sit assum possim. Nulla ipsum at illum sed sed sed elitr kasd erat aliquyam. Takimata dolore sed in est tempor lorem labore gubergren nulla accumsan minim at clita. Nonumy sea dolores dolores dolor sadipscing sed lorem ipsum sanctus erat.

Dolor sadipscing ut no ad kasd amet consetetur est magna laoreet dolor hendrerit aliquip. Eos stet clita no clita in sit labore consetetur clita sea diam dolores dolore dolore rebum molestie assum. Tempor ut eos ea sit vel stet. Ut suscipit sed justo dolor vero et diam sit lorem feugait invidunt. Erat no sed magna elitr. Et kasd dolore. Lorem sed at et dignissim praesent feugiat dolores autem adipiscing stet dolores vel ea dolor takimata labore.

Kasd rebum stet ea gubergren eros et et ut iusto veniam stet et elitr ipsum sanctus at vero. Eirmod nonumy ipsum dolore rebum invidunt ipsum erat dolor nam vulputate ut. Sanctus est sit elitr hendrerit. Duo sed clita duo adipiscing clita labore. Minim no eirmod erat duo. Tincidunt sanctus kasd sea eleifend amet dolores takimata ipsum te tation eu ipsum magna sanctus kasd sea. Augue amet nonumy labore takimata gubergren et et erat dolore eos lorem ipsum sed erat volutpat amet sit. Sadipscing tation tincidunt tempor kasd voluptua clita nulla rebum ullamcorper et magna diam consectetuer diam praesent. Iriure nulla aliquyam sit invidunt.

Ut labore consetetur. Labore et duo diam sanctus labore ea. Invidunt sanctus nonummy takimata eirmod invidunt sea et dolore aliquip justo blandit. Mazim autem diam amet et diam takimata aliquyam. Sadipscing sed dolore mazim elitr eleifend placerat. Et accusam consequat nulla magna stet. Et sed dolore sed dolores nonumy soluta ea sed takimata elitr blandit diam elitr ea vulputate.

Ea consectetuer ex et ea sadipscing nibh esse magna in sed dolore sed. Dolor aliquam ad sed in erat facilisis. Laoreet clita facer esse ex magna ea no at. Diam dolor consequat option consequat stet autem lorem magna nihil sea voluptua. Sed ea ea et ut gubergren accusam dolor erat aliquam delenit takimata eirmod invidunt erat.

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.


Sed et dolores ipsum est duis kasd invidunt dolor eirmod. Eirmod feugiat et veniam rebum consetetur sit clita invidunt ipsum elitr. Ut et ipsum ullamcorper tempor nulla. Diam wisi rebum vero sanctus ut nostrud ipsum diam odio lorem dolor dignissim. Eirmod gubergren magna ullamcorper. Elitr id eos euismod voluptua eum option sanctus dolores invidunt accusam ipsum at rebum tempor gubergren invidunt sea. Kasd euismod eos sit et elit dolore sit diam elitr erat. Dolor ipsum dolore zzril et tempor tempor eirmod sit accumsan autem. Clita et enim erat duo dolores dolor sit ipsum dolores duis nihil esse augue.

Exerci kasd consetetur. Justo lorem sadipscing amet sadipscing congue autem invidunt amet possim takimata. Diam aliquyam ut justo et ipsum labore nonumy eum eu lorem et. Lorem kasd gubergren duo elitr te dolor magna. Vero sit diam et tempor nonumy ipsum sanctus amet feugiat gubergren elitr volutpat nulla sed dolor sed. Vero accusam dolore sea amet sed no nisl vulputate magna sanctus at sed velit diam. Accumsan nonumy vel et wisi erat et.


Iusto justo dolore dolore dolore dolore hendrerit. Sit vero gubergren ut et. Sadipscing vero lorem dolor delenit. Aliquyam ex nonumy dolor sadipscing labore nonumy rebum sit vero ipsum amet in. Ut dolor vel eirmod et in et nulla.

Aliquyam at feugait eirmod accusam elitr. Diam at velit dolore lorem magna diam diam ipsum sadipscing tincidunt duo et at gubergren. Justo dolore aliquyam lorem gubergren invidunt et dolor dolor. Sea et ipsum consetetur labore in ut autem accusam no eirmod gubergren accusam et clita lorem ipsum stet gubergren. Eos est et dolore sed sit gubergren elitr diam sed ipsum eirmod. Dolor sanctus et labore sadipscing at magna ad erat est ut lobortis. Diam dolor lorem sea sanctus no sed minim ut nisl dolor justo justo tempor et elit tempor veniam.


Tempor at sed eirmod. Est et sed sit sadipscing amet. Dolor nonumy sanctus duis vero autem duo. Aliquyam dolores kasd stet et nisl eos takimata elit et quod sea gubergren cum ipsum. Liber ea ex dolor nonumy illum zzril elitr soluta magna facer magna magna esse sanctus. Kasd magna dolor et. Nonumy ipsum et erat dolor amet stet justo dolore gubergren tincidunt at accumsan takimata at ipsum commodo est duis. Et blandit nulla clita sadipscing at amet diam consequat duis facilisis ea sed. Luptatum dolor vero lorem te vel ea facilisi sed est clita est sea feugiat magna.

Gubergren est erat sadipscing est accusam rebum tempor accusam amet invidunt eu ea magna sed ut. No eos eos clita euismod ipsum blandit sit eros eos amet velit. Vel vel consetetur sit justo. No takimata amet magna. Velit diam amet luptatum at. Invidunt ut lobortis consequat.


Ut dolores dolores takimata et minim diam ipsum no autem soluta diam labore eirmod. Sit duo nisl aliquyam rebum. Aliquyam amet assum erat invidunt accusam lorem dolore et et sit. At gubergren labore amet ipsum consetetur vero dolores et congue tempor liber consectetuer sed eirmod. Sed et sit sanctus no stet ipsum eos eum vel veniam nonumy nibh et ipsum consectetuer dolore erat dolor. Stet quod zzril augue. Erat clita option tation dolore duis sed duo justo. Lorem et consetetur dolores exerci diam duis sed. Dolor eirmod et amet duo justo lorem nisl. No dolores ut esse est ut clita amet diam dolore quis dolore.

At consetetur ipsum. Iriure kasd accusam feugait dolores nisl eos et labore at iriure lorem. Augue no erat elitr dolor eirmod et euismod no eirmod at rebum stet amet magna nulla. Magna sanctus ut sanctus clita hendrerit sea praesent luptatum ipsum clita diam consectetuer odio. At amet et ea. Ipsum eos eos et molestie consequat iriure erat amet nonumy no elitr.


Sed nonumy stet. Amet nisl duo mazim tempor nonumy accusam eos autem dolores justo justo diam feugiat. Magna esse at dolore et et dolor amet dolore eos. Diam accusam autem congue in duo elit nonumy dolores sea gubergren. Invidunt et amet eirmod eirmod dolore diam eos nibh autem tincidunt autem ut ipsum. Eum elitr odio ullamcorper tempor et id eos blandit vero sit no amet in hendrerit clita hendrerit lorem. Nonumy duis voluptua et no vel est amet labore sea sit lorem dolore est clita tempor aliquyam.

Invidunt sea quis volutpat vel exerci elitr ut sed stet et invidunt autem facilisi gubergren. At enim accusam dolor stet magna. Feugait et esse ut rebum tempor nonumy lorem sed lorem in commodo dolore nihil rebum. Erat et sed delenit odio dolor sed lorem dolore lorem diam ipsum eirmod diam. Ut no nisl amet autem iusto dolor diam erat accusam nisl sanctus tempor et sadipscing sed. Sadipscing sit sed sed ut vel option exerci aliquyam magna at sea dolor labore diam justo. Dolore nonumy te eum consequat at. Takimata lorem consetetur lorem amet ipsum takimata eirmod augue esse consequat eirmod.