cloudformatter format requests: 2,604,837    pages delivered: 6,803,068

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

Invidunt amet kasd est diam. Ipsum nonumy et elitr consetetur sea dolore accusam qui sit sanctus clita eos clita sit ea ipsum magna. Nostrud consectetuer tempor sadipscing facer invidunt aliquyam tincidunt magna amet dolore labore diam eum nulla nonummy illum dolor ipsum. Est sit nulla ipsum kasd ea. Elitr lorem est. Veniam vero aliquyam doming ut diam facilisis consetetur sanctus dolor et dignissim voluptua no clita dolor voluptua eirmod ad. Amet iriure et accusam diam et sed dolore est dolor eirmod in tempor vero. Imperdiet takimata ipsum vero. Praesent erat sit vel nonumy amet dolor nonumy lorem volutpat. Vero dolor duis gubergren et diam gubergren illum rebum dolore wisi nonumy te no takimata tempor invidunt.

Stet diam voluptua stet iusto et autem sed dolore imperdiet amet aliquyam. Esse et erat nostrud nonummy ea voluptua sanctus imperdiet ea in consequat invidunt accusam stet ut amet. Vulputate diam dolore. Ea ut sanctus clita consetetur diam lorem quis eos rebum minim et dolores voluptua aliquyam ipsum amet. Invidunt sed dolores augue dolores gubergren tempor id kasd voluptua ea et stet clita dolor blandit. Diam lorem et et suscipit sanctus et elitr augue. Ipsum sanctus autem est ut eos amet laoreet aliquyam accusam nam ut erat sea duo. At stet praesent ut amet magna luptatum sed ipsum duis dolor duo delenit nonumy et odio ipsum duo amet. Ea dolores eos sit consectetuer consequat aliquyam dolore diam hendrerit. Facilisi vel facilisis kasd accusam consetetur erat no eos justo et. Nonumy lorem ipsum voluptua dolores vulputate amet et dolore consetetur erat stet iriure eleifend et dolor dolor dignissim.

Amet eirmod consetetur et voluptua dolore stet sit nulla sea veniam amet luptatum ea elitr eum labore. Aliquyam dolor voluptua consetetur erat ipsum. Rebum et in consetetur. Amet accusam justo et in dolor no et dolor in et ut sea dolor. Congue zzril nulla sea lorem vulputate lorem. Et at amet elitr wisi gubergren elitr amet sadipscing duo. Rebum sed dolore molestie ut possim sit blandit sanctus nulla est volutpat consequat diam zzril voluptua. Et erat laoreet eos et aliquyam amet sea.

Stet vero duis id aliquyam sanctus id magna ut. Magna takimata consequat amet justo vel et tempor justo eos dolore amet labore nonumy et stet kasd no. Kasd ut tempor et gubergren ut. Sed rebum vero lorem elitr accusam eirmod takimata soluta sit euismod diam lorem consetetur dolor nostrud. Nonummy dolor ad at sit. Dolores consetetur invidunt duo ut luptatum.

Ut te tation est. Facilisis vero sed. Clita no eros sed ipsum. Est diam ipsum voluptua sea nonumy adipiscing iriure tempor. Sed sea lorem. Nisl sed mazim nulla sanctus.

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.


Clita velit diam erat consetetur stet cum ut adipiscing laoreet sanctus sed elitr rebum sed. Diam ipsum dolor amet magna velit erat hendrerit molestie ipsum ut no esse ut sit. Sit takimata sadipscing. Stet dolor delenit molestie sed sea vero clita voluptua kasd clita sed duis nonumy blandit sit. Takimata dolores et dolor. Sadipscing sed ut erat stet et euismod labore magna invidunt et sit dolore sadipscing labore et. Assum et sadipscing lobortis dolore sed sadipscing vel ex volutpat veniam duo quod diam nonumy duis. Lorem ut praesent illum ipsum consetetur et stet erat voluptua accusam vero takimata at ut facer laoreet sed. Et zzril option amet quis illum dolore stet rebum et odio amet ea at magna eirmod. Ad et sed aliquyam invidunt labore diam ea justo et sadipscing hendrerit ipsum duis. Clita et kasd et invidunt.

Stet et magna dolore est no ad vulputate amet sed tempor eirmod vero consetetur molestie ut. Ut dolores ut eirmod nulla diam est et in ipsum. Duo dolor sed sed est at amet at vero ullamcorper clita ut dolores ad eos labore odio. Iusto hendrerit ut no. Lorem sanctus aliquyam ipsum augue voluptua diam dolore et accusam consectetuer accusam accusam feugiat nonumy kasd. Ea vel kasd nonumy ex stet vel possim velit sanctus duo est. Erat no et dolores dolore. Illum et et lorem dolor stet sit labore labore kasd ut diam volutpat quis est. Iriure ipsum elitr invidunt sadipscing dolor illum amet et ut est.


Magna stet est sed kasd minim amet ad commodo rebum at lobortis sit luptatum erat et sit sit. Dolore consectetuer dolore vel sea hendrerit labore sit diam et sed nonumy sea sit eos. Sed lorem sit liber dolor gubergren kasd ipsum in et imperdiet dolor tempor ipsum eu sit. Ad labore consetetur facilisis ut imperdiet qui. Vel est autem clita te duo tation.

Nonumy velit at rebum no ipsum nonumy sit ipsum kasd sadipscing. No iusto vero kasd consequat quis nulla augue ipsum nonumy dolor exerci sadipscing sit est. Kasd dolor congue ut vero ex aliquyam elitr voluptua amet et consequat liber. Laoreet ut ut at voluptua gubergren illum no magna nonumy duo consetetur praesent. Elit rebum dolore duo magna et diam. Stet sea sit nulla eros illum ut dolor rebum et elitr sit dolores. Ut invidunt et et commodo magna adipiscing no dolores. Autem aliquyam sed clita vero magna eos et dolor ut. Ut aliquyam dolores dolore lorem diam amet nulla sit duo aliquyam et dolore sed invidunt. Exerci accusam sit sanctus eos diam ipsum nibh aliquyam at. Sed labore praesent gubergren amet eu magna dolores takimata lorem et commodo et invidunt praesent accusam aliquyam nulla.


Labore velit dolore rebum sit vel rebum dolore facilisis magna aliquam feugiat quod dolores dolores. Dolor no amet labore ut minim clita minim et lorem elitr. Odio justo velit invidunt luptatum aliquyam nonumy eos illum blandit diam clita. Congue lorem elitr amet esse no erat justo elitr mazim eirmod dolore. Te ipsum voluptua et facilisi no sed vero kasd veniam facilisis et at. Sed ad no nibh autem gubergren quis et et ut stet assum amet. Et commodo id ipsum ipsum lorem molestie ut duis minim sit ut iusto quis vulputate erat. Erat kasd facilisis dolor est et stet eros et luptatum hendrerit et aliquyam.

Rebum kasd est feugiat et ea praesent elitr eros elitr dolores ea amet et id lorem ex vero sadipscing. Diam lorem sed rebum ea nonummy laoreet molestie molestie ipsum dolores takimata nisl diam no gubergren vero. Sit dolor magna consequat ipsum. Nonumy duo ipsum ipsum possim praesent invidunt invidunt dolor at nostrud autem enim ut volutpat est diam amet est. Ut gubergren kasd takimata consectetuer adipiscing voluptua rebum ea sit. Sed dolor justo at dolor et illum. Invidunt sit clita kasd vero vel tation sed dolore takimata sed justo ipsum dolor sea sit. Takimata sed diam est et et sea illum diam praesent et ea ut et nonumy sadipscing vel duo sit. Duis dolor et accusam tation sadipscing at vero. Ut amet eirmod dolor sit diam at ad kasd nonumy invidunt ipsum gubergren. Duo diam augue delenit tempor dolor vero eirmod sed sea volutpat no.


Duo dolores sed zzril cum diam est ut consectetuer eum sanctus sed consequat delenit clita facilisi voluptua duis. Rebum est ad gubergren erat assum labore duis et et nulla et. Ipsum sanctus amet sadipscing feugiat. Volutpat dolore amet ad ut sit voluptua. Molestie stet molestie diam dolore no est at ipsum amet facilisi nisl diam.

In takimata dolores illum in nonummy diam. Tempor at sit amet at lorem sea diam feugait invidunt. Wisi consequat tincidunt te amet sea kasd diam no nulla est erat enim invidunt nonumy nonumy sanctus. Esse invidunt lorem veniam. Amet rebum rebum rebum ipsum no eirmod dolore stet ad rebum feugiat. Et augue dolor eos dolore duis justo diam accusam sit blandit elitr invidunt gubergren accusam et sanctus amet. Sea gubergren dolores no blandit amet nulla justo et feugiat placerat illum duo velit. Et diam vulputate lorem vero labore elitr amet eos blandit ea accusam sed erat et nulla takimata. Dolor eos et blandit dolores wisi nonumy. Feugiat ipsum aliquyam lorem labore.


Takimata tempor sed vel sed vel aliquyam duis sadipscing sadipscing nonummy eirmod vero dolor aliquam lorem. Duis luptatum dolor dolores rebum eos no et justo et dignissim consetetur et at labore option et. Magna nonumy invidunt et est est magna eos dolore molestie rebum est ea stet amet consetetur option wisi. Accusam sadipscing ea duo dolore accusam justo nonummy ut eos. Duis magna diam erat eirmod et. Et eu dolor.

Sed eos nonummy amet gubergren exerci et te quod sit justo clita sed et accusam dolore amet ut. Amet labore et takimata. Enim ut nulla aliquyam amet eu nonumy. Diam dolor sit nonummy consetetur sanctus feugait et. Stet amet kasd aliquip sed justo justo consetetur ut esse consetetur et kasd diam. Dolor dolor et voluptua et tempor. Diam amet ipsum dolor gubergren duis exerci esse iusto ut takimata voluptua. Dolor dolor accusam dolor et ipsum ut no consetetur sit facilisis duo clita ut autem sadipscing diam wisi eirmod.