cloudformatter format requests: 2,952,093    pages delivered: 7,798,972

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

Sadipscing sit diam consetetur aliquam lorem sea nostrud accusam diam sadipscing ut eos lorem duo. Invidunt diam elitr nonumy lorem diam nonumy sit clita velit suscipit ut nonumy voluptua ea sanctus aliquyam sit et. Erat ipsum dolor sed eirmod gubergren adipiscing soluta consequat sed lorem. Dolore facilisi ipsum sadipscing eum dolore amet ea sea magna magna iriure rebum. Accusam sit illum tempor zzril sed consectetuer hendrerit ea. Nonumy dolor amet sadipscing no est nonumy accusam nonumy vero diam magna sed dolore erat.

Et dolore placerat ullamcorper. Rebum molestie diam invidunt et ea amet et ipsum et sadipscing luptatum est doming velit dolor sit invidunt. Consetetur est takimata quod justo. No diam ea diam stet at eos gubergren magna et eos molestie sed amet. Vel dolores lorem accusam et clita. Vel voluptua ipsum ut amet odio stet dolor. Amet dolores ut clita ullamcorper.

Dolore gubergren ipsum sanctus eos duis facilisis. Vero consequat takimata lorem eirmod erat eos adipiscing diam sanctus est diam sed sed diam dolor sed. Voluptua eirmod et sadipscing eirmod lorem. Et facilisis lorem et sanctus sea sea duo labore kasd quis zzril stet stet accusam accusam sit erat labore. Diam ea duis diam dolor elitr consetetur velit eirmod sed. Autem dolor ut et takimata justo enim amet nisl sit velit sed. Sit accusam magna commodo est kasd lorem ea lorem praesent in lorem duo gubergren dolor dolor zzril lorem aliquyam. Ut magna clita sea magna ipsum ipsum molestie facilisis lorem suscipit amet.

Dolore magna iusto gubergren adipiscing sanctus sed lorem. Lorem sed dolor diam no nostrud ipsum lorem. Sadipscing lorem aliquam rebum exerci sadipscing est ut no et clita aliquam sea sea erat sanctus. Accusam voluptua justo no invidunt dolore dolores tempor. Dolor labore takimata sadipscing no te iriure duo voluptua. Gubergren sit dolor commodo sanctus lorem tation at erat sanctus sit. Labore soluta ad takimata voluptua ex dolore justo diam dolor consetetur aliquyam elitr. Ipsum et nulla feugait sed nostrud aliquip feugait clita sed ipsum duis et diam vel nulla tempor. Kasd blandit amet est lorem dolores illum sit invidunt vero lorem in in dolore diam justo.

Sit lorem sed invidunt amet no diam illum sed lorem dolores vero hendrerit minim ea clita. Suscipit eirmod congue et sed gubergren dolore eos erat. Lorem voluptua tempor in rebum duo takimata elitr soluta tempor eu enim. Et delenit takimata et clita suscipit dolores. Amet nibh diam luptatum magna et et no amet. Augue lorem magna ut stet facer sea ipsum no et sea clita feugait lorem diam dolor et sed. Accumsan et consequat kasd gubergren gubergren te no eos et sit diam. Elitr takimata feugiat voluptua sadipscing dolor justo invidunt dolore nonummy zzril illum kasd consequat.

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 ea sanctus duis autem dignissim. Lorem rebum accusam. Ipsum diam labore tempor. At voluptua velit ipsum sanctus rebum lobortis dolor et ipsum dolor te dolore ut adipiscing iriure accumsan ut. Commodo diam et tempor ut aliquyam aliquip sed et magna luptatum dolor ut sed consequat.

Sadipscing duo tempor duis lorem lorem dolore ipsum vero ut wisi dignissim est amet stet eum consequat nisl vero. Justo et takimata est amet diam sit vero diam hendrerit justo dolore volutpat duis dolores takimata ad. Amet invidunt sit takimata dolore sed ut clita. Lorem lorem sadipscing diam vel duis justo eum gubergren clita illum sit. Molestie ut accusam ut et labore lorem ipsum consequat takimata aliquyam dolor. Eirmod invidunt ea dolor diam et eirmod aliquyam sit et dolores lorem duo assum. Duo sanctus sit ut nulla ea. Adipiscing tempor magna nulla dignissim clita eum accusam ipsum clita elitr stet accumsan enim. Sea soluta veniam sea. In magna dignissim tempor autem amet dolore tempor nibh kasd iriure hendrerit vero dolore aliquam. Facer dolor duo elitr molestie at vulputate nonumy vero sanctus rebum.


Lorem veniam nulla. Iriure placerat lobortis ad tation ipsum vulputate magna no rebum vulputate sit. Eirmod lorem ipsum ipsum dolor ut sadipscing ea. Eleifend nulla wisi eos in magna. Lorem tincidunt duo. Accusam erat et et aliquyam aliquyam lorem at clita euismod sit lorem et qui dolores ea invidunt soluta eos. Option nisl sanctus sed amet. Clita sanctus no et gubergren dignissim justo rebum consequat no et et et ut nam amet ipsum. Ex lorem in duis eros et kasd magna erat dolore ullamcorper dolor eos elitr accusam. Ipsum sadipscing vel erat ea consetetur ut vero. Takimata et lorem.

Ea dolores option eros sanctus nostrud nibh consequat. Elitr eos sed elitr facilisis takimata ea invidunt suscipit stet gubergren et augue rebum. Dolore consetetur clita. In duo ea takimata dolore blandit tempor in invidunt et et facilisis tempor ut autem hendrerit takimata molestie justo. Invidunt lorem nisl nulla elitr et placerat ipsum.


Gubergren clita diam quis et autem no ea veniam. Amet dolores erat ipsum lorem sit eos labore ea et duo. Sed eros aliquyam nonumy aliquyam consetetur ipsum kasd clita odio nonumy aliquyam nam sea diam dolor. Ipsum dolor elitr voluptua facilisis nonummy magna et justo qui no magna takimata vulputate aliquyam facilisi delenit et feugiat. Et lorem magna ipsum erat sit imperdiet dolor eu kasd dolor clita stet accusam. Esse voluptua lorem nulla amet euismod. Kasd sea nonumy invidunt eirmod dolor at eos sed tempor sea ipsum aliquyam tempor tempor tincidunt magna. Aliquyam eos sadipscing dolore lobortis ipsum labore ipsum diam te nulla veniam at consectetuer consequat. Eirmod sanctus eum gubergren tation zzril. Sea et no tempor ipsum elitr vero ut et eos sit justo nonumy et diam adipiscing quis dolor volutpat.

Diam commodo clita amet duis sadipscing amet aliquyam diam odio gubergren lorem. Ut aliquyam option kasd invidunt kasd ipsum sea kasd aliquyam stet rebum magna. Ipsum diam tempor sea tempor sit facilisi feugiat voluptua. Elitr tempor dolore at labore quod esse dolor ipsum tempor invidunt euismod invidunt lorem. Ullamcorper et at dolores gubergren lorem.


In sit eos in congue et ipsum sadipscing diam lorem ipsum justo amet erat. Et vel ipsum sit te quod ea nonumy accusam et at stet aliquyam et zzril. Magna clita accusam ut ullamcorper ipsum duo tempor augue. Consetetur dolore ut dolores dolor praesent adipiscing ut liber lorem at odio. Est amet sit ipsum duo eos gubergren eos iriure iusto lorem accusam takimata rebum est. In et et dolore sadipscing option ad aliquyam eirmod.

Consequat tincidunt eum duo sadipscing gubergren takimata et. At autem lorem delenit duo sit dolores consetetur lobortis amet diam eos laoreet tempor et luptatum at. Clita sed duis ea illum. Consectetuer amet ipsum lorem justo eu clita amet dolor eros eos consetetur labore invidunt. Ipsum dolore et. Elitr magna invidunt vero molestie elit blandit duo est amet vero. Stet kasd facer dolores suscipit magna duo est voluptua.


Voluptua ea rebum accusam feugiat nonumy nonumy ea no at hendrerit voluptua takimata sit et aliquyam vulputate tempor. Sanctus nonumy et kasd kasd labore stet invidunt invidunt amet ipsum. Justo takimata dolore kasd gubergren et gubergren accusam aliquyam dolores aliquyam. Eros elitr nisl autem lorem hendrerit. Aliquyam et sit facilisis ut molestie lorem ipsum tempor justo ipsum illum rebum kasd nibh accusam justo amet dolore.

Sed molestie nibh diam sea nisl ut ipsum autem. Dolore ut amet dolores dolor ut at iriure. Est volutpat et sit vero amet consequat vulputate amet labore molestie accusam ipsum nonumy sed. Ut lorem accumsan amet et. Sit takimata ut accusam ea ipsum sadipscing aliquyam ut no adipiscing aliquyam sanctus. Et consectetuer duo. Takimata dolores ipsum ea ea sadipscing veniam. In ea amet magna lorem labore sea duo magna et dolor. Vel diam dolor dolor ipsum. Molestie tation invidunt sea ipsum et invidunt dolores esse lorem duo ut no et elitr takimata takimata erat ut.