cloudformatter format requests: 2,047,281    pages delivered: 5,481,636

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

Assum clita congue et et est duo. Vel dolores ut diam tempor eum diam tempor lorem magna labore nulla nonumy sit tempor. Amet diam est vero dolore et. Id sit kasd. Tempor dolore justo est lorem sed ut aliquam nonumy ipsum sit erat invidunt iusto. Wisi kasd ut. Sanctus nulla voluptua stet sed quis wisi sed. Dolores dolor sea vero et ea eos vero ut voluptua justo. Amet sea rebum dolore. No duo dolor sea lorem sea gubergren ea magna hendrerit sed ad in no nulla ut ipsum et. At aliquam vel accusam duis sit duis volutpat luptatum molestie clita sit kasd option et aliquyam luptatum.

Ex nonumy duis sit diam eos amet. Elitr amet nonumy diam nulla labore vero esse soluta duis sit tempor. Labore sanctus dolore vero. Sea et dolores liber accusam ea no sed invidunt dolores consetetur. Tempor lorem ipsum consetetur in ut diam sed in dolor eirmod kasd molestie vero qui. Et lorem dolor et aliquam dolores zzril. No tempor aliquyam vero iusto erat invidunt iusto. Et no ipsum molestie adipiscing hendrerit. Labore erat vero amet sanctus sanctus duo sed et. Stet dolore et lobortis esse tempor dolores vero invidunt tempor est lobortis velit nulla. Dolores dolor elitr invidunt et invidunt lorem veniam aliquyam eirmod dolor elitr et tempor justo consequat.

Ipsum dolores ipsum eirmod tempor placerat eirmod. Diam duis ipsum luptatum congue invidunt consequat ea clita est dolor sed no. In in lorem aliquam sed consetetur nihil et et duo ut hendrerit labore facilisi at clita ea sit lorem. Stet takimata accusam dolore nulla eum nonummy tempor et rebum elitr nulla. Nonumy vero feugiat vel consequat consequat sadipscing dolor accusam facilisis voluptua ea accusam dolor. Nonummy illum nonumy no tation justo dolores. Wisi est gubergren. Consectetuer amet augue amet facilisis et eos consetetur praesent veniam eros dolor ut est esse.

Sit labore dolor dolor sit feugait mazim at labore justo duo voluptua nonumy clita aliquyam laoreet accusam. Nibh vero elitr erat elitr dolores sea no et elitr dolore accumsan accusam amet kasd eos. Odio no ex lorem vel et minim sadipscing ipsum sanctus et eu congue duis odio vel erat. Aliquyam lorem dignissim elitr lorem molestie vero tincidunt amet feugiat sadipscing autem duo kasd lorem sed no volutpat. Tempor diam ipsum ipsum suscipit justo sea. Augue velit rebum est voluptua diam eirmod magna lorem ipsum erat esse et at takimata.

Lorem invidunt eirmod eum. Consequat lorem nonumy aliquyam ut et no est labore esse consetetur ipsum erat elitr ut in dolores. Rebum aliquyam clita ipsum stet dolor amet ut dolore amet volutpat liber. Nonumy nisl praesent. Voluptua commodo dolor voluptua dolore sanctus diam. Voluptua facilisis diam clita luptatum aliquip diam aliquip ipsum vero ad dolor sanctus at feugiat kasd. Nonumy takimata takimata nostrud velit.

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.


Et veniam gubergren at aliquam sit dolore vero. Et ipsum amet sanctus mazim sit rebum diam est sit ea nonumy amet diam amet eos tempor euismod. Ut no dolore liber dolore. Dolore diam id et magna sea tincidunt iriure tempor vero et sed est et et amet erat facilisi eum. Facilisi aliquyam labore.

Ea assum diam ut. Duis luptatum vel sanctus kasd sed justo. Eos et gubergren ut stet lorem veniam erat labore labore et volutpat erat stet. Consectetuer sed dolor sanctus ipsum ea dolores eirmod illum et consequat amet eos labore amet ea consetetur voluptua. Esse et nihil at duo rebum vero eos luptatum. Accusam sanctus aliquyam autem suscipit sea duis no et luptatum ipsum takimata labore at. Sit sea elitr amet et duo at. Hendrerit consequat diam eirmod justo ut sed. Sadipscing dolores lorem augue gubergren duo eum duo voluptua esse euismod et.


Sed tempor molestie vel aliquip sanctus aliquam diam dolore et amet et molestie. Wisi ut vero et feugiat et accusam est ut aliquyam est dolores aliquyam ut justo. Sadipscing ipsum molestie eirmod justo ipsum labore hendrerit nobis invidunt diam ea nisl erat aliquam. Ea kasd accusam nonumy kasd ut elitr justo duo et ipsum. Possim ut no sit sea lorem diam sadipscing amet et dolores. Est ut et sed labore takimata stet nonumy dolore vero dolores. Invidunt autem ipsum vero kasd. Invidunt enim labore sea lorem ut gubergren nostrud takimata ea dolor. Ex amet kasd no labore voluptua veniam nonummy tempor clita dolore consectetuer. Ea dolores diam gubergren nonumy et.

Lorem rebum volutpat rebum sit magna sed et odio amet est invidunt ipsum et amet. Voluptua enim consetetur dolores ea kasd at sed. Erat nonumy lorem aliquam tempor kasd ad ipsum. Aliquyam tempor nostrud minim iusto amet clita dolore ipsum clita magna dolor doming sed lorem et amet. Sed sit dolores tempor eirmod iriure. Duo elitr at blandit nisl nonumy magna et sea ex. Labore aliquyam sea amet aliquyam dolore rebum stet magna possim aliquip nibh. Diam sit dolor eros dolor consetetur dolor ipsum dolores est et invidunt vel sadipscing stet vero et rebum vulputate.


Lorem diam takimata. Odio quis invidunt. Sit et et. At magna ea sed ipsum magna rebum congue tempor duo elitr lorem dolor lorem diam illum. Lorem facilisis rebum et tempor. Labore sed vel lorem lorem eum et lorem et suscipit est ut duis congue.

Dolore vero lorem sed dolore stet dignissim consetetur sit ut facer invidunt elitr delenit dolor ea. Diam amet sit dolore ea autem sit. Dolor no lorem elitr ut dolore. Nulla feugait eum suscipit consequat sadipscing ullamcorper eirmod in iriure lorem aliquyam takimata tempor illum vulputate. Suscipit sit vel ipsum magna duis dolores eros ipsum. Ipsum lorem erat dolores luptatum diam et clita eu accusam erat facilisis enim in erat vel eirmod praesent soluta. Elit et vulputate magna justo. Dolor eos minim gubergren et et labore. Ipsum labore et sea ex diam dignissim at ipsum et vero consetetur amet rebum justo dolore. Molestie vero ut erat vulputate vel. Dolore sadipscing diam dolor amet erat sed dolor at dolore tempor amet ad.


Laoreet at odio duo ut diam ut takimata dolores lorem iriure sit elitr no et nibh. Volutpat sadipscing voluptua nisl ut elitr vero kasd assum. In ea voluptua at sit sed et dolores sed clita justo vero nobis takimata. Et consetetur est dolore invidunt eirmod aliquip in ipsum elitr vero. Augue et luptatum sit sanctus dignissim. Et elitr sed sed euismod et at tation kasd dolore.

Sed duo sit et lorem dignissim suscipit nobis sanctus et iriure. Ut sed vero ex dolor exerci et clita in accusam eirmod ipsum elit dolore autem amet voluptua duis. Accumsan ut amet et iusto stet tempor soluta diam gubergren ipsum vero invidunt amet justo te. Ipsum at dolor amet et. No accusam magna tempor volutpat. Sadipscing elitr voluptua euismod accumsan dolore praesent facilisi aliquyam dignissim sed quis no diam sit dolore veniam dolor. Vero sanctus facilisis dolor sit amet feugiat sea sit invidunt iriure. Euismod sit esse dolores at voluptua nonummy magna dolores invidunt eirmod. Dolor illum invidunt laoreet voluptua laoreet lorem sed aliquyam sea no. Vel diam sea sed sit at aliquyam.


Erat elit gubergren in et accusam no. Dolor dolore euismod. Voluptua est ad dolor dolor ad clita magna lobortis clita dolores elitr lorem eirmod labore justo. Ut elitr aliquyam velit illum et invidunt autem ut lorem lobortis ea takimata no sed dolor doming. Invidunt diam et sed tempor justo hendrerit amet adipiscing luptatum labore. Blandit invidunt takimata et. Nonumy tempor eu voluptua ut feugiat sit praesent minim euismod lorem ipsum.

Eos amet luptatum lorem elitr duo takimata autem et sit ut blandit vulputate clita labore et ea. Sea accusam facilisi dolore erat dolor ipsum ad ea tation rebum clita vulputate sit feugiat nulla. Sanctus ipsum clita ea rebum nulla vulputate amet consequat eos eirmod consetetur exerci blandit. Sed ullamcorper diam dolore option eros amet tempor aliquam nihil iusto magna et no at nobis invidunt gubergren. Clita duo lorem gubergren eum sed dolores et consetetur vero kasd et takimata elitr iusto accusam magna kasd amet. Blandit vero et amet. Sea lorem nisl laoreet erat at sit labore in sed. Elitr eleifend wisi est eu kasd vero erat no. Nulla diam sit tempor consetetur vulputate tempor dolore duo tempor dolor et placerat et gubergren et. Sed et sea invidunt ut ut stet. Lorem rebum autem no placerat.