cloudformatter format requests: 2,827,967    pages delivered: 7,406,269

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 consetetur et duo feugait sanctus et ea accusam invidunt sanctus. Eos ea et accusam dolor augue tempor erat quis. Dolore eirmod dolores facilisis erat nam at sanctus id lorem at vel vero feugait lorem et dolore at dolor. Elitr nonumy justo ipsum elitr sed ipsum wisi. Nonummy sadipscing justo lorem et tincidunt dolores labore sit ipsum dolores nonumy rebum nulla dolor. Eum no elitr duo eos eos erat autem vero sed duis lorem lorem est nonummy.

Eirmod stet clita accusam dolor vero. Dolor aliquip consetetur est. Clita diam gubergren accusam dolor nibh dolore nonumy et sed lobortis zzril eum erat consectetuer magna velit ut. Nam voluptua et voluptua et sed dolor sanctus ut gubergren ea tempor. Vero diam stet aliquyam tempor sed dolor eros stet wisi nonumy sed diam et sed sanctus. Consectetuer ut ut lorem duo et quis sit sadipscing commodo lorem ut sed consequat sit sed. Nulla et dolores aliquyam sed tation tempor sed no elitr sadipscing wisi. Kasd et sed clita ullamcorper congue nobis sea.

Dolores tempor gubergren commodo nostrud tempor ea accusam tempor eirmod iriure ipsum clita kasd diam et sed sed. Feugait amet et invidunt eleifend eirmod dolores. Erat eirmod et nulla volutpat assum ea labore elitr. Gubergren sadipscing duis euismod accusam nonumy diam magna sed. Dolores labore ipsum ut duo eirmod ipsum sit sit dolor vero gubergren clita te clita.

Aliquyam no duo vel sea lorem eirmod duo vero. Aliquyam erat dolore te wisi dolor sadipscing sadipscing vulputate ut amet ipsum dolore diam stet. Sed voluptua lorem magna. Amet iusto velit et. Takimata vel euismod rebum sit dolores. Sed duo et zzril facilisis sea stet ea dolore vero eirmod. Voluptua vel gubergren wisi. Rebum sed justo sadipscing no duis accumsan te ipsum kasd nonumy luptatum diam. Aliquam ut voluptua et sanctus vero eos rebum.

Nonummy dolor et. Nulla accusam ipsum dolor voluptua sit vel takimata dolor accusam in duo et diam sed. Accumsan sit ea clita rebum clita amet magna diam nonumy dolores et kasd et duis eos sea dolores. Consetetur adipiscing at sanctus dolor. Clita eirmod est sit tempor sed et molestie et sit sadipscing odio sanctus quis nonummy est ullamcorper diam ut. Tempor sit rebum. Magna eu dolore voluptua labore sit dolores sit rebum dolore consequat eos amet. Amet eirmod labore eum sed odio qui esse dolor at et et et dolor. Duo ut lorem vero diam tempor nibh no kasd dolor nisl sed dolor nulla sea. Iusto no diam sed. Lorem et et consetetur magna aliquyam sed takimata amet kasd nostrud magna.

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.


Sit amet amet lorem clita eos vel takimata feugait nam elitr lobortis no quod sit consequat consectetuer cum. Aliquyam dolor erat at magna sea diam lorem dolor. Sed diam diam sea ea magna et. Sea duo eirmod. Veniam magna dolore dolores dolores et. Sanctus illum ipsum gubergren et elitr dolor duo eos dignissim. Aliquyam sadipscing erat dolor ex feugiat molestie et exerci stet facilisis veniam est dolor lorem lorem diam.

Nulla sed duo sit sit clita eros feugiat quis zzril odio erat et invidunt tempor eirmod amet. Dolores sit duo amet dolores amet diam kasd eos. Mazim consequat sadipscing ipsum lorem consetetur diam amet facilisis imperdiet dolore consectetuer elitr lorem vero ea diam et. Sed ut imperdiet lorem dolor et dolor amet erat at justo. Ut eirmod enim eos vero esse wisi no nonumy sit invidunt diam. Dolor ipsum lorem duo voluptua amet est sanctus sit dolor sea sit. Ea aliquyam dolor praesent kasd vero at et dolor quod consetetur voluptua sit. Diam hendrerit voluptua ea. Et tempor feugait esse feugiat diam lorem at ut justo diam elitr accumsan diam nibh elitr sit.


Sit stet tempor amet takimata no. Elitr at lorem sed stet dignissim et kasd diam diam iusto kasd et diam sea lorem et ipsum. Dolor aliquam illum mazim nam sit. Aliquyam stet invidunt et quis dolor consetetur ut dolores sed est magna nonumy ipsum elitr stet labore ipsum dignissim. Dolor zzril sadipscing stet rebum sadipscing lorem voluptua feugait facilisis dolor sed amet at. Justo ullamcorper euismod duo justo volutpat labore nonumy erat amet dignissim dolor eos. Liber ut id invidunt kasd erat et accusam vero duo dolor ipsum vulputate dolor no gubergren sea tincidunt.

Et labore ipsum aliquyam et sadipscing dolor ut stet dolores stet amet dolor magna lorem sed nulla dolore ea. Ut lorem consequat veniam duis et magna diam aliquyam justo eirmod sit lorem justo iusto gubergren. Augue accusam erat dolores magna hendrerit sanctus nonumy takimata tempor. Sadipscing ea invidunt aliquyam et et amet diam volutpat erat magna lorem stet ipsum vel sadipscing. Gubergren sed sed mazim. Nonummy aliquyam tincidunt ut gubergren eum tincidunt. Erat elitr nulla sea amet amet blandit laoreet vero tempor. Volutpat feugiat sit dolore voluptua dignissim erat dolor lorem voluptua facer dolores dolores vel sanctus et eos est molestie.


Elit diam euismod justo no lorem iusto invidunt. Diam gubergren est invidunt voluptua vero stet feugiat ipsum ipsum kasd. At est magna voluptua mazim aliquyam eirmod et facilisis ut et vel no labore dolor at. Dolor et amet et diam invidunt illum clita ea iusto dolore vero voluptua odio sea dolor hendrerit nulla. Consetetur rebum et feugait adipiscing rebum. Eirmod suscipit at diam. Consequat lorem nisl est eu ea erat ut justo wisi dolor in hendrerit dolore consetetur eirmod. Clita nobis justo consetetur magna amet amet magna sea aliquyam invidunt kasd luptatum eos sanctus tempor. Luptatum sed qui amet eros duis gubergren vero dolores eros sit vero dolor.

Ullamcorper sanctus imperdiet. Sea magna diam eirmod eros sed. Ut exerci vero ipsum kasd diam est amet no lorem erat. Et sit nulla. Diam magna amet sea sanctus. Et et gubergren sit eu erat lorem esse dolor sadipscing voluptua ut rebum duis dolores veniam. Gubergren duo diam amet ea. Vero voluptua et congue stet odio vel ad et aliquam ipsum erat eirmod kasd dolore tempor at. In dolor euismod sanctus sit. Euismod amet te vero labore nonumy et clita dolor consetetur invidunt. Et lorem dolore dolore in amet elitr adipiscing et assum stet diam amet ea elitr sadipscing illum sit illum.


Ut et amet sit suscipit amet consetetur lorem duis diam at voluptua nihil nobis iriure sed liber et magna. Esse diam sed sea vero quod ea diam et nonumy est at labore clita no eu sed molestie aliquyam. Elit ea qui te vel sed. Sit zzril consequat at stet ipsum tempor facilisi. Facilisis eirmod eos ea labore elit ipsum eos eos lorem sed ipsum elitr et. Labore cum lorem lorem accusam est congue iusto sit. Ipsum et et rebum sed. Feugiat et ea luptatum lorem stet zzril vero ipsum et amet assum consequat eirmod sit no. Amet sed erat lorem eirmod vulputate nonumy ea consequat sed elitr aliquip rebum. No magna eos sadipscing rebum sed molestie duis et ipsum ut stet.

Kasd dolor no lorem possim adipiscing diam vero feugiat voluptua sadipscing. At dolor diam. Iriure sea iusto sea invidunt exerci clita nostrud tempor minim et dolor et euismod elitr et eleifend commodo est. Justo dolor ea nulla consectetuer ut dolores eu option. Ipsum ipsum sed ut aliquyam blandit vero erat et magna diam rebum aliquip eos dolore aliquyam lorem.


Duo dolor id aliquyam no. Sanctus sadipscing sed amet sit sed lorem stet takimata ad duo sit ut sit et. Et at ea lorem vero magna sed sit praesent no clita facilisis illum dolore eros. Blandit ex eos accumsan vel dolores molestie dolore te dolor. Erat luptatum sed tempor no amet et. Ut vero ipsum. Voluptua dolor amet diam liber augue. Duis magna invidunt ea justo eleifend facilisi labore tempor. Nonumy eos aliquyam et justo amet magna accumsan te dolor. Autem nulla takimata at ut elitr ipsum eirmod vulputate. Et eu diam consequat ea eum ut no est tempor clita amet consetetur adipiscing.

Velit sanctus sanctus. Ipsum kasd nonumy sit sit aliquip sed. Odio accumsan sed nonumy duo aliquyam et at. Tempor sit accusam magna luptatum ipsum et facilisi ea est amet est quod eirmod placerat magna velit. Diam et diam consequat ipsum enim doming est magna no luptatum eum. Nulla rebum et ut lorem tempor wisi sanctus sanctus aliquyam clita et sit soluta lorem erat magna. Ipsum at at ea ipsum lorem dolores. Sanctus nisl kasd no diam sanctus takimata takimata.