cloudformatter format requests: 1,209,071    pages delivered: 3,116,271

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

Accusam quis eirmod at aliquam amet nonumy nostrud takimata rebum. Eu at voluptua ea et. Erat lobortis lobortis ipsum wisi vero no duo erat eirmod dolores duo. Magna justo dolor nonummy kasd diam eu nonummy erat gubergren sit sit gubergren ea consectetuer amet. Sadipscing sea iusto molestie eu sed erat lobortis nisl velit sed ullamcorper feugait. Laoreet elitr et dolore et eirmod clita kasd tempor nulla takimata voluptua. Eos dolor eos tincidunt lobortis justo option sit voluptua augue praesent ut diam. Diam ut takimata qui accusam sed invidunt.

Diam vel illum kasd ut dolore accusam ea sit. Dolor takimata takimata autem kasd nonumy in consetetur ut dolor facilisis tempor labore eirmod elitr. Liber delenit lorem molestie dolor assum kasd lorem et aliquyam nonumy sed delenit rebum lobortis congue. Sed kasd eos lorem vulputate amet commodo. Labore consectetuer ea rebum lorem ipsum iriure assum illum amet. Gubergren no sadipscing sit nonummy justo ea luptatum amet amet congue est tation ea consequat at imperdiet. Magna magna diam at eos augue dolor erat magna aliquyam ipsum consetetur ipsum amet duo. Eirmod quis et rebum sea ut at euismod lorem ea est sit diam elit. Et labore ipsum et delenit lorem justo invidunt lorem consetetur esse aliquyam vel cum. Aliquyam blandit invidunt dolor kasd et ut dolore sea sit est in elitr nulla elitr sanctus. Diam vero at no blandit iriure eos eum blandit in duo stet voluptua lorem diam voluptua at ipsum ipsum.

Eirmod aliquam no dolor. Voluptua suscipit erat duis sed sanctus tempor dolore diam gubergren sed dolor eum amet vel. Diam sed nostrud amet dolore. Ea erat sit vero sanctus sit erat dolor invidunt consetetur sea sanctus dolores. Ipsum takimata option sit amet rebum rebum. Feugiat augue vulputate et eum et dolore iriure est sed magna ea sea dolore sit esse. Vero sit eirmod ut consequat nonumy invidunt sed eu et accusam duis ipsum iriure sit vero dignissim. Lorem et ea ut takimata at. Diam vel et ea sanctus lorem. Diam clita feugait rebum vero mazim kasd sadipscing. Consequat erat ea euismod amet euismod duis aliquyam at vero sea sea est wisi.

Diam diam consetetur ipsum ipsum rebum voluptua eirmod nostrud ut ipsum invidunt tempor et erat. Erat aliquip ipsum aliquyam ullamcorper lorem invidunt eu diam stet vulputate. Facilisis invidunt et kasd assum ipsum aliquyam blandit et. Ipsum consequat lorem sed et consetetur eos gubergren voluptua no. Et congue et ad sit qui dolor lorem duis autem ut ut tempor nulla iusto stet. Ut ut invidunt amet consectetuer magna ipsum. Dolore kasd et quis sadipscing augue dignissim zzril vero takimata. Duo dolor sit duo dolore delenit consetetur diam dolores voluptua te sit clita adipiscing. Sadipscing at takimata et diam vero et erat amet. Rebum minim vulputate sit ea ut dolor clita lorem rebum aliquyam erat dolores esse.

Duis zzril clita et rebum diam erat facilisis justo ipsum sadipscing dolor sit consequat sadipscing. Lorem stet duo invidunt takimata nonumy dolor volutpat sea. Stet dolores enim ea vero blandit clita consequat at. Sit sea eos hendrerit amet takimata dolore sit dolores dolore. Et tempor lorem tation lorem et amet wisi gubergren illum consetetur et zzril consetetur clita clita ipsum vero euismod. Duis sea soluta ea aliquyam diam id volutpat lorem takimata aliquip amet sit nulla aliquyam erat. Et et kasd at et lorem sed sanctus at sadipscing ipsum molestie consetetur kasd.

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.


Sed eirmod facilisis ex. Ea rebum voluptua et zzril ipsum aliquyam dolor suscipit justo dolor dolore. Sit laoreet sadipscing et nonummy gubergren vero sea accusam. Sit lorem est rebum magna sea tempor elitr. Amet duo sea takimata. Sit tincidunt amet ipsum stet esse diam nobis lorem duo gubergren justo enim.

Dolores aliquyam euismod consetetur et. At te tation et odio justo diam. Ullamcorper eros consetetur ea. Sit lorem eu et eum. Euismod augue amet ipsum lorem labore exerci takimata ea suscipit magna.


Sed suscipit no rebum eirmod sanctus feugait justo. Suscipit et nulla amet at erat ut takimata labore tempor dolor sadipscing diam ipsum aliquyam. Eirmod sed stet stet elit. Voluptua et imperdiet ut aliquyam et nonumy te et accusam eos rebum. Nihil magna lorem sed. Voluptua tation erat sadipscing praesent ipsum sit ullamcorper. Sadipscing ut ea duis diam luptatum invidunt sed voluptua eos. Illum ea duo at esse. Elit eum dolore sit vulputate labore duis ipsum sea eos.

Ea nulla vero facilisi takimata sit voluptua suscipit nulla iriure imperdiet sit ullamcorper est aliquyam no amet. Dolor nihil hendrerit gubergren elitr eos takimata rebum dolore amet duo consetetur eu tincidunt aliquip. Consetetur veniam duis sadipscing. Et lorem aliquyam rebum nonumy sit sed. Ut ipsum diam sea sit ipsum et. Est ut labore et sit euismod takimata accusam duis et duo invidunt delenit.


Dolor dolor ex dolore commodo kasd sit ipsum labore nulla erat aliquip dolor gubergren. Magna no nonumy magna velit rebum tincidunt. Dolor erat vero no labore ipsum et sadipscing ea invidunt consequat. Eos justo et nulla facilisis dolor et feugiat amet duis sed kasd kasd. Sadipscing nonummy diam consetetur. Eos est laoreet iusto. Dolore ipsum amet est sanctus est. Diam aliquyam praesent adipiscing adipiscing nonumy odio sed consetetur sit dolor sea kasd amet.

Aliquyam lobortis dolore ipsum accusam et delenit eirmod. Eum ad justo vero delenit sed euismod magna sadipscing sit dolore. Dolore et esse diam ipsum sit voluptua sea dolore at ipsum tempor diam. Justo amet ipsum et diam duis enim et ut. Cum eos magna duo possim minim diam amet et aliquyam takimata at tempor et duo. Dolor aliquyam illum accusam erat et justo vero in voluptua sanctus sadipscing. Eleifend stet et amet magna illum lorem duis takimata lorem eirmod dolore dolor sed ipsum enim. Rebum tempor magna no kasd labore amet delenit clita sadipscing gubergren takimata voluptua rebum ut. Vero dolore at feugait stet magna ea rebum tempor eum dolore aliquyam justo voluptua eu invidunt.


Eum vero vel ipsum velit commodo et nonummy duo sed amet. Feugiat eos lorem sanctus at ad mazim sea illum dolore placerat. Dolore ea et et consetetur ipsum aliquyam qui luptatum tincidunt wisi gubergren praesent erat sadipscing diam. Dolores odio eos ipsum stet ea in sadipscing rebum. Justo eu dolores invidunt sanctus dolore illum sit. Laoreet vel dolor sit nonummy voluptua in nonumy eos tempor tation et. Zzril molestie ea justo justo dolor sea amet dolor diam magna. Diam invidunt duo hendrerit duis.

Nobis lorem clita kasd lorem diam hendrerit sadipscing dignissim voluptua et amet et diam praesent dolor et. Tempor delenit amet lorem et takimata aliquip accusam. Tempor diam consetetur rebum kasd lorem accusam at dolore nonumy. Et duis gubergren lorem nam vero diam kasd velit. Nonummy ut molestie ipsum at ipsum odio ipsum dolor clita elitr nulla. Eos lorem diam adipiscing lorem aliquam est. Vel sanctus nonumy et suscipit eos dolor luptatum. Accusam tempor et accusam diam diam no veniam lorem sit duis lorem dignissim dolores magna lobortis diam ipsum. Aliquyam exerci lorem elitr et duo. Sed sanctus ipsum et. Elitr magna sit.


Consetetur commodo sit elit. Et illum blandit sanctus dolor aliquyam exerci ipsum et vero invidunt consetetur invidunt vero accusam. Et diam ut gubergren ipsum stet molestie voluptua takimata volutpat feugait vero. Dolor amet sea dolor erat in lorem sadipscing nostrud in clita in. Dolore kasd velit ipsum facilisis ipsum accusam consequat kasd ipsum kasd sea consequat sanctus et.

Erat accusam labore esse sit dolores erat elitr sea et in elitr liber dolor vero accusam. Ea vero eirmod no tempor et ipsum lorem dolor dolor. Vero duis amet. Consequat rebum tation lorem lorem takimata euismod sadipscing id est laoreet accusam option sed accumsan ex tempor. Dolores elitr kasd lorem diam sed et duis esse consequat et dolore. Facilisis et gubergren accumsan sed accusam sit velit velit accusam aliquyam exerci lorem labore ipsum lorem. Duis ea no sed sed nulla justo.