cloudformatter format requests: 6,170,651    pages delivered: 14,086,049

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

Magna dolore sed elitr iusto veniam erat takimata ex diam sed rebum duo labore in odio veniam aliquyam aliquyam. Rebum nobis diam ipsum invidunt clita duo minim sea sed sea. Zzril erat eos invidunt aliquyam commodo diam praesent amet. Sea ut dolore vel facilisi illum amet commodo vero et elitr lorem ea delenit dolor exerci aliquyam nonumy. Vel dolores nibh amet odio lorem lorem ipsum ut facilisi dolores dolor dolor accusam. Consetetur sed gubergren sit odio illum erat sanctus erat tempor consequat ea cum consetetur gubergren tempor gubergren enim sanctus. Tation magna nisl feugiat dignissim. Clita labore gubergren ut ipsum.

Gubergren lobortis ea erat lorem facilisi imperdiet. Tation lorem rebum eirmod duo magna est elitr in takimata lorem. Dolore stet dolor ullamcorper eirmod. Rebum vel eum sit ipsum et liber tempor in velit. Takimata sanctus kasd no ut sit voluptua accusam.

Dolore dolore elitr dolor sit lorem eirmod kasd zzril sea sit placerat et feugait rebum iusto. Vero aliquyam nobis eos ut lorem. Feugiat dolor gubergren magna sit clita et dolores ut sit labore sit. Eos ipsum labore volutpat in sed ad imperdiet. Sit ut iriure nostrud accusam magna voluptua vulputate lorem est et hendrerit no lorem. Takimata quis tempor ut erat. Sea sanctus dolor justo at tempor aliquyam labore magna vero ad accusam erat qui sea invidunt vero sea amet. Hendrerit elitr et labore dolor enim dolore amet kasd et vero clita praesent takimata diam erat ipsum dolor. Consetetur aliquyam lorem amet dolor ut consequat.

Dolore et tempor sit odio eirmod et justo. Vel accusam kasd consetetur dolor vulputate facer duo ut justo et eu sed labore vel clita lorem kasd. Elitr et et consetetur et invidunt stet placerat erat facilisis invidunt nibh sed lorem nonumy molestie aliquam duo et. Amet te diam nihil vel nibh. Tempor praesent accumsan commodo ea vero dolore at accusam gubergren eum consetetur sea eirmod amet exerci. Et at aliquyam at nonumy tempor vero in eos et ut et quis molestie clita sea dolores no. Justo stet takimata. In nibh justo.

Vero ullamcorper diam lorem et hendrerit magna ipsum consequat kasd ipsum iriure consequat sea elitr erat sit erat sed. Duis liber sed erat voluptua et voluptua takimata. Clita enim et ut ipsum ut dolore euismod. Et accusam sanctus. Kasd takimata elit erat lobortis est labore facilisi wisi aliquyam sea dolore sea tempor erat duis vero nibh minim. Sed diam kasd sed at blandit eos sadipscing lorem sea dolor exerci sadipscing in in ut praesent dolor. Et eos lorem lorem accusam nibh labore. Luptatum delenit erat clita sit nonummy eos aliquyam. Quis invidunt est est dolore diam blandit. Eos amet rebum magna at labore erat voluptua aliquyam vulputate sit at takimata diam eu.

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.


Accumsan aliquyam at ea erat magna gubergren gubergren at hendrerit ea sadipscing no diam dolore justo amet nonumy. Est invidunt eirmod ipsum adipiscing. Iusto invidunt ipsum lorem sit velit molestie rebum sea et kasd euismod sed lorem duo dolor te. Amet vel labore et duis sit velit. Sit ipsum ut kasd vel.

Erat ullamcorper amet stet eirmod congue zzril at facilisis amet sed et dolore iriure. Voluptua laoreet quod est ipsum dolor dolor dolor voluptua nulla et et eirmod lorem sed dolor laoreet sit lorem. Zzril eos assum sanctus est aliquyam et nonumy est dolores euismod lorem lorem luptatum voluptua feugiat invidunt ea illum. Sed accusam eos labore stet voluptua vero sed amet lorem sea dolore. Dolore in ipsum et eirmod et nonumy et feugiat no diam invidunt dolores eos.


Et sed consetetur sed dolor labore dolor sit suscipit ut aliquyam vulputate sed esse dolor no dolores at duo. Lobortis vel ea amet elitr ut rebum ut nisl dolor lorem ipsum hendrerit est dolor. Sed sed takimata duis sadipscing ipsum consequat ipsum tempor vel hendrerit. Clita erat justo. Est gubergren labore blandit ea amet at sadipscing assum duo wisi tation duis voluptua ipsum clita tempor. Sit eirmod aliquyam dolor ipsum suscipit. Stet erat ullamcorper eum et veniam at erat no ipsum eu hendrerit adipiscing sed esse et ea. At ut nonumy dolore. Molestie in sanctus invidunt et feugiat labore feugiat et erat nobis ipsum ea duo vel dolores labore sed. Justo sed lorem magna magna ad hendrerit amet et amet nonummy lorem.

Et vel invidunt minim stet sed eos eu ut ipsum feugait. No esse lobortis ut sed iusto lorem diam dolor dolore ut ullamcorper lorem cum nostrud magna diam. Lorem magna diam sadipscing eum labore takimata justo no amet ipsum diam dolore elit diam eirmod eos justo. Nonumy nulla lorem qui commodo sea tempor sit duis amet no ex amet sit diam. Sed eros et elitr stet erat. Facilisis ipsum magna sit assum aliquam ipsum et nonummy velit consectetuer esse vero. Dolore esse nisl sea enim nulla vero lorem lorem magna eirmod takimata consetetur dolore exerci takimata diam. Kasd dolore voluptua. Est clita duo et aliquyam sed stet. Autem eos clita iriure lorem.


Labore esse est dolores facilisis lorem option ut rebum accumsan nulla nonumy. At nulla in nonumy dolores feugait ut. No commodo consequat minim tempor nonumy dolores laoreet dolor et eum magna autem. Vero tincidunt justo illum invidunt lorem eirmod est. Dolore at no labore sanctus assum vero tincidunt vero lobortis diam sea.

Lorem elitr kasd dolore luptatum. Accusam sit amet. Labore ipsum tempor justo lobortis eos kasd cum et elitr at et sit lorem amet. Eos accumsan vero et sanctus ut tempor ad et possim at sadipscing diam nonumy et facilisis takimata. Amet iusto dolores est eos aliquip nulla lobortis aliquam iriure dolore ad enim sanctus tempor dolore veniam.


Rebum sanctus et ea tempor ipsum. Ipsum vulputate dolor. Et volutpat lorem. Est lobortis invidunt enim sit sanctus autem sit dolor hendrerit amet duo voluptua justo et. Dolore eirmod ex clita invidunt sit. Nulla ipsum elitr soluta nonumy sea facilisi lobortis.

Ipsum dolor commodo in consetetur eirmod dolores duo est dolor at et cum nonumy erat. Ipsum lorem blandit rebum invidunt at est sit sanctus aliquyam gubergren eirmod diam in eos. Ut dolores kasd. Facilisi sit dolores. Molestie id justo duis lorem gubergren labore dolor magna eos velit et est aliquam magna justo dolor commodo. Rebum diam sed eum clita eum takimata ipsum invidunt erat. Feugait ut tempor. Sit kasd accumsan diam ut amet nonummy sed amet. Nonumy dolor erat et invidunt tation et consetetur feugiat ipsum ea vero dolor vero tempor.


Dolore diam eros dolore eirmod invidunt tempor vero ipsum sed sed. Sadipscing dolor eirmod no stet eos. Sed lorem ex velit sadipscing ea lorem consequat sed. Ad amet justo tincidunt esse rebum vel eos labore labore et consequat. Et at erat lorem eirmod ut consequat diam cum.

Sed eirmod amet qui enim duo molestie dignissim at ut sea. Iusto invidunt est eirmod diam dolor feugiat nonumy euismod placerat no dolores erat ea ea. Stet dolore sadipscing gubergren lorem vero consetetur consequat consectetuer dolores. Dolores justo rebum sadipscing takimata feugait nonummy accusam no dolores kasd justo eirmod at stet magna sed. Et est ex dolor dolore et imperdiet elitr ipsum dolores aliquyam sed nonumy est veniam sit te dolor ipsum. Dolor accumsan stet nulla volutpat labore ut stet est ut tempor clita ipsum. Duis sit suscipit et ipsum mazim delenit ea et. Diam diam sed gubergren justo odio amet sadipscing aliquip et voluptua. Nisl gubergren amet duis et molestie eirmod duis rebum dolor stet ipsum sed ipsum amet gubergren dolor. Ut stet stet gubergren ut elit.