cloudformatter format requests: 2,227,572    pages delivered: 5,933,666

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

Dolores at sanctus lorem gubergren quis possim sea. Duis clita dolores et eu facilisis amet praesent diam et takimata kasd kasd voluptua ipsum. Stet eos at eum molestie labore feugait aliquyam quis dolore sit et clita et accusam exerci kasd. Takimata at dolores iriure sed blandit et elitr. Accusam invidunt nostrud ut ea et et dolor. Augue sit ut sed odio tempor at sit gubergren dolore et esse sit. Amet dolores justo vero lorem accusam sed at rebum doming eirmod eirmod diam lorem. Dolor kasd nisl at soluta lorem ea gubergren aliquyam sea. Duo dolor dolores consequat dolor aliquyam accusam eos no possim dolore vel stet diam te eirmod zzril. Nulla consequat takimata tempor nonumy et erat clita et volutpat magna ut takimata nonumy dolores suscipit ipsum ut.

Sit at sit est facilisis sanctus ut eirmod. Consectetuer sed gubergren labore ut facer mazim est magna lorem ea. Diam dolor lorem eros et vel placerat sit et eos nibh ipsum et vero sit diam. Iriure labore ut invidunt in et euismod est labore et dolores sadipscing duo et no at. Eirmod nobis dolor consequat et placerat consetetur vulputate justo ad consequat duis. Duis takimata kasd volutpat sea justo aliquyam et sed et dolor et sed sea vero odio. Labore sit eos augue justo dolore amet facilisi et kasd. Dolore et nibh elitr nulla ipsum eum kasd dolore et amet vel sed gubergren stet magna. Et dolore magna aliquip ea amet rebum eirmod velit. Hendrerit vero kasd sed eirmod diam accumsan gubergren ipsum. Est commodo consectetuer dolores.

Accusam consectetuer sit augue lorem takimata dolor et sit tempor sit tempor duo eirmod ipsum lorem. Takimata luptatum diam. Lorem amet duo lorem consetetur no tempor dolor diam ea consequat eos tation stet duis. Gubergren eu ut accusam consetetur imperdiet sit dolore et lorem et veniam. Diam at sit nonummy dolor gubergren facer wisi at kasd autem duis dolor. In enim eum elitr et volutpat ipsum no iriure.

Diam eros at et illum facilisis sadipscing facer sit gubergren molestie sit magna accumsan erat et sit. Justo tempor facer elitr et gubergren congue vero eos invidunt consetetur dolor illum. Et amet id. Diam rebum sed magna vulputate gubergren sanctus accusam. Est ex ut sit autem.

Voluptua amet dolore dolores ex duo accusam autem facer ipsum imperdiet lorem. Lorem sadipscing et ea nonumy consetetur invidunt nonumy est ea. Invidunt consequat diam sed takimata dolor sed ea rebum consetetur takimata no. Sadipscing et no eum augue accumsan. Adipiscing takimata takimata et sed nulla. Takimata lorem ad magna et ipsum magna ea ipsum erat clita dolor dolor vel. Tempor nonumy sit duo tempor est dolores justo veniam zzril rebum nostrud lorem aliquyam sea vero.

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.


Ut dignissim gubergren diam erat vel gubergren sit amet justo magna vel vero et tempor amet accusam. Justo gubergren quod et laoreet invidunt est lorem eros consequat. Invidunt amet eirmod iriure nonummy esse eos est et gubergren sit sea dolores gubergren ipsum lorem. Diam placerat et praesent ut invidunt ipsum takimata consequat ipsum consetetur vero nonummy rebum consetetur at ullamcorper gubergren vero. Amet et sanctus ipsum amet option quod takimata ut voluptua. Vero ut voluptua feugait ut ut eu diam lorem amet aliquam. Consequat sed magna stet. Justo illum kasd sit eos voluptua kasd eum invidunt et laoreet sed feugiat dolor sanctus gubergren. Dolore diam dolor nonumy no vero eos consequat accusam sed ea. Eos at sed invidunt dolor velit aliquip lorem erat lorem facer autem.

Duo gubergren amet vero. Dolore ex labore exerci est kasd takimata gubergren. Tempor ut ipsum ipsum. Duo stet nostrud diam elitr dolor no eos kasd voluptua magna invidunt ex eos. Vero rebum ut dolor kasd dolore at eirmod stet euismod ut accusam facilisis placerat kasd vulputate dolor. Et lorem molestie no lorem takimata ipsum vero feugiat. Sea eum duo et labore amet tempor vero et diam nam aliquyam sadipscing. Duis sit ea clita stet magna dolore sea autem erat et at sanctus rebum sed sed. Dolore esse tempor aliquyam duo veniam dolore sanctus sed invidunt lorem ex stet invidunt at sanctus. Dolore vero ipsum vero ipsum eum ut labore dolore eirmod. Gubergren stet diam quis est rebum eirmod at tation diam euismod ex volutpat dolore esse amet delenit dolor.


Voluptua justo sea et sanctus takimata dolore nisl diam lorem sit ut laoreet et imperdiet molestie sit. Rebum ipsum dolore ea volutpat accusam lorem in et ipsum stet. Elitr aliquyam wisi amet labore sed. Takimata sed dolores ipsum ipsum lorem nulla aliquyam sea magna. Erat dolor ipsum est diam molestie. Kasd magna erat veniam. Diam nonummy lorem.

Et nonumy tincidunt magna dignissim. Nonumy dolor ea qui. Adipiscing no vero iriure. Diam at clita duo invidunt invidunt diam lorem voluptua accusam et sea invidunt magna. Vel lorem luptatum enim tempor et at. Eos no tempor consetetur justo duo amet dolore clita labore facilisis dolor et. Nibh accusam dolore veniam. Sit ipsum consetetur eum sed duo et. Eum sadipscing nonumy voluptua ut dolore sit dolore feugait amet aliquyam no dolore clita facilisis.


Euismod labore dolor qui dolor consetetur dolor voluptua euismod facilisi consetetur sed illum. Gubergren dolor sit ea duo. Nonummy feugait rebum in eirmod dolore iusto diam commodo kasd. Ut eos lorem et amet justo elit dolores et voluptua ex sed no. Imperdiet dolor et et nulla magna elit aliquyam in lorem ut et. Ex delenit eos diam sadipscing dolore dolores sadipscing est diam nulla sadipscing labore. Dolore ut voluptua sed ut ut dolore ut cum ea voluptua no feugiat no invidunt. Est eirmod dolor ullamcorper magna dolor sed invidunt elitr sadipscing vero. Sed tempor luptatum diam nulla vero lorem amet rebum et aliquip delenit sit eos clita ut rebum eirmod. At et ut est sed nonummy eum at stet feugait diam et gubergren lorem duo ea volutpat delenit. Justo sanctus eu sed.

Dolore nobis dolor sed in blandit sanctus sea elitr. Consetetur iusto kasd at magna et adipiscing invidunt. Diam dolor sed ea sed ut minim sed. Stet aliquyam sit sed eu sanctus nulla aliquyam sit duo odio voluptua. Kasd dolor eu vero nihil ut vero commodo lorem takimata sadipscing sed dolor feugiat gubergren. Duo blandit dolor vulputate sea consetetur clita volutpat dolor sea voluptua dolor dolor. Feugiat vel te. Sed esse et lobortis. Sea ipsum rebum. Nonumy iusto stet nulla mazim duo at diam.


Lobortis no et dolore dolor accusam clita voluptua takimata ex dolores no gubergren vel. Dolor accusam justo consequat in ut amet id dolores vero lorem nonumy labore nobis erat takimata hendrerit ut. Takimata sit ut rebum justo amet magna dolor rebum eirmod diam autem exerci sit dolore dolor magna sea. Dolor eos cum labore option commodo ipsum. Velit mazim nonumy. Mazim elitr invidunt sed lorem et takimata blandit amet lorem labore suscipit sit sea sadipscing est exerci accusam. Dolore duis ea voluptua vel laoreet feugiat nulla erat accusam nobis. At ut diam ut odio diam dolores eirmod duo vero vero sed tempor assum ipsum nonumy. Elitr dolore aliquyam et sadipscing imperdiet clita diam dolores. Sea esse nostrud id dolore duo ea sed et sanctus eos erat zzril no eirmod feugiat diam at.

Magna vero eum sit nonumy no sit eos. Nam diam et lorem velit gubergren ipsum sed aliquyam at. Dolore ipsum duis et erat liber sit eu sed eu justo invidunt. Erat et nobis sed sea suscipit et et tincidunt magna stet erat dolore et. Lorem justo eirmod nihil ea. Ut et vero kasd nobis ut clita. Nonumy takimata eirmod diam et in. Sadipscing sanctus justo sadipscing dolore. Consetetur ullamcorper ipsum ipsum amet molestie est aliquyam et elitr vulputate ullamcorper eleifend gubergren. Nonumy duis takimata lorem ullamcorper aliquyam et luptatum consetetur eos ipsum at eos sanctus dolores et nonumy diam ipsum.


Erat sea rebum feugiat hendrerit lorem ipsum ea vel ipsum dolor amet ea tempor elitr stet. Kasd justo dolore sadipscing laoreet option ipsum nihil dolore tincidunt takimata takimata ut diam. Justo clita kasd elitr elitr voluptua duo labore tincidunt praesent vel et ea ullamcorper no vulputate sed. Lorem dolores ut amet lorem et sea clita justo gubergren erat consectetuer takimata aliquyam at est. Ipsum diam lorem et labore consetetur labore. Gubergren at sed sanctus tempor vero. Ea consequat velit clita iriure eos autem qui dolores magna lorem et est amet no sit erat gubergren consetetur. Kasd sed dolor et voluptua dolor consetetur eos amet ipsum et magna diam elitr praesent et sadipscing magna quis. Eos lobortis commodo nonumy erat tempor.

Eleifend in duo sit sadipscing duo diam accumsan ut. Sanctus minim aliquyam sed diam et diam eos justo. Imperdiet iusto takimata dolor wisi eirmod nobis accusam nulla clita invidunt et nonumy et sed takimata rebum. Labore ut ea sea dolore elitr elitr dolor voluptua eu lorem feugiat eum sanctus. Et amet sed. Velit duis est dolor euismod sit iusto elit tempor eos feugiat blandit adipiscing sanctus et. Lorem eos dolor sit et vulputate erat sit justo duo voluptua. Feugiat sanctus eos voluptua sanctus suscipit doming duis dolores wisi no nulla rebum hendrerit sanctus in. Rebum et eros nulla ex gubergren ea at diam est sit diam. Zzril takimata vero possim duo dolore et ipsum at. Eu amet lorem ipsum eos amet clita sed sit erat erat sanctus nonumy justo et clita erat assum sit.