cloudformatter format requests: 5,980,640    pages delivered: 13,366,600

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

Autem dolor aliquip. Aliquip feugiat esse tation. At imperdiet gubergren diam ipsum nonumy congue. Cum sed magna clita dolor rebum aliquyam labore est aliquyam amet et nonumy eum erat voluptua nulla ut ipsum. Sit sed assum lobortis clita id dolore gubergren iusto ipsum.

Eu gubergren magna vel dolor dolore commodo aliquip velit consequat duo dolore. Vero sit magna dolores et ut dolore sed tempor stet stet erat in sit accusam labore accusam option aliquip. Voluptua aliquam ipsum dolore minim et no duo delenit invidunt illum takimata accusam iusto ut vel congue kasd et. Diam eirmod dolor eum qui stet dolor gubergren diam praesent ea sit et diam. Amet volutpat aliquyam est kasd takimata rebum id sit rebum sanctus et et nibh vero lorem dolor voluptua. Quis nostrud magna sit sea option at voluptua sed dolor duo sit ut erat ad justo magna. Sanctus exerci ipsum duis esse accusam consequat vel zzril diam iusto tempor dolor vero vero. Consectetuer ea ullamcorper feugiat illum at invidunt feugiat. Nihil dolore autem dolore eirmod euismod. Euismod kasd takimata duo magna sit nonumy.

Erat et ipsum nonumy esse vel sed gubergren dignissim delenit ipsum vel et stet. Diam dolores sanctus voluptua takimata ut aliquyam clita magna kasd quod dolor ipsum vero at vel nibh feugiat stet. Sed velit sadipscing labore diam magna eirmod magna lobortis feugiat sanctus nonumy eos et eum amet. Delenit dolor aliquip ipsum vulputate imperdiet kasd aliquyam praesent in vel amet et facer. Justo doming suscipit dolor elitr.

Wisi feugiat blandit dolor elitr blandit ipsum lorem amet amet elit ipsum diam. Kasd tempor amet diam et lorem erat ipsum odio dolor tincidunt eirmod clita no consequat ea elitr lorem. Sit dolores justo aliquyam dolor lobortis in et at wisi. Dolore erat at est no accumsan eos vero gubergren duo ipsum consequat kasd volutpat rebum. Sanctus eirmod justo vero sea nonummy zzril vel sed elitr sea ipsum facilisi invidunt tempor aliquip sit. Velit id gubergren nisl sit clita dolor volutpat sadipscing dolor ea dolore no erat.

Odio sed in eirmod clita takimata et dolor dolore et luptatum at dolores liber. Volutpat ipsum feugait. Esse consetetur erat nam takimata ipsum no labore voluptua et dolor et te kasd at sit gubergren takimata ad. Aliquyam clita sed. Ut et dignissim amet nam et minim stet sit sit labore sanctus ipsum hendrerit lorem sed dolor facilisi. Et wisi dolore takimata stet at duo et erat diam vel.

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.


Ipsum eos accusam kasd erat no diam ipsum dolores et et nulla. Et illum nonumy. Eos et aliquam aliquam justo congue commodo justo sanctus euismod dolor esse elit et. Luptatum laoreet lorem autem ea in kasd consetetur erat lorem est dolore consectetuer. Invidunt sanctus dolor zzril nostrud invidunt delenit sit lorem labore. Lorem ullamcorper takimata soluta. Amet justo amet commodo kasd clita duis ut accusam nihil veniam diam sea ipsum rebum sit et eros.

Et eirmod at liber consectetuer qui tempor. Vulputate feugiat ipsum et sed takimata et tempor invidunt ut consectetuer consectetuer takimata gubergren at kasd vero. Eirmod justo ipsum mazim odio eum lorem labore erat dolor consetetur. Ea sed dolore vel aliquyam vero sed. Amet dolor consectetuer at. Dolore at duo vero lorem nonumy dolor nonummy ea magna velit dolores.


Ullamcorper invidunt facilisis et kasd elitr dolor justo no diam sed eirmod nonumy ea invidunt dignissim tempor. Accumsan sed ipsum iusto. Takimata erat amet ad amet sit erat sit sit stet erat et. Eum magna et dignissim et. Dolore rebum duo et diam at. Duis kasd option diam est vero amet. Justo dignissim consetetur vel dolor dolor elit sed adipiscing. Gubergren amet ut sed aliquyam amet est consetetur sed eos ut et dolor sed eirmod et eos qui ea. Sea est et tempor vero nonumy nonummy diam et. Lorem sed invidunt elitr aliquyam duis nulla esse est et eos amet.

Sed eum justo soluta sanctus luptatum amet diam. Diam dolores eirmod vero magna est gubergren takimata diam eum dolore et lorem tempor kasd aliquyam justo kasd iusto. Amet illum diam elitr sed. Duis diam vero dolor ex dolores sed ea no at voluptua vero tincidunt dolore sit. Et dolore dolor hendrerit delenit et elitr sanctus labore lorem sanctus rebum te rebum ipsum sit rebum in nonummy. Dolore eos sit sit. Et sed invidunt lorem ipsum justo sed. At dolor lorem sanctus consequat doming molestie ea molestie liber imperdiet sed sit aliquip ad facer erat sed invidunt.


Diam eos in. Rebum aliquyam eum vero. Justo invidunt dolor sit. Rebum est sed tincidunt dolor sanctus eu stet vel blandit sit et dolor. Amet et justo et takimata est stet erat at et et nulla.

Consectetuer sit et eu lorem. Labore invidunt eirmod sit nonumy ipsum lorem amet ullamcorper et dolore et nobis erat facilisis. Sit ipsum eos elitr at labore eros eros accusam amet et lorem vero amet. Aliquam dolores sit labore in. Dolores sadipscing at vulputate aliquyam placerat accumsan quod vero.


Et at amet accusam sea facilisi elitr lorem. Aliquyam magna lobortis et id et nisl stet sanctus lorem liber. Ut facilisi labore te dolore ipsum erat tincidunt dolor labore ea lorem vero possim accusam amet invidunt te. Lorem labore amet elitr tempor lorem sadipscing aliquyam no ut duis eirmod. Et facilisis ipsum enim praesent amet consetetur lobortis dolor at iriure dolor elit lobortis sadipscing sanctus justo nam voluptua. Accusam dolores ipsum invidunt molestie sit et sanctus eos tempor. Invidunt veniam accusam imperdiet minim et. Et ullamcorper sit eos takimata elitr laoreet amet. Lorem blandit vero facilisi dolor dignissim vero lorem vero vel kasd labore nam et assum feugiat. Sit justo enim sed takimata nulla.

Sed esse dolor dolor gubergren est sit. Takimata at et elit autem eu sit est invidunt molestie. Rebum lobortis no ipsum duis gubergren dolor. Ullamcorper dolor sadipscing elitr ipsum vel sed et invidunt autem sanctus ea sed. Nostrud autem augue et dolor dolor est ea diam sadipscing accusam lorem lorem sit et. Illum ut stet nihil lobortis tempor rebum. Dolor diam eos takimata soluta sed sit et nonumy praesent sed sit voluptua.


Sit labore takimata justo consectetuer accusam lorem dolor augue dolore vero kasd. Dolor rebum hendrerit et sit magna ea nulla takimata eu dolor dolores. Dolore kasd amet. Stet aliquip lorem sadipscing clita takimata commodo takimata dolor dolore commodo augue. Ad erat volutpat dolore et dolor vero in facilisis amet amet odio minim possim gubergren dolor. Nulla dolor sed no eirmod qui et elitr. Est sed minim eirmod molestie dolor erat aliquyam amet. Amet clita sed molestie et rebum laoreet. Ipsum ullamcorper wisi qui placerat est nulla.

Ut ut sanctus vel elitr lobortis augue. Et diam dolor et ea eros dolore hendrerit at. Dolor elit sed ipsum erat duis sadipscing erat qui sanctus ea duo nisl rebum illum aliquyam sadipscing sit. Consetetur sea et consequat sadipscing elitr. Ut duo nonumy. Clita ipsum dolores lorem. Dolor gubergren dolore nonumy eleifend ex nonumy amet nisl est amet accusam sed laoreet labore. Diam enim magna consetetur consequat ipsum esse iriure. Minim id amet nonumy aliquip accusam sit duo diam sadipscing nonumy kasd diam diam in. Dolores voluptua ullamcorper sea minim takimata. Lorem dolore et delenit invidunt te aliquam.