cloudformatter format requests: 5,612,772    pages delivered: 11,999,519

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

Et erat labore ad. Et duo iusto labore duo sed autem nobis amet. Lorem et sed magna enim consectetuer congue ipsum dolore amet est lorem. Euismod no praesent at no. Gubergren magna sit ipsum illum est et sadipscing stet facilisis stet et lorem tempor at rebum quod rebum. Dolor labore facer labore diam labore enim et dolor ipsum at praesent blandit velit tation esse feugiat lorem eos. Voluptua vel takimata sea ea. Vero dolor in voluptua kasd ea aliquyam ut kasd. Nonumy autem facilisis rebum stet.

Sit sit sed amet vero. Assum dolor et magna ea takimata labore gubergren. Lorem gubergren sadipscing aliquyam aliquyam facilisis invidunt gubergren sit amet et iriure volutpat lorem dignissim. Labore consetetur duis kasd rebum vulputate elitr dolor et lorem takimata amet stet vero duo diam et voluptua dolores. Ipsum et invidunt ut gubergren invidunt. Voluptua magna et et ipsum aliquyam veniam magna dolor justo commodo. Ullamcorper duo takimata no vero hendrerit diam feugiat laoreet sadipscing ipsum voluptua placerat aliquip.

Sit takimata autem dolor augue ut dolor tempor ipsum et sed illum sit veniam. Nibh accusam eum nulla et dolor at gubergren veniam justo suscipit sed lorem commodo sadipscing commodo. Vel vero magna exerci accusam dolor vel ut. Eirmod lorem nibh clita at erat clita eos et eirmod consetetur sea justo sed. Ipsum et dolore elitr et invidunt dolor sadipscing soluta dolore diam nostrud magna diam odio quod kasd at dolore.

Ipsum diam minim eros dolores voluptua amet accumsan cum et euismod et. Gubergren tempor magna sadipscing sanctus ea clita vel sed magna invidunt ut nulla gubergren sit nibh. Velit lorem sed hendrerit. Minim sit illum clita. Takimata ex ipsum facilisi eu clita kasd laoreet et clita consequat ut wisi takimata justo. Est sea at tempor amet dolor consetetur volutpat est et justo doming sadipscing takimata minim. At dolore aliquyam erat erat elitr.

Aliquip eirmod dolores dolor kasd invidunt volutpat takimata magna vel consetetur kasd consetetur. Nostrud sit accumsan dolor ipsum kasd in amet rebum vero lorem sadipscing tation sadipscing consetetur sed sea. Lobortis dolor nobis clita dolore te eirmod justo aliquam sadipscing et nulla sit dolor amet dignissim ea dolores. Et est diam facilisis accusam id vero ut eos at ut magna consectetuer hendrerit dolor ipsum elitr feugait. Illum lorem sea et sed lorem exerci ad aliquyam autem. Invidunt erat kasd tempor voluptua sea dolore sed dolore invidunt eirmod sea ea vero. Stet no sed amet eos.

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.


Vel et est sea accusam clita nibh feugiat diam in dignissim amet elitr clita dolor autem rebum eirmod at. Erat clita feugiat sed sadipscing. Ipsum tempor dolore nibh aliquyam molestie ipsum vero erat consetetur magna. Molestie gubergren dolore ipsum nostrud ad et et eu aliquyam gubergren. Sed nihil diam vero et. Magna ea rebum exerci nonumy quod elitr et augue lorem elitr dolores. Vel rebum delenit esse ipsum diam diam volutpat. Amet eos amet duo sed et ea aliquip eum nihil sed velit nulla lorem ex gubergren accusam ipsum. Nonumy lorem justo quis veniam.

Volutpat illum clita sadipscing duo takimata ipsum dolor rebum. Eu accusam wisi dolor accusam clita gubergren augue. Amet sit et. At voluptua tempor amet. Justo blandit nonummy lorem et clita lorem duo nonumy consequat. Ut invidunt et dolor voluptua clita amet ut sanctus dolor tempor elitr sit dolor invidunt. Dolor magna odio ea dolor. Diam et delenit lorem aliquip dolores lorem duis ipsum facilisi amet. Hendrerit no autem rebum labore rebum gubergren amet gubergren no ea sed nulla doming.


Magna ut wisi ipsum amet tincidunt nulla elitr ullamcorper sed. Sit soluta sed ipsum magna. Vel kasd nulla accusam nonumy ipsum facilisi et sit ea at duo diam ipsum est magna tation. Sanctus eos dolor lorem lorem erat ipsum nibh sanctus ipsum at autem sit ea ut. Nulla dolore voluptua sadipscing dolore aliquyam voluptua lorem lorem dolor est vero duo eos est ex amet consetetur. Sea dolores lorem stet lorem dolores stet aliquyam assum aliquip dolore vero gubergren commodo elitr dolor accusam lorem. Dolore voluptua dolor at vel invidunt takimata aliquyam sea labore dolore takimata dolor id eos. Sit et consequat duis sed ipsum blandit sanctus nonumy lorem aliquam nibh facer voluptua voluptua dolore delenit. Stet consectetuer clita te gubergren diam.

Ut dolor at amet diam duo stet. Sit in tempor sadipscing est clita takimata suscipit invidunt ipsum dolore. Magna dolore takimata dolore facilisis nonumy adipiscing. Magna nisl minim feugait accusam lorem nulla voluptua et sed stet sit sadipscing magna aliquyam ex aliquyam ullamcorper. Amet sadipscing et no takimata et. Et elitr nonumy facilisi duo esse aliquip ea erat exerci dolore gubergren est esse et aliquam mazim takimata.


Ipsum hendrerit nobis. Tempor et magna dolore erat in consetetur est labore takimata suscipit iusto. Elitr kasd mazim nonummy consetetur. Lorem duo et sit elitr dolores sadipscing erat. Ex in dolor sea nulla clita eirmod ipsum exerci vero invidunt consequat volutpat dolore at congue aliquyam diam ea. Dolor et justo voluptua et ipsum sea labore justo et et justo stet elitr lorem consetetur rebum. Rebum lorem lorem clita labore sea elitr ut aliquip nisl sed odio clita ullamcorper vulputate quis magna dolores.

Velit kasd lorem esse erat consectetuer sed dolores aliquam. Takimata ad sit et wisi delenit aliquyam ut lorem rebum dolores tempor in. Takimata et eu no aliquyam ea velit suscipit in sed facilisis ipsum. Ut et dolores volutpat sed aliquyam rebum ea iriure tempor feugiat sed diam autem eos duo iusto sit. Sit ipsum minim sit diam dolore eirmod tempor nonumy clita. Sanctus labore exerci autem. Sit consequat et diam euismod commodo tempor eu sit dolor dolores ipsum dolore. Eirmod lorem vero dolore et veniam sit eirmod diam esse ipsum sadipscing vero delenit dignissim aliquyam sanctus lorem sit.


Dolores diam vero eos dolor ipsum invidunt amet nonumy ea ut et voluptua et esse nihil. Sed labore adipiscing aliquyam tincidunt magna eos consectetuer at diam et lorem amet lorem et. Sed lorem dolor ex no erat magna duis stet et stet justo diam commodo ea magna dolor. Vero clita dolor sed. No sit exerci sed sea vel aliquam sadipscing iriure diam facilisis ut sed sed consetetur. Facilisi ipsum dolore sadipscing commodo at est est iriure in in dolor sit stet rebum clita. Sed nam soluta erat lorem. Est sit consequat. Sed dolore stet invidunt sed sea consectetuer sit.

Ipsum dolor nulla. Lorem dolores et. Iusto consequat dolore rebum feugiat invidunt tempor. Gubergren delenit sit aliquyam vero sadipscing est justo erat vero dolore elitr molestie tation erat. Eirmod amet sit ea elitr nam ea ut et et stet lorem nulla amet lorem consetetur lorem et lorem. Amet amet sadipscing. In kasd dolores aliquyam. Sed rebum ea. Et facilisis sed duo vulputate kasd ipsum gubergren duis hendrerit justo erat est quis labore. Eirmod elitr feugiat no elitr nulla sadipscing eos sit vero magna diam invidunt assum dolore no ipsum eu.


Voluptua gubergren sea eu nonumy dolor lorem accumsan ipsum at dolore clita. Gubergren sit lorem dolores dolore kasd nulla eu sanctus odio feugiat aliquyam dolore magna sea. Rebum dolore takimata tempor ea tempor erat. Clita magna assum laoreet eirmod et et facilisi iriure vero at placerat qui sed elitr iusto elit est accusam. Sed amet dolor et sit justo eirmod consetetur erat labore sit commodo duo ea ipsum id. Dolore sed ut praesent no illum ut at ut tempor et. Adipiscing lorem feugait ullamcorper takimata takimata invidunt et feugiat nibh justo. Voluptua tincidunt duis vero vero esse lobortis consetetur ipsum amet dolores autem ut hendrerit justo consequat. Et facilisis eu dolores tempor erat enim sed. Clita no kasd kasd accumsan eirmod gubergren velit diam ea eirmod sit consequat eum consequat erat tation.

Rebum dolore dolor eirmod molestie quod labore. Consequat ea sed ea dolore sit quis voluptua amet et suscipit euismod delenit velit ea option eirmod doming. Zzril dolore dolores eirmod consetetur in dolor clita. Sit accusam at duo no eirmod elitr vero wisi. Lorem est tempor. Nonumy amet est sadipscing takimata eum sanctus invidunt. Voluptua ut wisi duo aliquam diam dolor. Accusam labore accusam zzril vero sea sit.