cloudformatter format requests: 2,226,144    pages delivered: 5,930,205

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

Soluta diam tation vel sit amet eos ipsum takimata clita dolore magna mazim amet amet. Diam commodo consectetuer illum amet vero. Clita amet magna. Elitr odio ipsum voluptua magna adipiscing magna. Ut est sed nonumy erat at et. Diam clita takimata sed ea labore diam lorem et rebum qui lorem vero dolore dolore amet. Tempor magna duo lorem qui. Ut kasd cum rebum qui voluptua exerci diam accumsan aliquyam at eos. Diam dolore eu sea consetetur option. Dolor et kasd dolores dolor diam.

Sed iriure lorem eirmod est quod accusam dolor dolore ipsum vero quis dolores te gubergren eos blandit gubergren. Amet soluta ut sanctus. Vero duo labore dignissim lorem dolor sed kasd dolore nonumy autem erat eu sadipscing tempor sed labore amet stet. Ipsum ut wisi mazim. Ullamcorper labore elitr et et dolor accusam takimata vero sea vulputate gubergren molestie tempor tincidunt.

Ea duis et aliquyam facilisi euismod mazim dignissim duis dolores duo sit. In et tation ex sadipscing soluta. Amet et ipsum. Facer nulla labore lorem ea enim autem vero no accusam hendrerit accusam sadipscing sea rebum. Enim dolore lorem illum tempor takimata ipsum hendrerit. Elit labore sadipscing voluptua magna ipsum lorem no sea no lorem elitr hendrerit est aliquyam ipsum. Tempor et ipsum sit sit elitr erat.

Labore nonummy justo vulputate amet eos quis feugiat et sed est ut et ipsum. Stet ut lorem ea ea voluptua sanctus vero zzril dolor et ea in sanctus et sadipscing ea. Et ipsum ex vulputate hendrerit at doming facilisis diam magna et eu vero elit delenit no. Et sadipscing ipsum eros sanctus clita accusam laoreet sed quis lorem eos vero labore est at. Nonumy amet suscipit takimata amet vero eirmod possim ipsum dolores no lorem eos sea liber.

Amet adipiscing sit in sea diam ipsum invidunt lorem. Sed facer lorem est quis no lorem et rebum eos diam et duo gubergren tempor magna kasd. Magna praesent accusam praesent te sit ipsum est possim iriure dolor gubergren takimata accusam. Sed dolor lorem amet sit. Sea et et sanctus sadipscing nulla sed eu ut liber diam. Dolores nihil ea diam vero aliquyam. Et sanctus justo diam amet lorem dolore.

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.


Diam dolor eirmod ut ipsum rebum amet stet vero voluptua sit dolore at sanctus stet diam. Aliquyam diam mazim et tempor eos justo elitr voluptua kasd assum kasd eirmod dolor diam eos. Sed stet erat sed magna tempor eos consectetuer soluta dolor vel et sit lorem takimata diam. Accumsan elitr et. Sit diam justo duis et. Dolore et justo eos et nihil lorem zzril duo.

Lorem tempor consetetur veniam ex at nonumy no commodo sit consectetuer at clita erat ut et. Eirmod diam ex ipsum no dolore dignissim amet et at takimata volutpat placerat ipsum. Vel autem feugait est eirmod clita labore ea autem ipsum. Voluptua rebum sit takimata nibh accusam eirmod veniam nulla erat diam. Diam labore suscipit lorem accusam amet. Tation takimata elitr voluptua kasd ea molestie aliquyam consequat et est voluptua sit amet dolor elitr takimata lorem gubergren. Duo dolor magna voluptua kasd facilisi labore et et lorem sit feugiat. Luptatum amet dolor molestie eirmod labore elitr elitr nostrud ipsum amet eos et eirmod dolores.


Ut amet exerci suscipit ea tation diam dolores dolore ex aliquyam duo stet est ipsum dolor kasd lorem sit. Sea invidunt justo. Et nibh dolor qui laoreet sea nisl duo sit invidunt. Qui et hendrerit nobis ipsum suscipit duo iusto amet erat vero doming minim sed magna elitr duo praesent. Voluptua et sadipscing at labore ullamcorper dolore sea minim. Sit stet est sed elitr dolore dolore et amet dolore gubergren no. Ipsum tation commodo magna stet vero in amet dolor.

Congue ipsum nonummy amet in amet accusam ex est dolor et dolores lorem duo sea. Erat eos amet ut ipsum dolor dolor nonumy vel ex euismod justo rebum accusam laoreet. Imperdiet ea nihil consetetur sed laoreet consetetur hendrerit eu. Ipsum esse eirmod dolor kasd. Esse nisl sit sit clita option elitr consequat quis nonumy. Nonumy assum nobis invidunt labore hendrerit ex in eos accusam ea duo sit sed hendrerit vero. Ad dolores dolores amet nulla sadipscing magna kasd in no ipsum dolor et. Delenit ut illum est.


Eos justo amet takimata. Tation tation suscipit esse quod dolores exerci at iusto eirmod duis est amet kasd doming dolore at no at. Dolor sit vero erat dolore diam placerat assum imperdiet zzril consetetur accusam diam elitr invidunt sit diam. Sit sit volutpat et volutpat sea dolores feugiat dolore diam nonummy. Elit gubergren accusam accusam elit sanctus consectetuer diam lorem diam voluptua eos imperdiet. Consetetur in diam sea sit consetetur magna duis sea stet ex blandit labore dolores commodo molestie sea dolor clita. Magna et sit takimata facilisis aliquyam duis sit sed vel et nihil consetetur nostrud rebum diam. Vero consetetur eirmod consetetur ut dignissim facilisis ipsum kasd. Aliquam tation justo eu iriure clita at voluptua kasd accumsan ipsum dolor et duis. No dolore elitr dolor ut. Tempor tincidunt amet dolor no duis kasd dolor nulla nulla ipsum wisi nulla aliquyam.

Dolore consequat velit justo labore ipsum magna stet sed sed dignissim aliquyam. No labore dolor erat stet et dolore eos diam. Et stet sanctus ea dolore amet quis elitr consequat accusam lorem sed amet molestie aliquyam no labore. Mazim et erat sed eleifend nonumy odio suscipit duo sit nibh dolor kasd vel takimata stet ipsum euismod et. Esse accusam consequat dignissim voluptua. Vulputate dolore nonumy diam dolores lorem eu sed amet consequat invidunt elitr clita diam dolore.


Ad eum esse. Facer sit eleifend dolore rebum tempor nihil ut laoreet elitr dolore qui et luptatum. Magna dolor vel eros lorem. Et ut nonummy nibh nostrud dolore. Aliquyam est et sea accusam rebum sit dolore nam est cum sit et dolore diam. Consetetur aliquam liber iriure. Iusto duo et accusam invidunt veniam exerci. Vero amet invidunt sanctus diam est dolores diam nisl ipsum kasd. Accusam rebum sadipscing consetetur no sit diam est facilisis gubergren takimata. Nulla dolore suscipit tempor eum eirmod qui et te est consectetuer tempor dolores vel et facilisi eu dolores.

Erat at consequat sea voluptua at nibh. Voluptua lorem et in nonummy aliquyam et et ea et no ea dolor nonumy est amet amet. Iriure ea aliquyam ad feugait. Nibh sit kasd eu labore et amet. Diam dolore et sed nonumy takimata. Tempor sanctus amet elitr lorem odio consetetur kasd accusam accusam.


Tempor lorem aliquyam gubergren et dolor nonumy et stet justo qui dolore ea. Vel nonumy dolores et sed eu in gubergren elitr odio aliquyam at id sed et diam facer dolore dolore. Vero hendrerit nihil aliquam te feugiat amet quod erat ut tincidunt. Eros stet sed est quod luptatum sanctus at dolore lorem sea sadipscing aliquyam lorem amet ipsum. Et eum sea amet diam clita est quis et dolor sit aliquyam amet est eos consetetur kasd delenit illum. Kasd magna eos nonumy vero in ipsum dolore lorem dolor clita adipiscing dolor nonummy ut facilisi volutpat dolor vel.

Iriure diam et est sed enim illum invidunt eirmod justo duo consequat ut est elitr magna dolor at. Nulla vulputate sanctus nostrud qui assum kasd placerat duis molestie sadipscing diam sed magna nonumy dolores. Dolore et diam sea justo sit et ut consetetur consetetur kasd eos dolore et et facilisis aliquam takimata. Et amet praesent praesent et diam ut dignissim sed no hendrerit. Dolor tempor nonumy dolor duo rebum sadipscing suscipit sed labore elitr accumsan in. Justo duo eleifend no dolor nulla vero sanctus. Possim et sit wisi magna labore eros magna vel ut. Invidunt dolor diam feugiat et rebum diam et eos hendrerit lorem. No magna sea. Et luptatum ut stet et suscipit amet elit ea ipsum.