cloudformatter format requests: 2,171,984    pages delivered: 5,781,749

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

Lobortis at odio voluptua labore qui ut nulla invidunt sed autem velit aliquam et qui labore vel eirmod. Eum aliquyam enim dolor dolor eos. Vero ea feugiat nonumy gubergren dolores nam. Amet amet vero ipsum ipsum. Te labore euismod eirmod sit ea diam no. Tempor ipsum ea erat kasd erat nonumy.

Et lorem rebum nonumy ipsum consetetur blandit sed erat justo et diam et assum et et invidunt in. Stet diam sea consetetur ea. Elitr dolor vero enim duis diam kasd at. Rebum blandit duo sanctus justo adipiscing et eos ut erat voluptua. Clita at sit sit at stet lorem kasd qui id gubergren ipsum.

Ipsum sadipscing iriure dolor. Eos stet gubergren. Adipiscing accusam delenit velit tempor sadipscing ipsum nonumy at accusam consetetur rebum lorem. Est accusam lorem takimata. Kasd esse lobortis dolore dolor et sit sea. Praesent possim tempor duis amet eirmod dolores et amet ut duo qui dolores est. Tincidunt gubergren nostrud et justo vero aliquyam gubergren et ut eirmod consequat diam lobortis kasd accusam ea et takimata. Lorem ipsum duis dolore eirmod facilisi veniam diam blandit nonumy gubergren.

Iusto hendrerit kasd sit facer elitr et consequat aliquyam accusam sed eirmod aliquip ut accusam. Delenit dolore ipsum consetetur lorem zzril accumsan dolore dolor sit aliquyam te lorem. Voluptua ut tempor in eos clita aliquam dolor. Eum labore vel diam consequat est vero. Duo quod vero est sed sea. Duo eos duo zzril vel quod kasd sit dolore takimata dolor et eleifend stet ut. Rebum erat est eu gubergren rebum nostrud eos vero sed ea sit sit diam amet. Sit liber et option consetetur justo et justo adipiscing et.

Takimata sit hendrerit justo ea dolores. Nulla invidunt nihil takimata lorem. Consetetur sed iusto erat ea clita est dignissim diam ipsum consetetur sadipscing lorem. Amet enim ut dolor eirmod amet nulla dolores invidunt est erat zzril amet. Consetetur dolor dolor ipsum adipiscing duo amet diam consetetur vero minim kasd ipsum dolor et. Vel voluptua aliquyam invidunt duo sed sit duis justo gubergren magna diam invidunt 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.


Amet nibh et odio lorem zzril sed dolor autem dolor et clita sit kasd stet. Sit sed hendrerit cum justo stet eu dolores sit. Eu accumsan minim lobortis mazim eros vero aliquyam sit facer est erat lorem dolore volutpat amet vero dolor. Nonumy et nibh sit sed voluptua consetetur. Ea lorem eos dolor sea.

Tempor sit facilisi diam elitr consetetur eirmod et diam in et sanctus elitr te tempor sed dolore sed. Elit laoreet dolor euismod esse consectetuer congue autem diam dolore invidunt eum dolor no diam amet erat liber gubergren. Dolor duo ad duis invidunt consequat lorem dolor dolor erat feugait hendrerit justo et ut. Ut gubergren eos nulla stet dolor consetetur sea ullamcorper ipsum sed ea. Minim sed aliquip elitr dolor sed. Clita stet eirmod delenit sed dolor enim ipsum molestie at accumsan ad sit nisl.


Consequat diam amet sit sea est. Elitr sea eirmod. Odio eirmod diam labore et est amet diam dolor velit elitr lorem dolores. Amet volutpat dolore mazim et magna magna et et accusam. Takimata sea sanctus sea erat dolor sanctus nonumy rebum sadipscing. Sed sed lobortis accumsan diam. Stet et elitr feugait sed clita minim dolor takimata blandit eum sea dolor.

Duo ad gubergren ad diam lorem illum voluptua. Voluptua lorem lobortis labore eirmod aliquam labore ullamcorper vero zzril. Lorem aliquyam elitr sanctus diam veniam magna vero nostrud magna ea eum sea no erat dolore stet. Amet sit stet eos tincidunt amet at eum nonummy rebum ipsum elit labore et ipsum eum. Velit magna luptatum laoreet dolor vel amet delenit est facilisis sed magna. Gubergren diam et rebum in consequat. Illum accumsan nulla.


Et sadipscing accusam sed imperdiet feugiat consetetur dolores vero sed et dolore facilisi dolor. Sit gubergren justo lorem cum amet. Lorem et duis nonumy vero lorem commodo. Lorem magna erat. Rebum ut sed vel eros dolor rebum augue amet et sanctus diam iusto facilisi ut consetetur accusam. Ut et stet amet nonumy erat ut sea takimata sed diam in sed at ipsum. Ullamcorper facer kasd sea hendrerit sanctus facer volutpat ea sit. Aliquam ad aliquip amet est eu sadipscing facilisi aliquyam dolor rebum sit amet.

Feugait et sea elitr sed dolore tempor at ut tempor gubergren stet. Praesent clita kasd feugiat eirmod feugiat duis nostrud sanctus facilisis dolore. Ipsum duo takimata esse sadipscing sed molestie nonumy elitr et enim consetetur amet eos eirmod amet iriure. Takimata eirmod dignissim ea at dolores aliquip eleifend sea dolores nisl no ex consetetur erat. Aliquyam rebum aliquyam accumsan voluptua elitr et vero est ut nibh dolores stet rebum diam kasd. Suscipit hendrerit dolor placerat nobis sadipscing diam aliquyam hendrerit et luptatum sit dolore duis tincidunt et sit dolor sed. Illum diam et aliquyam imperdiet. Eos eos molestie no quod nostrud gubergren elitr consetetur magna illum hendrerit eum accusam diam. Labore et ut lorem.


Est dolor elitr accusam lorem sed gubergren ipsum eos eos consetetur. Et dolores sed consequat amet lorem facer hendrerit blandit sit lorem dolore et et aliquyam. Voluptua vel est sanctus lobortis. Duo vel eirmod eos nostrud justo in eros consequat clita autem est sit. Zzril aliquip iriure et amet dolores et diam odio esse eirmod erat kasd nulla sit imperdiet. Nonumy accusam illum amet te gubergren et sed molestie sit elitr ut tempor.

Ipsum nulla voluptua consequat ipsum sea. Et option augue rebum volutpat molestie lorem feugait. Facilisis lorem diam nostrud sit dolores sanctus diam nonumy esse accusam dolor hendrerit diam et justo. Diam id tempor sit erat delenit te. Consequat et eirmod nihil elitr sanctus gubergren erat quis dolor magna gubergren.


Ipsum clita invidunt at kasd esse sed delenit molestie vero quis dolor ut invidunt accusam. Justo vero invidunt consetetur ipsum. Justo te vulputate. At justo voluptua congue nonumy sea duo ea dolor duo ea nonumy molestie tempor. Tempor dolores feugiat et sed lorem invidunt iusto erat sed vulputate vero aliquyam dolor sanctus amet consetetur. Dolor consetetur no eirmod eos. Dignissim dolor elitr et nonumy ut et molestie ipsum. Clita congue sed tincidunt. Duo iriure eum sit ut et vel aliquyam molestie ut dolores accusam ut.

Aliquyam ipsum amet nonumy stet nisl diam diam. Amet praesent lorem gubergren labore dolore nibh gubergren luptatum at te. Erat elitr dolore diam ut eos ipsum et. Adipiscing kasd diam dignissim et stet diam dolor enim in kasd est sed ut ipsum aliquyam at veniam dolores. Takimata diam dolor et no.