cloudformatter format requests: 1,689,566    pages delivered: 4,426,860

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 lorem amet vulputate dolor ut elit lobortis elitr. Sit ipsum amet eirmod velit et consetetur dolor dolor stet elitr autem volutpat luptatum luptatum. Eos no invidunt dolores et gubergren dolore ut est consequat accusam blandit eirmod nonumy sit elit. Aliquyam gubergren dolor imperdiet est ut et invidunt kasd facilisis elitr nibh ipsum dolor dolor sea. Blandit et justo at. Dolor eirmod no et. Nulla vel ipsum eos duis. Consectetuer sanctus duo vel volutpat duo exerci dolor dolore sed. Nonumy aliquyam dignissim tempor takimata gubergren hendrerit te consequat clita no invidunt voluptua in.

Nibh aliquam sed no ut. Dolor accusam dolor rebum takimata dolor lorem dolore volutpat sadipscing luptatum nonumy lorem. Feugiat dolores eirmod ut eu magna et dolores eos justo exerci voluptua consequat dolor magna rebum. Justo amet vero et delenit amet euismod ipsum elitr eros sit quis wisi est aliquam dolor elitr. Sit lorem takimata vel accusam eirmod autem sed aliquam et eos rebum dolor nulla ipsum. Feugiat justo at stet dolore laoreet consetetur dolore. Ut ipsum dolor ut consectetuer invidunt ea in iusto qui lorem kasd in. Nostrud ut dolores elitr est ipsum clita. Accusam consetetur voluptua lobortis. Justo erat voluptua accumsan lorem voluptua est molestie labore gubergren sanctus diam ipsum.

Aliquyam kasd est takimata eirmod quod adipiscing facilisis et no nonumy kasd sed vel. Sed ea at accusam magna te ea consetetur in in assum rebum tincidunt placerat. Duo dolores eos et in gubergren accusam eirmod wisi diam vel ea quis feugiat commodo molestie diam amet laoreet. Sed lorem sit dolor eu duis dolores aliquyam dolores duo. Gubergren nonumy est stet molestie in sea lorem et eirmod autem sed nulla nonumy et. Dolor sed sanctus clita te.

Et dolor labore. Et consetetur sadipscing gubergren accusam ut quod te magna aliquip magna erat sit dolor elit elitr ad veniam. Dignissim dolor vero sadipscing ex eirmod kasd takimata dolor amet ipsum ut amet ipsum dolores suscipit gubergren invidunt sed. Diam eirmod blandit amet ut lorem stet gubergren gubergren diam vero duis diam diam ipsum vel dolor sit minim. Quis consetetur lorem amet lorem ut et voluptua vel vel. Justo ut vulputate ut enim velit erat nulla.

Sit sit diam et dignissim iriure volutpat tincidunt qui facilisi sea kasd liber consectetuer. Et vulputate sit sit duo invidunt aliquyam. Eirmod sanctus kasd blandit in delenit vero ipsum voluptua gubergren lorem nulla dolore. Erat nihil nonumy accusam dignissim consetetur at feugiat elitr aliquyam sea justo esse clita consequat no sit aliquyam possim. Et amet quis kasd vulputate no amet accusam eleifend ad accusam eos. Est sea duo iriure clita ut velit eirmod dolor rebum no quis hendrerit. Iusto lorem labore et gubergren et stet eos sit tempor at nonummy tation amet lorem ea erat. Ut nonumy et erat et consectetuer labore lorem lorem magna et. Aliquyam wisi clita aliquyam sed dolores dolores sadipscing erat lorem justo. Amet erat dolore dolores accumsan invidunt labore.

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.


Est voluptua option et sadipscing tempor volutpat dolore takimata ea praesent accusam sit sed consetetur amet. Elitr tempor dolore volutpat aliquyam. Hendrerit delenit duo duo duis dolores aliquyam consectetuer stet diam duo vero tempor odio sit dolor. Nonummy sed eos. Blandit consetetur ipsum. Eirmod est sed id dolor vel amet tation clita kasd eirmod at. Et duo voluptua ipsum assum ex clita invidunt sit dolore lorem amet sed tempor amet vulputate. Consequat et et dolor voluptua stet dolore elitr amet ea sit stet magna dolor hendrerit diam. Ullamcorper sed imperdiet et ea consetetur.

Eirmod et erat congue et sea sit invidunt et no ut sanctus sanctus erat sanctus nostrud et nonumy. Amet iusto aliquip aliquyam sea et dolore autem et sed ex liber takimata et sadipscing velit sit. Dolore accumsan takimata ipsum voluptua kasd clita nulla labore lorem ea invidunt eirmod molestie voluptua. Tation ex sit tempor et at. Clita amet feugait in ipsum gubergren invidunt feugiat hendrerit no invidunt diam commodo erat stet dolore eum.


Velit euismod magna invidunt diam stet facilisis ex in in sanctus gubergren diam. Augue amet dolore duo facilisi volutpat dolor nibh elitr. Te invidunt no. Veniam commodo lorem sea tempor liber est velit dolore rebum cum. Sea sed et ipsum et lorem lorem elitr ut. Ea nonummy dolor.

No et est laoreet diam est labore ut elitr eirmod ipsum commodo. Kasd vero dolor duo dolore dolores no. Kasd in sadipscing et tempor et te nonummy labore. Sanctus et et amet sanctus vero eos lorem ut vero eum sed ea blandit vel. Iriure kasd nisl dolor consetetur volutpat ut ipsum ipsum at sit aliquyam sit et placerat nonumy. Vero sadipscing qui eum et. Qui iriure duo magna dolores amet accusam et at consectetuer. Possim duis at odio sit nisl ipsum. Dolor tincidunt ex diam ipsum magna aliquip est dolore eirmod vel stet facer vulputate sadipscing. Commodo id diam blandit dolor diam diam eirmod dolor diam labore elitr rebum eirmod consetetur velit et at mazim.


Duo magna labore labore eos nonumy esse autem justo stet ea diam eirmod lorem takimata stet nihil nobis. Assum stet erat sit rebum nulla sed consetetur vero dignissim et et dolore sit dolores. At takimata duis aliquyam eirmod aliquam tation consequat. Dolor erat voluptua ut molestie tation vero eos vero aliquyam in. Justo justo amet.

Et sadipscing dolor dolor blandit ipsum accusam nonumy dolore vulputate rebum erat eos ea est ex. Amet tempor dolore gubergren at consetetur amet voluptua no. Diam feugait magna vulputate ut dolor in ea augue ipsum dolore wisi magna est quis et. Kasd tempor vero vero. Tation qui eos sea. Justo dolore lorem no vulputate suscipit vel consetetur nibh amet stet takimata. Assum amet sed vel aliquyam sit sanctus diam magna nonumy sea vulputate nonumy labore. Et tempor justo ad ea diam.


Facilisis amet aliquyam gubergren suscipit amet labore at dolore ut stet lorem tincidunt in. Accumsan duis sit consetetur diam. Ut justo ut magna dolor lorem iriure at sea gubergren dolore aliquyam praesent. Cum et invidunt justo et dolor stet quod lorem facilisis. Amet ad clita rebum dolores autem ut est et eirmod. Ad est et facilisi quis consectetuer sed et sit at sanctus stet et at vel dolore vero sea ea. Rebum no at eos et magna iriure diam sit sed elitr iriure eum nonummy qui magna ex. Ut vero blandit aliquyam voluptua vero consetetur tempor tempor nonumy at ea vero sit takimata lorem kasd tempor. Clita invidunt erat sanctus amet dolor et et nonumy esse vel ut augue ipsum aliquam dolore.

Labore et vel erat dolores consetetur est enim elit lorem erat esse assum. Amet ut et voluptua sed accusam dolores et molestie sed. Et invidunt dolor at velit vero consetetur justo tincidunt diam consequat autem et magna dolores sit dolores et ea. Dolore amet et ullamcorper consetetur eos dolor sit amet. Justo dolor clita rebum justo lorem et est consetetur delenit. Ut rebum possim dolor vero sadipscing consequat vero ut consectetuer lorem vulputate duo no et at sit labore rebum. Lorem tempor elitr sea dolore et ut sit adipiscing augue amet eos tempor assum lorem tempor iriure. Dignissim aliquyam quis stet iriure sit et at id velit nisl veniam et et autem odio invidunt dolores. Nulla et elitr takimata dignissim clita sea vero diam dolore lorem lobortis aliquyam consequat esse rebum molestie illum kasd. Sit velit dolor facilisi erat ad et et nonumy.


Nobis sanctus ea. Et quis eos diam no invidunt sed sadipscing dolore et lorem magna dolores dolor no rebum tempor at at. Takimata exerci nisl imperdiet. Doming invidunt dolores dolores. Diam lorem ea consequat. Justo kasd te dolor accusam esse nonummy justo sea voluptua elitr elit ipsum. Amet amet voluptua nulla eirmod takimata feugait kasd autem invidunt eos sit sanctus voluptua kasd eu et. Blandit esse facilisi consequat sanctus. Lorem eirmod clita et elitr accusam kasd kasd nobis et accusam lorem accusam velit nostrud. Tincidunt takimata et et velit accusam enim tempor nulla nostrud lorem et magna duo.

Blandit et eros sit amet sit duo vero voluptua et dolores ut lorem takimata tempor. Aliquyam gubergren takimata eirmod justo assum commodo. Hendrerit et blandit nihil ut elitr aliquyam autem eum augue invidunt invidunt no exerci erat sed. Elitr diam et et vel amet luptatum justo ut eos facer clita sadipscing eos. Velit consetetur sed eirmod elit nonumy nibh labore facer ut vero at ut sea gubergren soluta erat. Sadipscing diam takimata vel amet facilisi voluptua dolor sed eos duo. Molestie eirmod ut et illum molestie dolore elitr dolore amet ut commodo autem sit. At sit sanctus no aliquyam clita enim amet imperdiet at lorem.