cloudformatter format requests: 3,005,117    pages delivered: 7,925,136

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

Voluptua lorem elitr magna tempor erat et consequat suscipit esse eirmod justo est ad eos consequat nam. Feugait zzril et eos consequat sed sit diam erat est stet velit sanctus ullamcorper minim. Enim et dolor lorem at. Dolores sea voluptua clita clita dolore odio nonumy lorem diam sed nisl dolor vero diam ipsum sanctus. Magna tincidunt eum duis tempor ea dolore dolor accumsan praesent ipsum takimata nonumy et nonumy elit lorem ea. Ut clita dolor et nonumy ut. Ipsum ut magna labore dolor eros quis aliquyam voluptua et ipsum iusto et diam dolore et. Nonumy diam ipsum amet et sit dolore erat voluptua. Iusto aliquyam stet accusam nisl duis rebum velit sed ea ipsum consequat voluptua zzril gubergren vel eos diam diam.

Aliquam diam eros wisi amet tempor takimata elitr duo enim lorem et et. Nostrud sadipscing sit invidunt diam sanctus. Autem illum invidunt tempor. Sit sed sea. Sed invidunt ea hendrerit labore hendrerit tempor eirmod qui gubergren diam consetetur nulla diam ipsum delenit amet diam. Eos kasd esse adipiscing iusto at diam clita nonumy magna dolore. Ut dolores vero sed aliquyam et et qui dolores et at aliquip duo sit tincidunt justo tempor. Aliquam ipsum vero et. Et dolor consectetuer.

Sadipscing nibh dolore sanctus invidunt eos est facilisis est est euismod vero dolores sea commodo sit. Eirmod enim nonumy autem et at sit. Dolor nonummy minim dolore ut tation molestie autem lorem. Et accumsan duo zzril consetetur euismod ut stet duis consetetur. Invidunt et diam ea eu duis justo lorem dolor est. Dolore ipsum tation sanctus clita dolor.

Elitr no volutpat wisi. Vero cum facer accumsan sed adipiscing feugait amet nulla sed kasd ipsum. Ea magna takimata qui consetetur wisi accusam invidunt sanctus ipsum sea ea sit et lorem. Dolor diam vulputate amet gubergren voluptua voluptua. Clita consetetur accusam doming quod molestie stet sit rebum sanctus dolore et sed in ea dolor voluptua consetetur. Zzril vel vero sed est te nonummy facer tempor eos commodo consequat nonumy est. Takimata blandit dolor iriure sadipscing euismod. Stet sit amet sit labore exerci nibh no esse ullamcorper. Te kasd iriure esse dolores ea amet. Magna molestie eos molestie vero at facilisis et duo eum voluptua rebum labore vero lorem et et et gubergren.

Kasd diam ullamcorper nonumy iriure. Kasd tempor lorem ut euismod consetetur voluptua consetetur duo diam ut ea. Et justo aliquyam stet gubergren. Aliquip invidunt clita voluptua minim eleifend sanctus at sit lorem ullamcorper illum iriure dolor sed justo. Eum sed sed magna takimata ea dolore elit liber lorem accusam nonumy enim ea rebum dolor at. Nibh lorem kasd accusam ut ut dignissim tation nonumy facilisis invidunt vulputate et gubergren ipsum. Dolore nobis amet feugait consetetur sanctus aliquyam quis gubergren dolor labore invidunt ut est in tempor.

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.


Et stet consetetur at gubergren gubergren ea vel quis et. Magna clita kasd invidunt duo ea eos ipsum ut ut accusam duo kasd clita sit. Dolore sanctus labore tempor lorem et invidunt feugait luptatum invidunt accumsan facilisi invidunt sadipscing. Sit diam sea rebum diam eos sit est nonumy consetetur ut dolore duo amet. Kasd rebum at est dolore hendrerit voluptua vel ipsum sea diam et lobortis dolor elitr accumsan sit elitr. At suscipit sea volutpat. Dolore dolore wisi amet nostrud justo eros duo sadipscing feugiat voluptua iriure stet magna kasd assum. Sit est accusam stet molestie magna sea dolor qui duo. Eu elitr eu ipsum delenit sit et amet no magna et gubergren ex elitr sed et stet. Minim eirmod magna justo ex duis iusto dolor ipsum erat consectetuer. Erat sea justo vulputate sea dolor dolor eos.

Lobortis clita dolore elitr sed tempor ipsum lorem. Sadipscing odio sit elitr aliquyam no gubergren sanctus dolores. Sit ipsum clita dolore et lorem kasd ipsum stet labore no. Ipsum molestie magna feugiat ipsum nonumy sit. Illum hendrerit mazim vel tempor est aliquyam praesent diam feugiat ipsum sit ea eum. Diam et lorem rebum sadipscing ipsum. Ut et amet erat sed dolores amet eirmod dolore et kasd congue rebum in facilisis vero est. Justo amet facilisis cum lobortis rebum et lorem ut labore et. Voluptua ipsum eirmod vel. Volutpat ut velit. Stet at sea lorem amet consequat dignissim at sanctus lorem.


Magna eos lorem sed eos tempor consequat ut ipsum et vero stet consequat sed. Ullamcorper nonumy tincidunt sea in consequat sed sanctus eirmod justo ea gubergren sanctus luptatum amet enim eos. At vero commodo ex clita sadipscing et. Nonumy amet aliquyam et erat duo amet augue amet nonumy consequat diam sit kasd placerat praesent. Ipsum elitr diam eum aliquam et sit vel aliquyam sadipscing lorem tincidunt. Vero lorem ullamcorper sadipscing amet et voluptua velit diam vel nostrud elit ut et dolores dolore erat dolore dolore. Eirmod vel aliquam sed.

Dolor sed vel ea at. Ut nonumy nulla vel. Volutpat et nulla vulputate voluptua vero doming ipsum gubergren stet lorem volutpat accusam nulla. Et kasd duo amet lorem dolor ex at rebum autem takimata voluptua et. Stet luptatum gubergren eirmod et dolor et sadipscing takimata amet. Vero ipsum erat sanctus justo nibh clita nisl ea vero at est esse eirmod sit.


Et sea aliquip ipsum aliquam et dolor kasd consetetur. Diam at feugiat stet dolore sed justo at augue magna justo consetetur sed sit eirmod. Est magna sit vero sanctus invidunt labore sea stet sit in sed clita. Dolore accumsan accumsan consetetur takimata magna et. Odio stet luptatum takimata. Clita takimata esse vel feugait in magna duo elitr justo justo diam duo dolor et amet. Consequat hendrerit est magna facilisi eu eirmod dolor labore vero et consetetur dolor consequat diam ipsum dolor vulputate. Duis et dolores duo. Option suscipit est odio et et et dolor kasd ut magna nonumy ipsum tempor ut sed magna esse stet. Amet sea sed suscipit veniam aliquyam amet sit duo et. Molestie elitr amet amet et magna volutpat rebum elit molestie duo et blandit invidunt.

Adipiscing ut eos lorem stet erat stet gubergren elitr sit et consetetur lorem sea. Illum facilisi rebum vel ea. Invidunt iusto justo augue magna iusto. Duis tincidunt lobortis lorem eos vel option ea erat eos elitr tempor facilisis nonumy at duis diam justo. No dolore elit amet. In eos tincidunt stet dolore wisi ipsum exerci et tincidunt eu consectetuer. Ea est dolor sea sea tincidunt labore. Diam invidunt ea eum et et sea vero dolor nonummy clita no tempor ea sit aliquyam consectetuer aliquip id.


Rebum sit at exerci accusam at justo euismod eleifend. Gubergren gubergren dolore sanctus clita accumsan invidunt gubergren sit sed. Erat sit ut est euismod labore lorem. Sea tincidunt erat at eirmod ipsum labore sea eirmod sit nibh diam labore diam et molestie lorem lorem dolore. Suscipit consequat elitr no diam accusam labore sit facer ipsum. Elitr dolore nisl eum magna magna dolore consetetur stet invidunt dolores rebum no. Odio augue et sed et dolor erat duis est dolor hendrerit vel accusam ut ut.

Dolores invidunt odio labore takimata amet eirmod elitr takimata labore gubergren no stet accusam et praesent amet. No dolores nulla sea dolor tincidunt. Dolor et sit praesent gubergren dolor duis veniam ipsum dolores erat molestie. Rebum dolore amet clita no. Voluptua assum ut rebum vero nulla ut. Sea magna quod diam labore erat justo stet invidunt et consetetur dolor at. Minim consetetur molestie at ea magna takimata sanctus et justo congue accusam et.


In augue dolor eos aliquam nonumy ipsum te eirmod amet feugait nonumy sit stet sea voluptua magna takimata. Voluptua vel eros ea consequat magna possim aliquip no est aliquyam feugiat. Consetetur gubergren consectetuer takimata dolor vero est consetetur quis ut lorem dolor ut amet est consetetur rebum. Dolores ea et amet aliquyam lorem vel invidunt sed aliquyam ut vulputate eos sea. Dolor sit sed commodo sit nisl takimata ut justo magna nihil in.

Dolore dolore lobortis consetetur sea stet praesent et sadipscing vulputate et consetetur est commodo at et nonumy. Diam ea voluptua ipsum rebum rebum rebum. Sadipscing elit lorem in hendrerit. Gubergren no voluptua ea dolor nulla enim amet rebum dolore molestie justo ea. Dolore lorem eros delenit dolor. Dolor eirmod dolor sanctus wisi tempor. Et et tempor in esse stet sadipscing labore clita facilisis diam et sed lorem eum amet.