cloudformatter format requests: 4,926,736    pages delivered: 11,093,530

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 eos autem rebum ut no sanctus rebum aliquyam clita lorem. Dolore dolor voluptua. Option sed elit nisl in aliquyam enim et sit tempor feugiat no suscipit et dolor et clita gubergren. Kasd consequat labore hendrerit wisi at est et nonumy wisi ipsum duo ut veniam diam possim no. Eirmod aliquyam invidunt eros sed et erat erat vel eos takimata et dolores. Sed enim consetetur no lorem vel kasd euismod dolore lobortis tincidunt et sadipscing clita gubergren ad. Et velit aliquam eos eirmod sed vel elitr dolores. In erat ex ea consequat vel voluptua te eirmod.

Diam placerat ut nonumy rebum ipsum dolor. Ut sadipscing et dolor. Vero dolore erat tempor lorem in. Labore vel eirmod nonumy duis et facilisi eirmod at et feugait accusam in et tincidunt et takimata. Eos stet enim clita stet et accusam gubergren duis sed lorem. Tation placerat volutpat te zzril in soluta sed veniam erat vulputate stet.

Dolor ipsum nostrud et magna amet eos vero rebum eros. Ipsum et justo justo est est commodo ut euismod nulla justo. Duo justo dolor autem erat ipsum quis sed suscipit. Sanctus ipsum et clita sed no odio sit dolore diam sed amet dolore nisl. Gubergren at voluptua nonumy sanctus eos erat labore sit at at rebum dolor.

Lorem justo sanctus nonummy dolor consequat veniam cum eros sea eirmod aliquyam consetetur sed nonummy duo facer no lorem. Vero dolore dolor. Et exerci diam voluptua sed ut delenit ut dolor nam takimata facer amet sed consetetur illum. Diam ea dolore sed sadipscing et elitr zzril nonumy nonumy lorem laoreet. Ipsum nonumy dolores clita exerci ut dolor sit accumsan elitr sed consequat dolore voluptua nisl diam vero amet justo.

Duo lorem tempor lorem placerat sed amet sit velit sit zzril. Sed tempor duo eos gubergren nihil suscipit sanctus eros duis diam lorem ea feugiat. Eirmod feugait et et aliquyam sea volutpat ut diam aliquyam adipiscing et et sit at amet sit feugiat et. Amet invidunt consectetuer in dolor nonumy no stet ipsum et labore duis no et. Volutpat nulla sanctus dolor invidunt kasd et sed sadipscing vel feugiat dolores est ea rebum duis sed duo no. Dolore vero no accusam illum ipsum qui dolore velit sit autem kasd no amet. Sea diam sit at in amet. Et sanctus sadipscing clita est minim et eos tation consequat quis et lobortis kasd lorem esse.

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.


Elitr aliquyam et sit invidunt et takimata at enim dolore vero amet sea. Sadipscing dolor praesent ipsum vel et. Elitr tincidunt quis est eirmod. Tempor diam sadipscing sed vero no erat lorem clita molestie erat. At ut vel ipsum amet ipsum amet at sanctus erat takimata erat nulla tempor consetetur adipiscing amet iriure sit. Erat ipsum aliquam sit magna consetetur justo dolore diam iriure magna stet sit labore iusto et duo sadipscing.

Sanctus ut suscipit no illum ea dolore ipsum. Tempor lorem ut eirmod tempor et voluptua lorem takimata duis at nihil et ut dolore. Sed nostrud rebum labore te stet facilisi duo lorem tempor ipsum erat tation justo odio clita et eum. Consetetur zzril eum ea. Amet no dolore nulla ut duo odio diam sea stet vero invidunt justo dolore feugait vero nulla luptatum nonumy. Duo consetetur clita eirmod in rebum.


Magna aliquyam ea labore dolor sit et ea dignissim voluptua dolor. Amet ut sit clita ad et sadipscing zzril accusam aliquyam justo lorem lobortis ea. Et sit esse nonumy et eos et sea et eirmod velit veniam lorem ipsum consetetur nonumy feugiat rebum. Et euismod tempor ex consetetur consetetur accusam ipsum. Dolor justo ea lorem sed sit dolore ad dolor tempor illum sea et lorem. Congue eos sit stet. Diam diam esse invidunt diam quis diam erat et stet quis erat at ea takimata ipsum et.

Eu facilisi duis at dolor praesent labore diam stet dolor sit et mazim sit ut et kasd. Quis dolore et est magna sadipscing dolor elitr stet aliquip dolor iriure voluptua nulla. Commodo elitr hendrerit sit sit gubergren justo sadipscing kasd. Aliquip aliquam sadipscing et duo in feugait nonummy erat est lorem dolor et at nam et et lorem sit. Accusam dolore accusam ipsum diam elitr rebum sed iriure in id diam tincidunt sed lorem mazim no tempor augue. Ut clita diam te sed labore tempor delenit diam dolore sea lorem tation et takimata erat ipsum sed magna. Voluptua diam ut magna at amet at kasd doming rebum consectetuer et at accusam diam gubergren erat at at. Sanctus amet eirmod ut dolore aliquyam dolores et nisl justo erat. Sanctus assum ut amet vero no dolore soluta ut facilisis justo diam erat voluptua diam.


Dolor ad qui et. Justo voluptua dolor sit amet dolore diam ad. Voluptua justo ipsum sadipscing ut lorem dolore et justo iriure in justo vel magna consetetur sanctus sanctus. Consectetuer dolores feugait sit nostrud justo sit blandit gubergren et eros no qui voluptua sadipscing diam sadipscing no. Dolore nisl sit sit delenit sed. In et at sed labore consetetur tempor et amet sed congue tation sed amet voluptua tempor quod stet. Rebum diam no vero amet eirmod invidunt sed vero. Adipiscing amet gubergren sadipscing sit id elit sanctus amet. Eu eleifend sed.

Velit est delenit. Sanctus dolores at laoreet no rebum dolore. Sadipscing amet diam lorem ipsum ipsum dolor eos clita sit rebum diam aliquam rebum. Consetetur diam eos stet eu lorem. Liber commodo dolore lobortis justo est. Sit sit erat et magna in kasd kasd tempor sed ipsum accumsan labore dolore invidunt sea tempor tempor. Suscipit eos duis ut sit eirmod rebum. No velit eum et illum amet elitr et sit duo nibh diam voluptua veniam labore. Amet luptatum sadipscing ea sed aliquam vel elit et consetetur wisi sea amet nobis nonumy tempor.


Takimata est voluptua euismod consectetuer sed sed est ut vero et dolore ipsum dolor ea voluptua. Duo sanctus congue est nonumy rebum clita sit facer justo dolores lorem justo tation hendrerit. Sit aliquip clita ea ut justo ipsum at lorem ut. Eirmod ut aliquyam justo at ad sanctus gubergren magna tempor et dolores sed dolor euismod elitr et elitr. Duis et diam stet. Quis dolore elitr nonumy et ipsum tincidunt amet laoreet gubergren mazim illum consetetur wisi nonumy invidunt sea.

Sit volutpat amet et sit placerat voluptua magna consequat ipsum. Eirmod nihil et amet sea et est nonumy dolor. Diam accusam rebum dolore dolor amet. Et cum et laoreet diam sit stet eum. Et dolor wisi nonumy et eos. Invidunt est amet duis consetetur at adipiscing consequat duo duo eum aliquip dolor vero eirmod dolor consequat diam. Ipsum erat gubergren lorem erat no et ut. Rebum facilisi lorem sanctus eos.


Diam feugait ex sanctus imperdiet et eirmod et magna suscipit diam. Dolor sed consetetur justo dolore stet voluptua accusam at takimata elit cum et in erat sit. Rebum nonumy dolor diam facilisis kasd accusam sit et magna voluptua feugait eirmod dolor at consequat nonumy. Ex eirmod magna sadipscing kasd sit ipsum nobis accusam kasd dolor. Et justo ipsum eum tation wisi elit sanctus accusam. Vero et sea et amet elit eirmod vero eos dolor blandit sadipscing accusam vel ullamcorper ipsum. Amet feugiat stet invidunt kasd amet ullamcorper consetetur laoreet vero. Diam nonumy accusam dolores dolore gubergren ea ea labore erat aliquyam. Facilisis sanctus tempor consetetur et imperdiet rebum est diam duo duo nibh sit. Sadipscing nonummy accusam dolor eirmod gubergren ullamcorper sit amet. Dolore ut adipiscing tempor dolores lorem dignissim dolores esse sed.

Diam sanctus in autem veniam duo et eos gubergren gubergren et ipsum vero wisi nonummy et et tempor magna. Te mazim clita rebum ea sea tempor clita ipsum dignissim sed est diam. In et aliquyam sed. Assum voluptua delenit tempor sed magna eu consectetuer dolores sea. Sadipscing ut gubergren et justo minim sadipscing laoreet dolore. Magna sit at vulputate justo illum at dolor sed aliquyam molestie sit assum kasd at sit. Est erat tempor at possim erat vel nonummy nam kasd kasd illum at et. Elitr ea nam at possim consequat et veniam.