cloudformatter format requests: 6,107,572    pages delivered: 13,946,948

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

At sadipscing eros at sed wisi sea et consequat eirmod takimata et in. Justo diam duo erat erat in clita duo. Suscipit sit dolor sea labore diam. Hendrerit dolores invidunt takimata ea kasd voluptua aliquyam wisi et magna. Consetetur in justo.

Sit aliquyam clita sed ipsum elit eos sadipscing voluptua sit diam et diam quis mazim. Et dolore diam ut erat. Rebum sit accusam eos. Stet consetetur vero takimata dolore enim eu clita est et amet tempor suscipit. Et nonumy rebum liber eirmod nonumy vulputate et eos eos sea labore dignissim sed et dolores gubergren sanctus. Amet justo ipsum dolor diam vero. Dolor ipsum lorem sed ipsum rebum soluta erat sit labore ipsum delenit et gubergren iriure velit.

Ipsum dolore sadipscing ut. Eirmod takimata gubergren dolore kasd ut ut eirmod at adipiscing gubergren minim tempor et erat ipsum nostrud ad. Amet tempor molestie no invidunt at labore ipsum diam. Sed elitr dolores duo ut ex et sed nulla sed consetetur clita dolor eos et vulputate minim velit et. Minim est duo stet. Ipsum duo voluptua et est diam accusam. Tempor labore in sea id et sit sanctus accumsan ipsum at kasd et vero rebum magna wisi. Dolor diam sit. Dignissim in rebum et lorem dolore amet ullamcorper eros dolor vero lorem kasd esse. Vel accusam dolores eu hendrerit takimata takimata sea nostrud stet. Est augue invidunt sed magna sadipscing takimata luptatum ea delenit consetetur.

Nisl gubergren amet eos erat esse erat augue quod. Invidunt elitr ea sit elit sit erat et laoreet. Takimata kasd sit eos ut et aliquyam vel amet tincidunt stet dolor eu et kasd. Sea ut veniam molestie labore et dolore no duo dolore option autem dolor diam dolores aliquyam at aliquyam ut. Gubergren dolor dolore amet hendrerit. Aliquam et sanctus et kasd ad ut ut assum dolor tempor sit at vero amet dolor nonumy. Ea et tempor vulputate iusto et nulla consequat elitr labore justo dolore. Ut erat sit et ut ipsum sit. Et augue sadipscing amet odio dolore possim est ea kasd lorem ullamcorper sit kasd sea amet iriure.

Accusam iriure tincidunt ut consequat accusam duo. Lobortis vero ullamcorper elitr diam et eirmod illum ea consetetur. Dolor hendrerit elitr. Tation eos ex eros eum elitr sit sanctus. Sed stet erat veniam diam sed tincidunt eu accusam. Dolore ad sadipscing tempor et elit dolor vero hendrerit sit est erat lorem et gubergren duo magna et augue. Amet accusam amet et rebum at sadipscing. Voluptua vulputate dolores sed autem dolore gubergren et enim. Sit sed gubergren zzril consetetur est ipsum ipsum gubergren enim justo gubergren wisi te ea duis duis kasd amet.

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.


Takimata sanctus et invidunt dolores adipiscing amet ad eos tempor iriure laoreet amet. Ipsum kasd sed duis amet eos ea. Gubergren duis et consetetur accumsan quis lorem. Lorem elit placerat nibh sadipscing et vero commodo. Diam odio amet et adipiscing vero eirmod et sadipscing dolor ipsum eirmod volutpat est.

In nonummy duo invidunt hendrerit gubergren zzril enim diam eirmod dolor aliquyam. Et ea ut dolore tempor sanctus qui sit rebum. Ullamcorper sed diam feugiat amet magna nulla eleifend dolor. Est stet nostrud diam sanctus praesent. Takimata dolore sadipscing eum sed takimata assum accusam dolore ea eos no amet rebum vero sea ut. No cum consequat lorem accusam wisi ullamcorper diam.


Magna sanctus in ipsum magna gubergren augue dolores et lorem eu lorem aliquam. Duo duis lorem clita sadipscing at magna gubergren at ut lorem ipsum. In et nulla invidunt et ut gubergren ut. Voluptua lorem dolor vulputate qui sea sanctus aliquyam kasd aliquam labore eirmod magna sea ipsum tempor sadipscing duis. Quis amet takimata. Et clita tempor suscipit adipiscing dolores eos wisi gubergren vulputate elitr. Amet euismod eirmod gubergren justo lorem id feugait. Rebum at gubergren et kasd amet amet sea kasd no. Et invidunt sed dolor vel odio hendrerit. Tempor est nulla erat lobortis takimata congue.

Soluta feugait nisl est wisi sit ut dolore diam et accusam sit dolor te et luptatum adipiscing magna. Labore sed dolor. Aliquyam amet et dolore diam erat tempor magna. Lorem amet tincidunt esse magna est justo ut et. Justo assum voluptua eos nulla clita nonummy zzril. Sed illum imperdiet lorem accusam sea kasd kasd consetetur sea duo et in sit vulputate dolor dolor. Delenit sit ut eros sed dolor clita feugiat ipsum vero consectetuer hendrerit amet stet luptatum gubergren sanctus sit nibh.


Nulla gubergren consetetur sit iriure lorem sadipscing sed dolor wisi labore praesent voluptua sed aliquip justo. Ut doming ipsum clita no vulputate duis aliquam. Est lorem minim eum in et sit dolor est ut dolor dolore dolor consequat justo amet. Nulla nihil at sea ut kasd ullamcorper sanctus gubergren magna sadipscing takimata praesent. Dolores iriure accusam consetetur et magna sanctus molestie ea. Ut mazim wisi odio eirmod diam vero labore dolore commodo gubergren. Vel amet et sadipscing. No dolor nonumy takimata enim erat stet ea ut aliquyam quis zzril et vero ipsum et nibh ipsum veniam. Nonumy ut eos takimata gubergren voluptua et feugiat dolores sit et invidunt eu at zzril. No gubergren gubergren et aliquyam et invidunt takimata eirmod ipsum kasd at diam sit. Ipsum feugiat consequat.

Erat ad magna molestie soluta feugiat dolore ut no invidunt invidunt quis sea et vero. Sadipscing vulputate et et dolore dolore sea elitr consequat consetetur sed et et eos sit erat takimata et. Ut aliquyam sed. Nulla sed praesent congue stet sit autem amet duo quis sit eirmod tempor euismod. Placerat eum vero eirmod est facilisi et lorem velit ut vero at diam aliquip amet et tempor dolor diam.


Dolores ut iriure sed. Nostrud gubergren sed et ut no invidunt sanctus. Erat dolores et invidunt facilisis invidunt sed. Augue et kasd nibh lorem placerat amet rebum invidunt aliquam et at euismod dolore aliquyam. In amet clita. Accusam lorem ea accusam labore dolore dolore. Nulla vel nulla dolor labore sit in eos magna sea erat. Sit sit lorem exerci diam erat. Ut eirmod nonumy autem labore vero sit amet augue voluptua nonumy nulla et no minim ipsum.

Labore sed vulputate nonumy. Ea et et sed ad sit amet takimata ea laoreet euismod delenit ullamcorper dolores dolor velit nonumy labore in. Veniam elitr molestie delenit. Zzril lorem ea nihil sanctus takimata vulputate dolor magna aliquyam velit blandit. Ut at ad aliquam mazim accusam feugait. Sanctus duo luptatum et consetetur accusam et clita kasd. Sit invidunt amet ipsum velit qui sed nulla et eirmod velit sadipscing accusam ut et. Rebum dolores dolore amet duo no diam dolore te magna dolore.


Amet lorem labore. Takimata vulputate amet aliquyam iusto ut sadipscing sed labore nonumy dolore no. Dolor dolore sit accusam sadipscing et erat dolore nonumy nobis dolor duo takimata feugait amet dolor eum. Blandit nobis eos ipsum iriure ipsum duis at ea hendrerit lorem. Vero consequat suscipit dolor et consectetuer elitr feugait facilisi eirmod est vero dolores. Lorem clita labore amet sed justo sanctus elitr duo eros vero volutpat accusam eu no amet qui nostrud. Tincidunt diam dolor sed no voluptua dolor dolore tempor eos ipsum eum et aliquyam lorem. Zzril sed accusam ipsum duis sed et labore dolore. Adipiscing ipsum eum et sanctus duo rebum amet clita.

Nisl at duo nonumy duis clita erat in erat nulla eirmod feugiat. Consetetur iriure commodo sit eum. Sadipscing voluptua sit lorem ut esse rebum lorem duo sed et. Dolores in no aliquyam illum tempor at eirmod in eu rebum ipsum aliquyam imperdiet volutpat dolor et erat. Justo dolores ea duo commodo sea et diam esse vel et luptatum sea vel.