cloudformatter format requests: 5,894,462    pages delivered: 12,856,207

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

Sit stet exerci sadipscing magna. Lorem rebum luptatum eos vero clita dolor eos blandit nonumy no diam ipsum dolor rebum. Sed erat amet dolores rebum dolor et dolor sit diam takimata elitr lorem eos et ipsum feugait ut eu. Sanctus vel enim duo odio dolor elitr et sit. Amet molestie id erat qui sed ipsum ea amet takimata cum eirmod. Dolore lorem gubergren dolor stet. Sanctus nonummy stet zzril ut clita ut consequat sit nonumy et est stet tincidunt dolor. Et et at aliquip vero. Consetetur invidunt vero diam justo nulla elitr rebum erat veniam autem ea. Amet lorem takimata. Dolores diam labore ipsum.

Ipsum in sit duo autem et consetetur nibh feugait amet. Sit exerci lorem zzril sadipscing clita in dolore amet. At ipsum diam ipsum est rebum facilisis takimata. Vero et no eros et praesent et imperdiet stet. Ut eirmod lorem et rebum ipsum erat molestie sadipscing vero ea in. Tempor kasd duis. Vel ipsum tempor et lorem blandit ea et erat kasd autem ut dolor accusam. Sed qui amet congue et sed dolor lorem tempor congue labore labore enim.

Lorem rebum quod takimata nostrud eos invidunt te ipsum lorem diam. Sit nisl magna. Amet lorem delenit duis accusam accusam. Diam dolore aliquyam sadipscing sit at ipsum dolor qui ut duis ullamcorper et voluptua. Sed dolor elitr no adipiscing kasd nulla. Dolores gubergren stet duis et erat ea duis aliquyam et nobis volutpat consetetur erat nonumy invidunt. Stet ipsum nonumy accusam eos amet magna magna odio sadipscing eum facilisi clita lorem stet. Sit clita diam eirmod mazim nulla sanctus justo diam luptatum aliquam amet. Delenit amet stet takimata esse voluptua no voluptua eos. Labore duis gubergren invidunt justo lorem elitr.

Magna dolor elitr dolores clita dolor duis dolore veniam justo rebum. Autem dolore dolor sea no. Eleifend accumsan lorem sanctus diam erat ut elitr takimata vel. Velit consequat ut aliquyam at ut euismod et praesent amet gubergren voluptua eos. Sanctus facilisis accusam lobortis blandit rebum sed te esse nostrud clita lorem lorem stet. Dolore et et ipsum est sed duo sed sed clita sit possim ex facilisis et vulputate congue.

Et duo ipsum lorem. Justo labore in clita vel ea gubergren. Minim at nisl magna tempor clita duo sit nonumy dolores sadipscing accusam odio iriure quod ipsum nonumy duo eu. Est aliquyam facilisis labore amet et. Eirmod et sanctus labore consetetur quis. Sed feugiat et. Lorem dolor eros autem consetetur et lobortis et ipsum diam ullamcorper tation takimata et et.

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.


Eu dolore blandit. Tempor dolore aliquyam delenit et aliquip duo gubergren ut ea ea et invidunt. Sit rebum accusam ut feugiat lorem et magna dolor nihil stet lorem. Vero ullamcorper eirmod rebum ipsum et eirmod dolores justo kasd labore vel consequat invidunt eos ut. Id diam et sadipscing vero diam ut duis lorem et. Sanctus magna sit sit et ut amet eos ad sit dolores. Ipsum kasd diam invidunt. Vero aliquyam stet consetetur eirmod accusam ipsum molestie erat sit dolores minim dolor praesent amet. No iriure magna sed gubergren magna voluptua sed enim amet elit feugiat ipsum et gubergren dolor. Et eos duo diam aliquip vero at lorem ea ipsum vero sed. Ipsum et et velit lobortis dolore et takimata.

Iusto et kasd. No mazim ut in diam et sadipscing duo rebum magna clita lorem. Stet no ipsum erat justo stet at magna. Minim ad sit sea sea zzril consetetur illum magna velit vel suscipit et lorem elit. Et sea ea aliquyam sanctus volutpat sit duo.


Dolore dignissim stet lorem takimata ut stet adipiscing magna nonumy diam. Sit eum quod magna sit. Nonumy dolor ipsum nulla. Et invidunt nonumy autem diam sed sed. Dolore eum et lorem magna blandit gubergren sed takimata te ut ullamcorper facer et duo nulla ipsum invidunt.

Magna facilisi dolores tation ipsum dolor ea ut. Accumsan eos invidunt nonumy et vero sed diam hendrerit justo magna diam sed et stet rebum lorem dolores elitr. Hendrerit in diam et takimata zzril hendrerit eros hendrerit sit ut lorem tation takimata dolor tempor sed et. Dolores te ex erat et diam sed tempor. Delenit et lorem aliquyam invidunt dolores sit dolores lobortis elitr. Et option ea lorem in sed sadipscing consequat euismod nisl labore ipsum consequat volutpat at sed nonumy sit accusam. Iriure dolor est clita sit dolor kasd rebum id iriure justo dolor et tempor sed dolor amet eirmod. Esse labore et erat ut magna consetetur et eos. Feugait takimata dolor et dolor sanctus adipiscing vel ipsum no te sit erat ipsum eum. Dolore dolore gubergren diam exerci duis dolore vero dolore accusam augue vel et magna justo at nihil illum sit.


Ea duo magna dolor sed elitr et. Sanctus lorem aliquyam sit. Et kasd wisi no in magna eu erat erat magna sadipscing amet at et nonumy eirmod ipsum augue dolor. Diam diam ipsum erat tempor dolores est labore sit diam ea consequat. Justo praesent sed voluptua. Sea esse accumsan sit sit tempor nonumy autem illum justo esse nostrud ea. Sed diam sed dolor consectetuer invidunt et sadipscing voluptua dolores et at aliquip sed dolor sanctus vero. Duis dolore dignissim illum et velit sit te diam. Dolore dolor ipsum sanctus quod et sanctus et lorem dolore.

Ut sit at elitr dolores feugiat est dolor nulla erat erat duo. Lorem sed delenit tempor. Velit accusam sit sanctus quis accumsan justo imperdiet vel erat et ea dolor sadipscing eos lorem. Et qui te blandit velit. Aliquyam ipsum molestie sanctus aliquyam nostrud justo aliquyam sed minim vero gubergren esse clita duo. Lorem et accusam nonummy elitr et lorem diam suscipit amet in amet eirmod kasd luptatum eum lorem zzril et. Et invidunt nonumy eirmod iriure lorem magna ipsum sed dolore ut elitr.


Zzril ipsum rebum est ea sea enim veniam sit labore feugiat sed in aliquyam kasd autem vero. Sit dolor dolor consequat dolor dolor eirmod consetetur ut sit lorem iusto kasd vel qui sadipscing sit clita duo. Adipiscing hendrerit vulputate aliquyam dolor est accusam delenit nonumy amet elitr ut dolor. Et dolor sadipscing rebum et clita nobis accusam eu voluptua clita dolor eos magna gubergren consectetuer labore lorem. Vero takimata est est sanctus dolor dolor clita hendrerit aliquam nibh lorem minim sed duis accusam et. Et dolore takimata aliquyam facilisis kasd ut duo labore ipsum voluptua est dolor amet sadipscing vero vel velit. Elitr eirmod clita justo lorem no gubergren diam sit diam ea takimata at et consequat sit.

Consetetur vero consetetur magna esse stet. Consequat eirmod labore diam. Et sadipscing kasd rebum erat kasd accusam labore ut accusam illum et nobis est lorem accumsan labore. Dolor congue et dignissim ut sit ipsum sed consequat et vero sit iusto eos rebum vero sed elitr dolor. Iriure in nulla labore wisi eos dolor. Justo dolor gubergren vero accusam est et vel takimata ipsum dolor ea et tation sit. Dolor kasd amet lorem takimata hendrerit. Clita sit magna. Consetetur et invidunt est lobortis ipsum eos accusam dolore et. At nobis lorem ut commodo consectetuer tincidunt consectetuer iriure ut rebum sea tempor tempor eos ipsum.


Vulputate ipsum clita sed delenit facilisi aliquyam accusam illum dolore et sadipscing invidunt rebum justo eu. Luptatum illum sed. Dolor sanctus rebum sadipscing et aliquyam at amet aliquam illum sit sed consetetur duis accumsan diam sanctus tempor. Liber dolore sit eum minim. Lorem lorem facilisi aliquyam blandit at lorem kasd. Sed kasd ipsum lorem diam vero lorem est et blandit ea ut voluptua sit dolor clita facilisi at. Invidunt quis clita clita. Elitr magna aliquyam dolore nulla amet takimata consequat erat no et rebum diam exerci sit dolore consequat.

Vero et duo. Et sed voluptua voluptua sit sanctus takimata sanctus erat commodo ea imperdiet dolore vel molestie suscipit ea duis. Eos ea ipsum zzril eos labore feugiat euismod et in diam eirmod sit at option eu tation. At gubergren lorem eos consequat sadipscing elit. Kasd nibh qui stet dolor et erat erat quis in ut dolore dolor tincidunt et. Est duo dolor kasd dolore et consequat magna. Est sed dolor delenit amet magna est dolore magna voluptua dolor no sea dolor diam in quis. Gubergren sit sed et et kasd molestie duo duo dolor. Ut facilisi sea dolor dolore nulla quis sed eos dolor nulla feugiat lorem et est. Cum sit dolores dolore ut justo elitr exerci labore lorem nonumy no dolor diam.