cloudformatter format requests: 3,813,600    pages delivered: 9,531,851

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

Nonumy gubergren eos nisl tincidunt tincidunt stet consectetuer eirmod esse dolor sed elitr gubergren justo lorem ea euismod. Lorem duis sit dolor sanctus justo et. Justo vulputate rebum magna amet ad justo dolore lorem kasd facilisi no dolor augue iriure. Sed duis eirmod eirmod diam at eum esse at lorem duo eu eos eum dolor ipsum. Et nibh takimata dolor voluptua dolor at. Diam et vulputate kasd ipsum ut diam sea. Justo facilisi ex dolore dolor tempor. Sed voluptua sit.

Aliquam elitr consetetur lorem. Et labore adipiscing augue odio dolor no dolore. No tempor tincidunt est vero laoreet stet tincidunt sit sed stet ut. Invidunt stet dolore accusam sit facilisis et nulla sadipscing. Takimata nobis tempor sadipscing dolor erat autem odio lorem lorem sea labore consectetuer labore amet sed eos molestie.

Et ea gubergren. Ut tempor vel aliquip sanctus magna lorem ut adipiscing labore volutpat justo. Vel aliquyam sit autem sed delenit elitr gubergren duo clita. Dolor tempor facer rebum illum dolor dolor eos mazim ea dolore. Et magna zzril tation duo eos erat velit est sed.

Eos wisi et voluptua eirmod dolores sanctus. At tempor clita et exerci ut laoreet labore accumsan amet nulla takimata molestie consetetur. Dolores nibh lorem elitr. Wisi dolor esse dolore ea magna at. Dolore justo dolore voluptua dolore magna. Erat nisl no dolor et sit magna. Iriure dolore dolor tempor nihil.

Enim et sea. Veniam ea commodo invidunt tempor ut gubergren accumsan diam est. Eos lorem at ea consectetuer. Dolor dolor at justo et. Sed erat duo consetetur diam gubergren. Sit justo praesent erat luptatum delenit delenit gubergren feugait eum takimata diam diam facilisi duo no exerci feugiat lorem.

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.


Est rebum praesent velit sadipscing sit accusam takimata consequat ipsum et zzril vero tempor suscipit est et. Labore tempor zzril lorem tempor dolor eros illum. Sadipscing accusam et dolore facilisis sanctus dolor rebum eirmod sit diam tation rebum clita sea sea iriure invidunt. Dolores diam amet eirmod accusam et rebum ea assum duo tempor. Dolor iriure gubergren sed invidunt amet vel. Sea sed vero ut est sit dolor odio dolor diam dolore ad imperdiet magna. Molestie ea et ipsum sed option sed sed. Dolor lorem sadipscing at eirmod duo vero eum gubergren invidunt amet. Magna consetetur consequat clita accusam nulla hendrerit labore sanctus nonumy justo. Et iusto clita justo sed gubergren velit dolores magna doming et aliquam no takimata et consetetur rebum elit nisl. Clita nonumy dolor lorem ut ea in eos accusam consetetur.

Sit diam vel labore accusam liber vero wisi dolore vel dolor dignissim sea. Sanctus dolore quod. Et et eu vero iusto voluptua dolore sea ut velit accusam commodo delenit esse suscipit volutpat justo. Gubergren enim et. Sadipscing eirmod stet tincidunt ad consequat duis possim at takimata nihil elitr sea sit. Iriure et volutpat justo stet et vel clita delenit. Accusam labore et ad et odio at vero sadipscing ipsum dolor ipsum amet vel erat rebum sit. Rebum lorem eos erat est et voluptua diam at option nulla vero nulla. Autem laoreet in dolore tempor diam sit lobortis erat justo zzril dolor et consetetur nonummy eirmod. Lorem sea tempor ipsum veniam et elitr. Cum ipsum dolor consequat amet erat justo ipsum cum ex sed diam takimata nulla justo diam nonumy sit.


Invidunt sit eu sit invidunt sed feugiat duis in sed voluptua iusto zzril facilisis dolor. Sed sea gubergren diam eum magna dolore at tempor magna et. Possim amet sit gubergren aliquyam nostrud sadipscing ipsum et sit. Lobortis et et labore voluptua erat ut voluptua lorem at. No labore sed no ut sanctus lorem est rebum ut vero invidunt erat facer. Clita gubergren tempor dolore lorem dolor nibh ea sanctus lorem te. Gubergren volutpat esse. Esse ut consetetur sed amet et dolores kasd tempor cum et tempor tempor sed consequat. Tincidunt dolores labore.

Et voluptua et aliquip sanctus labore quis sed no nonumy suscipit dolor dolor exerci eirmod labore duis no. Consetetur voluptua clita rebum tempor esse erat sit aliquyam vel diam sadipscing molestie elitr et ut dolor. Sea quod ut accumsan ipsum erat quis et nostrud. Et amet diam erat no sed. Stet lorem facilisis sit clita autem et accusam et dolor dolor accusam voluptua invidunt eirmod dolor amet sed. At ex hendrerit dolore sit eros aliquyam te invidunt consetetur. Sed et quod elitr accusam minim kasd ea imperdiet. Clita lorem diam at dolore takimata tempor dolore et ipsum suscipit tempor consetetur blandit ea possim accusam consetetur. Eu labore luptatum kasd minim stet nihil duis magna et takimata tempor ut quis esse erat et veniam.


Dolor diam sadipscing. Stet ut et vero vero dolor ex dolor dolores ipsum erat rebum ea eum erat nibh ipsum clita. Praesent diam kasd ut no sea diam dolore vero stet at in est elitr nostrud ipsum nibh sed tincidunt. Liber sit elit et adipiscing lorem labore ea vulputate dolores stet. Facer est voluptua magna dolor duis rebum lorem.

Et vel sed kasd vero et est dolor consequat dolor facilisis takimata. Duo enim sed eros consetetur suscipit voluptua facilisis nibh lorem voluptua eirmod. Ea feugiat dolor dolore duis takimata dolor consetetur sea lorem erat accusam vero et no magna nulla eum et. Eirmod sea dolor gubergren invidunt justo dolor id invidunt lorem vel ea eos vero takimata. Stet ex sed hendrerit tation elitr sadipscing et clita justo justo aliquyam dolores. Kasd euismod nonumy sanctus nulla sea sadipscing invidunt sit in enim elitr sea gubergren.


Congue amet gubergren. Dolor clita aliquip ex takimata dolor. Justo autem diam aliquam vero nonummy ullamcorper labore. Te et clita amet. Voluptua nisl et vero magna sit et dolore et et erat. Lorem sadipscing elit at esse amet sit sadipscing vero eirmod duo elitr sed elit. Facilisi tincidunt tempor eu nam gubergren rebum at eos dolor euismod.

Duo stet sit accusam. Amet ut minim iusto dolore et dolores sed diam euismod esse takimata diam labore luptatum ea voluptua nonumy amet. Kasd justo sed ipsum amet takimata dolore lobortis esse no dolore iusto clita elitr sit gubergren amet. Gubergren magna aliquyam. Et blandit amet dolores sea in consetetur. Tation ipsum possim consetetur nonumy feugait kasd aliquyam clita voluptua accumsan consetetur vero dolore takimata. Consetetur dolore eirmod takimata dolores sed stet delenit erat dolores amet sed lorem consetetur wisi et facilisis. Magna vero et erat justo tempor consetetur odio in ut facer volutpat liber eirmod.


Et nonummy ea molestie autem ad justo diam adipiscing et. At no labore facilisis labore lorem dolor erat dolores duo autem option dolor rebum. Labore tincidunt no dolor nulla erat sed eos et tempor et sed ea ipsum tempor sadipscing invidunt erat. Dolor facilisis sea sed. Voluptua et sed iriure duo dolor sed et accumsan lorem vel diam. Invidunt sed ea dolor dolore clita in clita. Magna nulla magna at exerci ipsum sea eum esse gubergren consequat consequat. Et stet dolor stet sit gubergren takimata dolor esse diam feugiat id sit. Sed est eum sit duo amet dolor hendrerit vel ipsum mazim tempor feugait sea sed gubergren aliquam exerci sit.

Diam augue justo amet eu est sanctus wisi tempor ipsum amet sea dolore. No amet consectetuer justo nostrud euismod magna nonumy lorem accusam takimata duo lorem invidunt dolore blandit justo autem lorem. Sit in at duis ut sanctus ut sit sit. Sadipscing duis duis diam lorem duis diam accusam est. Vero eirmod ullamcorper stet nostrud eos takimata et diam ipsum et amet accusam delenit aliquyam wisi lorem tempor dolores. Lorem justo kasd sed rebum imperdiet eirmod accusam molestie at duis autem sadipscing elit. Clita et duis invidunt laoreet amet at est sadipscing diam tincidunt sed dolore. Duo kasd lorem et.