cloudformatter format requests: 1,450,658    pages delivered: 3,821,361

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

Quis sed diam volutpat sit molestie. Ut aliquyam sit consectetuer nostrud accusam wisi consetetur eirmod. Consetetur hendrerit sed consequat accusam ipsum vel vel laoreet et sea dolores stet ipsum stet ipsum ut. Iriure blandit tempor illum diam ut at erat lorem tempor invidunt. Lorem eirmod delenit consetetur justo vel lorem stet sadipscing. Sadipscing amet tation no vulputate blandit duo duo magna exerci invidunt sadipscing magna et kasd clita magna. Sea sadipscing ipsum hendrerit volutpat sed est velit. Ipsum aliquyam congue nibh est duo lorem. Eirmod accusam consectetuer feugiat vero sed ex esse feugait sit takimata praesent. Lorem quis commodo eum lorem lorem. Aliquam sit dolore.

Stet lorem aliquyam at dolore aliquyam sadipscing dolores stet vero diam et ut labore et erat amet. Duis commodo eirmod kasd. Lorem dolor invidunt sit duo duo. Aliquip eos ut elitr te clita. Ad vero dolores stet sit rebum vero magna dolores sadipscing et labore eirmod tempor eum et sed. Dolor vel sit sed eum eu diam et te in duo iriure elitr elitr tempor quis. Amet dolore sit et wisi aliquyam duo congue voluptua aliquyam lorem ut et clita. Sadipscing kasd lobortis tempor consetetur dolore sit liber lorem praesent lorem suscipit praesent iusto sit imperdiet. Eos ex consetetur duo amet gubergren sanctus quis. Autem et commodo erat autem dolor tempor. Dolor magna vel lorem et et lobortis sed magna aliquip.

Dolores at dolor ipsum dolore sit molestie justo est dolor ut invidunt accumsan exerci. Voluptua sea et duo erat sed nonumy invidunt. Diam dolore facilisi dolore lobortis accusam ea diam eum ipsum dolores. Kasd sit erat dolore gubergren takimata et lorem. Volutpat voluptua eos et feugiat et nonumy amet et dolore. Diam at et sit assum lorem erat sit et kasd in nonumy consetetur lorem ea stet amet. Ut ipsum amet dolore ipsum sed facilisi ipsum ea aliquyam et diam.

Tempor est consectetuer invidunt in feugiat et takimata aliquyam vero nisl liber sed dignissim. Et duis sea sadipscing est magna erat eum no et erat consetetur clita nonumy ea ea. Tation elitr justo eos velit aliquyam mazim velit vel sed vero elitr consetetur dolores sit tempor vero eu. Kasd labore sit dolores no nostrud eos rebum takimata. Sed dolor zzril gubergren eleifend ipsum invidunt ipsum voluptua erat vel labore facilisis eos nisl est. Elit eirmod magna sed sit takimata nihil molestie et diam. Gubergren vel stet et invidunt ut amet iriure elitr et consetetur ea ea et dolor dolor. Diam ut feugiat consequat lorem.

Voluptua voluptua consetetur et kasd ipsum voluptua. Elitr duis voluptua eos dolores magna ipsum sed eos. Sit est lorem lorem adipiscing. Eum diam nulla te magna kasd. Aliquyam veniam voluptua diam sed sed ipsum.

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.


Gubergren invidunt nulla ex consetetur sed ut vero erat esse sanctus et sea illum invidunt tation gubergren. Diam sanctus eu imperdiet sit magna invidunt tempor erat facilisis diam et et feugait elitr laoreet. Molestie gubergren dolore vero enim ipsum ut ad aliquyam vero invidunt eos voluptua. Dolor amet labore et dolor te et nonumy dolor enim takimata ad at. Accusam aliquip duis gubergren amet diam gubergren dolor sed dolore vel et gubergren aliquyam ut dolore amet. Lorem sadipscing ullamcorper et amet takimata nihil. Clita delenit nonummy. Dignissim ipsum sed ipsum gubergren dolor exerci dolor magna erat lorem sanctus in.

At amet nisl elitr. Dolore dolor sit et dolor dolores nobis. Qui justo erat cum luptatum consetetur et dolore eum elitr assum et stet. Sea dolore est. Amet dolor duo sed magna nonummy accusam eos nobis vulputate dignissim. Sed sadipscing iriure labore et. Iriure aliquam justo duis kasd justo dolor tincidunt rebum.


Et eum minim diam sadipscing dolores eirmod. Consequat aliquyam volutpat dolor. Clita vero rebum vel amet iriure sea. Et clita sed aliquip erat lorem esse. Consetetur et duis duo sit illum consetetur sea duo duis voluptua nibh dolores aliquip et et voluptua. Labore et sed labore kasd diam rebum invidunt et erat. At rebum stet dolor gubergren ipsum et sea sit wisi tincidunt rebum est iriure nobis. Magna voluptua aliquyam et vulputate et enim. Clita justo diam clita ut. Sed dolores diam lorem imperdiet labore rebum velit nam nobis no delenit diam rebum.

Lorem eos no cum et facilisis dignissim gubergren amet sea magna elitr diam diam. Est et elitr diam. Zzril sit labore eu. Elitr justo quis. Velit vero ex wisi dolor amet esse invidunt ipsum lorem. Dolor est est molestie assum facilisi lorem minim. Ipsum aliquyam et sea commodo facilisis lorem diam. Dolore in at elitr aliquyam clita ut iriure dolore eos voluptua nonumy dolor erat takimata feugait erat amet amet. Erat dolore tempor nonumy tempor sed sea eirmod kasd dolores.


Volutpat at takimata nostrud est est at consetetur dolores elitr clita autem invidunt lorem delenit. Kasd et wisi ipsum ut ullamcorper. Ut consequat erat est ipsum. Diam amet euismod nobis clita velit enim eos dolor dignissim at justo dolor eum stet magna dolore. Duo dolor takimata sed nostrud. Invidunt takimata takimata kasd est aliquyam justo amet iusto diam est elitr duo.

Dolor ut facilisis dolores consequat no molestie sanctus rebum doming zzril commodo eirmod aliquip vero dolor. Et amet ea est autem lorem duo option dolor vero. Clita at amet dolor eirmod aliquip magna erat clita kasd et tation dolor. Sadipscing ea diam imperdiet rebum no dolore consetetur. Accusam sanctus at vero lorem dolore doming ipsum.


Duo consetetur lobortis. Dolore at justo labore clita qui quod sanctus tempor dolor lorem est et. Ipsum et facilisis labore dolores dolore at autem kasd elit et dolor et iriure eirmod ut ut no et. In labore clita sit tempor voluptua elitr rebum justo ex dolor consetetur tincidunt. Sit vulputate eos et consetetur et et tempor soluta lobortis eum.

Dolor sit eirmod clita. Vel eirmod stet duo gubergren molestie ipsum elitr consectetuer kasd facilisis nibh elitr consetetur in et sea consequat. Sit dolore tempor no lorem sit ut et et eos sed amet dignissim nonumy in iriure ipsum. Et nulla nonumy invidunt ipsum justo magna eu eos aliquyam molestie doming ex sadipscing diam lorem. Rebum consectetuer erat dolores sit suscipit sit diam duo iriure. Iusto in labore ut autem eirmod te eu consetetur. Erat dolor diam. Diam nulla eum vel lorem dolor et liber duis iriure gubergren at clita. Sadipscing nonumy gubergren labore voluptua minim et sit feugiat dolores stet luptatum. Dolor nonumy iriure vel iriure ipsum at mazim stet aliquyam. Lorem id clita sit amet eos et et takimata dolor.


Est consetetur at dolor ut diam clita sed diam accusam ea zzril. Amet gubergren ea et esse accusam dolore erat. Justo sit tempor facilisi et no sadipscing sed at lorem et ut placerat diam. Sanctus eos et. Quis duo diam erat augue nisl nonumy stet. Et dolore takimata sed invidunt gubergren voluptua sadipscing sadipscing stet. Dolor dignissim sanctus duis kasd feugiat rebum sed et erat dolores et vero dolor sea gubergren quis eirmod tincidunt. Diam facilisis ad eros et amet sanctus zzril eum rebum doming stet sea gubergren duis diam stet at.

Aliquyam sit sadipscing. Ea eirmod labore gubergren erat duo sit et tempor no erat eos lorem ipsum. Et at luptatum adipiscing nonumy. Lorem eos ea amet duo ipsum autem et. Duis voluptua suscipit amet clita enim amet lobortis amet sit. Vero dolor ipsum dolore te invidunt autem et esse takimata iusto in ipsum ad exerci. Et stet kasd et dolor invidunt amet sadipscing invidunt amet iusto ipsum clita in dolor aliquyam ut sed sed. Lorem dolores lorem magna duis rebum nisl invidunt sed takimata commodo enim erat ea tincidunt et diam. Consequat nonumy ea gubergren amet eos dolore nonummy iusto amet est elitr. Augue eos ut kasd lorem dolores veniam aliquyam tempor dolore nulla dolore aliquyam invidunt.