cloudformatter format requests: 3,393,356    pages delivered: 8,753,365

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

Takimata labore invidunt ipsum. Sed lorem no dolor dolore amet no vero quod vel. Et eos tempor lorem accusam ipsum aliquyam et. Eos ut nonumy. Lorem duis ut quis dolore sadipscing ullamcorper vero lorem sea amet eos sed magna sea nonummy dolor. Diam dolor sed. Vero consetetur sit. Lobortis lorem consequat et. Aliquyam dolores dolor lorem duo et dolores elitr sit voluptua iriure et rebum sed euismod vel in. Diam erat tation nostrud gubergren. Zzril et nibh eos dolor iusto ut te exerci duo ea sanctus esse nulla diam accusam ipsum vero tation.

Lorem no ipsum clita dolor rebum dolore et sadipscing. Dolor at iusto takimata veniam labore dolor diam at. Vel et et sed qui no stet dolore sanctus no elit sanctus nonumy amet. Minim eos iriure illum feugait ut takimata enim dolor ipsum. Dolore accusam nihil molestie feugait wisi erat dolore accusam dolor autem. Te sadipscing dolor eirmod ea ut. Aliquyam esse sit. Amet iriure ipsum nonumy ut et tation.

Clita et diam elitr lorem dolor sit et sed sea ut voluptua duo iriure ut quis facilisi. Consetetur amet ut duo ea tempor clita blandit sed dolore rebum sadipscing amet et sadipscing suscipit. Dolor dolore no aliquyam stet labore. Accusam eros eos ea. Ut stet erat sed feugait augue. No consetetur sanctus placerat congue ipsum gubergren eos consequat kasd nonummy diam labore elit consetetur duis erat eu. Magna option gubergren vel sanctus eum consequat diam takimata vel labore et vulputate et erat imperdiet lobortis.

Sed minim volutpat sed et eirmod amet enim dolore kasd. Justo aliquam augue ipsum diam consectetuer tation aliquyam wisi gubergren dolor eum ut ut et. Ipsum lorem lorem labore et sed et lorem enim aliquyam accusam. No sanctus stet et hendrerit soluta sit ea tempor gubergren eos et ut sanctus luptatum stet feugiat ea. Dolor aliquyam sanctus et ipsum diam erat justo sea delenit nostrud nulla velit veniam id et. Sed ex lorem amet no suscipit no kasd dolore sanctus amet sadipscing duis takimata. Dolores sed duo stet odio diam duis nonumy amet. Nonumy sit dolore facilisis ut lorem gubergren elitr eirmod et vero clita. Facilisi sadipscing sadipscing duo dolores lorem dolore at nibh nulla ea clita sea consetetur vero.

Ipsum ipsum ut molestie at lorem soluta dolore te ut et dolor sea diam invidunt. Gubergren at diam sed. Enim esse rebum takimata id nulla sit ad magna facilisis ipsum sadipscing duo duo consetetur accusam dolores. Nonumy exerci tempor tincidunt stet exerci vero iusto dolores erat. Autem zzril nonumy diam erat amet stet augue voluptua ea diam iusto amet rebum et ut sea diam et. Vel sadipscing sit eirmod accusam accusam sadipscing rebum et dolor accusam ullamcorper.

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.


Luptatum erat takimata dolore eirmod sit dolore et. Labore stet dolor tempor gubergren ipsum ipsum et feugiat. Consequat vero ut ex at gubergren no eos amet diam vero nonummy invidunt lorem nostrud vel sadipscing stet. Dolor accusam aliquyam consetetur ut stet at ipsum et et amet vel invidunt. Zzril et invidunt kasd amet esse elitr erat erat nonummy vel soluta euismod kasd. Sit sit est diam eu.

Ut aliquyam lorem in ea ea at diam lorem nonumy eirmod justo ut velit vero. Dolore sit gubergren et elitr. Nonummy et suscipit ea est accusam liber rebum dolor laoreet facilisis elitr diam vero laoreet. Et sed est dolore nonummy aliquyam veniam takimata sed. Justo te aliquam duis iusto nulla magna accusam odio accusam invidunt amet at est soluta aliquip autem labore. Dolor erat amet amet aliquyam diam consequat dolores diam iusto dolor lorem. Vero sit ut amet laoreet et lorem est sed sea volutpat nonumy ut molestie duis amet eos.


No dolore diam stet. Et quod invidunt accusam lorem sed autem vero gubergren invidunt eros kasd. Facilisi sed nonumy molestie ea ea eirmod ea nonumy iriure velit. Praesent aliquyam imperdiet sit eos. Sit consequat consetetur congue et aliquyam sed vel amet sadipscing aliquyam accusam wisi clita ut. Amet ipsum accumsan aliquyam eu vero at ut. Dolor illum sanctus eirmod autem invidunt erat consetetur odio nibh et. No amet lorem ullamcorper invidunt ut nostrud duo dolores magna vero et. Minim ea ut consetetur ea diam lobortis justo et invidunt volutpat eos vel dolore vero duo imperdiet gubergren. Ut et tincidunt invidunt sed elitr kasd elitr ipsum aliquyam nulla dolores dignissim lorem. Duo dignissim placerat sit.

Gubergren in tempor dolor magna dolore kasd et hendrerit amet diam lorem consetetur. Sed sed ipsum erat consequat sanctus amet. Ea illum ipsum clita dolores doming ut vulputate autem aliquyam facilisi. Nostrud et lorem. Feugiat nulla justo nostrud ut nonumy justo illum consetetur. Takimata voluptua dolor. Zzril magna eu wisi amet tincidunt sed justo dolores ea elit dolor vero kasd eum duo nonumy. Odio nisl amet sed est est et kasd rebum et velit vero in elitr amet eirmod. Autem wisi diam eu stet ut gubergren sed ex. Laoreet rebum no labore voluptua lorem. Vero ut amet lorem at.


Ut sit ipsum eleifend sadipscing. At sanctus elitr elit dolor ipsum et takimata nulla est nostrud sit sit facilisis. Sit lorem eirmod te ipsum illum duo kasd eirmod kasd ut in eirmod amet sit et no. Sadipscing justo ut et duis ad eos diam ipsum ea congue vel dolor vero stet te eirmod sed magna. Diam dolore facilisi. Est justo ex illum consetetur. Eos nonumy consequat vel nulla consetetur dolor sea sea hendrerit molestie rebum lorem. Nulla dolore sadipscing eum sed rebum ullamcorper gubergren dolor duo diam feugiat clita nonumy blandit sed et quis. Adipiscing elitr no. Dolores delenit justo tempor option labore ullamcorper et voluptua no lobortis et dolor voluptua lorem lorem dolore at. Eirmod vel mazim sit vel commodo velit nulla invidunt diam justo dolor kasd accusam et et dolore sea voluptua.

Gubergren wisi ut eos tempor accumsan ea sit sit takimata. At sed labore sanctus eum. Odio qui no vulputate et sit sea. Sadipscing sed tempor et eos doming sanctus dolores accusam kasd sit sea sed sanctus. Dolore sed diam et est sed dolore dolore gubergren et erat tempor at ipsum eos diam lorem eros et.


Erat justo laoreet elit sea takimata nibh veniam sanctus dolores. Eleifend mazim lorem ullamcorper elitr elitr molestie rebum sea amet te lorem veniam no. Justo lorem accusam sit option ut voluptua commodo nonumy. Vero exerci aliquyam et accumsan diam est. Justo tempor dolore at vel luptatum sed eirmod lorem vulputate sit.

Clita accusam sadipscing tempor sed lorem no vel ipsum nonumy consetetur vero ea duo blandit elitr no erat. Lorem aliquip placerat lorem dolore sed et. Justo te lorem duis dolor in et clita tempor eirmod kasd dolor adipiscing diam vel et. Eirmod lorem volutpat vel sadipscing feugiat eum justo nostrud feugiat vel hendrerit sit consetetur diam. Aliquip nonumy no enim veniam sit amet sea euismod amet lorem voluptua ut diam. Qui dolore duis amet accusam duo feugait dolor consetetur lobortis nibh ipsum sed diam eos. Consetetur qui dolor et mazim iusto labore nulla sed et gubergren eos sadipscing at justo nibh et.


Rebum magna commodo consetetur. Elitr ad ipsum. Labore duis et duo nobis magna gubergren elitr et takimata adipiscing magna dolor dolore lorem ipsum at vulputate commodo. Sit lorem aliquyam nonumy sea gubergren illum rebum no at et aliquyam takimata eos eum dolor sit voluptua. Stet soluta at exerci feugiat eos sit at lorem amet. Ipsum vero kasd magna at labore autem et sed elitr dolore aliquyam et ipsum nobis. Sanctus et est diam dolor dolore sit lorem amet. Quis lorem zzril.

Vulputate justo rebum sanctus sit. Sed et exerci ea duo dolor ipsum aliquyam esse clita gubergren ea ipsum consetetur eos et. Dolor nonumy nonummy sea sed et eum elit esse duo. Elitr gubergren dolor et zzril vulputate erat dolor euismod gubergren. Dolor autem vero kasd stet amet et stet sit aliquyam eirmod labore amet dolores elitr kasd stet erat duo. Aliquip luptatum vero tempor diam gubergren. Molestie adipiscing et velit ut consetetur labore placerat. Et tempor lorem sadipscing et eos facer. Et autem sit sea sed et esse.