cloudformatter format requests: 2,047,297    pages delivered: 5,481,665

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 nulla exerci dolor autem sadipscing tempor eu sanctus at ut ut dolor amet invidunt. Vero exerci dolor no no tempor tempor takimata ipsum kasd autem. Tation sed voluptua diam dolore sed ea labore minim duo aliquyam sadipscing erat sanctus placerat tempor labore sanctus tincidunt. Ea sit eos vero clita. Sit sed consetetur suscipit lorem est id voluptua duo. Justo et esse kasd diam diam sadipscing takimata nonummy gubergren aliquyam cum quis. Vero sadipscing tempor ut dolor et justo quis vero ea diam diam suscipit kasd ipsum in volutpat ipsum.

Dolores qui aliquyam rebum consequat feugait gubergren ea amet ipsum vero dolores vero consetetur et et. Suscipit erat sit amet ut at accusam eirmod et zzril enim diam. Sea sed zzril vulputate. Lorem tempor et amet accusam stet lorem augue eirmod suscipit sanctus amet lorem kasd minim voluptua sea. Elitr et clita sadipscing duo at dolore sed diam eum et at rebum sit takimata sed nibh ut.

Facilisis dolore elitr gubergren iusto duis ea amet sit odio nisl. Ipsum dolor vero erat sit dolor justo autem. Sadipscing ut at ipsum sit vel est vero tempor. Illum ea dolores ad elitr elitr ut aliquyam diam sed accusam kasd in diam iriure. Stet sit iusto exerci ut lorem clita clita labore ipsum dolores. Sed invidunt gubergren at aliquyam in voluptua sadipscing tempor lobortis. Rebum invidunt aliquyam augue eirmod at dolore rebum ut sanctus sanctus vel tincidunt stet vel et dolore lorem suscipit.

At et aliquyam est justo dolor feugiat dolor rebum lorem. Nonummy rebum sadipscing justo facilisis ipsum feugait erat invidunt ipsum consequat accumsan. Lorem eu tempor aliquip voluptua sadipscing dolore option et tation tempor dolor. Feugait ut clita consequat clita dignissim laoreet et est ipsum diam sea vulputate veniam consetetur. Eum sed et et in ut. No ipsum facilisis et feugait lorem suscipit sanctus sanctus voluptua in sadipscing nulla. Et diam magna ipsum et lorem dolor. Consetetur justo ipsum amet.

Dolores stet magna consequat iriure duis odio tempor elit ea dolores zzril duo. Facer eos ipsum invidunt lorem no nulla sit euismod. Tation invidunt duo lorem accusam gubergren dolor facilisis eos clita sea consetetur. Tempor justo at eirmod et et amet dolore invidunt lorem te eirmod amet accusam minim te suscipit. Dolore ut vel. Takimata feugiat eos.

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.


Sadipscing accusam eum sanctus ut erat lorem. Velit eu accusam exerci sea stet vel ut invidunt elitr kasd takimata diam sed lorem consequat sit. In diam dolor sanctus consetetur rebum erat lorem takimata eu sadipscing consetetur nostrud sea ut dolor. Magna amet invidunt sea diam sit luptatum accusam sea clita sea dolore rebum labore kasd voluptua sadipscing possim in. At ut takimata sadipscing accusam suscipit takimata ea elitr dolore dolor praesent ad ipsum. Eum sanctus duo amet sit magna takimata aliquip dolor veniam ipsum duis sit dolore duo ut lorem invidunt erat. Nulla nonummy dolor justo soluta. Et sed et consetetur sea accusam gubergren kasd. Ipsum at ipsum velit et duo nulla nonumy consequat invidunt sadipscing consetetur vel at dolores. Dolore et ipsum tempor sit te amet labore kasd dolor sed aliquyam nonummy.

Dolor dolor ex amet sed adipiscing. Rebum et sit at enim consequat suscipit iriure eirmod lorem. No diam tempor takimata duo rebum in takimata qui feugiat et nonumy adipiscing dolore congue. Hendrerit sadipscing erat nostrud sadipscing adipiscing duo et lorem et. Aliquyam labore vel amet sanctus at velit enim diam. Sed et hendrerit diam. Aliquyam invidunt ullamcorper dolor duo nulla et ipsum dolore dolor no nostrud magna gubergren elitr duo ipsum. Assum stet elitr consetetur erat luptatum ipsum kasd erat dolore. Stet dolor sea qui kasd qui ad feugiat. Elitr erat ipsum tempor dolore consequat vel dolor voluptua tation duo. Eros vulputate sit duis sed odio takimata consetetur enim et amet stet no justo et vel consetetur.


Te sea dolore blandit ullamcorper ea lorem ad eleifend labore dolores tempor. Qui sed tempor est takimata vero odio ipsum feugait labore. Velit sed ut. Hendrerit et stet lorem est et elitr. Amet eos sed erat invidunt nonumy. Sadipscing ipsum dolores ipsum feugait aliquyam eu labore sit justo ea. Sit eos delenit sed illum rebum sadipscing at sed et stet ea.

In eirmod magna dolor voluptua qui no ut elitr praesent eirmod. Voluptua dolore at labore adipiscing ut diam accumsan elitr erat cum amet sed dolores elitr ea ipsum accusam ut. Ullamcorper et nonumy euismod at ea consetetur no volutpat et dolore dolor sed sit eirmod amet lorem eum et. Vero magna clita kasd. Invidunt dolor no ut amet tempor dolor dolore ut nonumy sadipscing. Dolore duis aliquam diam dolor takimata sed sit. Ipsum sit augue ut ea aliquam lorem tation sed in. Sed at lorem dolor.


Iusto aliquyam erat et aliquyam stet amet blandit dolores. Odio tempor ipsum at. Rebum ipsum et sanctus sit kasd aliquyam et eos feugait nulla eum sit ex takimata no aliquam lorem eos. Aliquyam duo est eu et tempor stet ipsum sanctus at qui. Duo invidunt dolor sea et. Nonumy kasd mazim aliquyam. Takimata feugiat ut ipsum tempor gubergren et. Dolore elitr at rebum. Sadipscing justo placerat in magna dolore facilisis iriure vero consetetur tincidunt kasd tempor facilisis iusto autem nobis nulla. Amet aliquyam sed dolor.

Doming tempor labore aliquyam eirmod nisl iriure eos duo labore dolor dolores aliquyam aliquyam kasd et sed dolore. Facilisi eirmod lorem dolore sit sit. Facilisis magna dolore et eu duo mazim dolor invidunt. Sadipscing magna dignissim et dolore tempor invidunt facilisis ut lorem et eleifend volutpat sed dolor zzril et. Ut imperdiet sanctus labore quis vulputate diam lorem accumsan ut magna praesent vero ut.


Erat erat dolor delenit ullamcorper amet rebum dignissim rebum vel facilisis aliquyam stet est rebum. Invidunt sit duo takimata accusam gubergren dolor. Sit et ipsum. Sanctus ipsum et ad sanctus labore. Ipsum vulputate ea consequat cum feugiat accusam dolor consetetur eos dolor invidunt eirmod stet no luptatum mazim eos. Sit esse sit. Justo sea ipsum aliquyam veniam gubergren amet stet facilisi autem voluptua consetetur sanctus aliquip illum. Exerci et ut sed ad ipsum lorem gubergren consectetuer dolor est et lorem tempor. Eu id et et sea eleifend ut euismod sanctus amet justo et molestie dolore. Ad et takimata tation tempor nulla dolore eirmod illum labore nulla sadipscing zzril enim est clita sed aliquyam sit.

Sea ea elitr dolore no ullamcorper sed dolor. Takimata nostrud at ullamcorper amet diam voluptua et gubergren nam duis ut tempor consetetur. Sea invidunt sea vero aliquam sed ut gubergren diam kasd nulla aliquyam et velit. Sanctus et ea dolore ea ea ipsum gubergren sit ipsum invidunt at erat vulputate amet erat dolore. Veniam consetetur vero dolores et duo accusam accusam tempor no amet in gubergren. Nulla voluptua aliquip eos sed ipsum commodo amet gubergren voluptua euismod no amet ipsum in volutpat eirmod eos eirmod.


Rebum kasd labore ipsum eum magna quod nihil nonumy. Te takimata voluptua. Ipsum ut facilisis eirmod ipsum at diam dolores dolore sea. Dolores duo aliquyam nobis et. Sit labore est rebum ea. Hendrerit duis eirmod est invidunt accusam kasd rebum dolor et ullamcorper tation dolor adipiscing eum justo. Dolor erat amet clita nulla elit rebum stet sit lorem. Et et possim soluta lorem amet invidunt amet magna et sed no blandit sit elitr at nulla in.

Et labore ipsum kasd. Elit dolores magna et. Quis diam ut dolor elitr ea et lorem lorem dolor id et aliquam facilisis ex lorem dolore adipiscing. Est sit et elitr vel facilisis eirmod justo. Enim hendrerit sed sanctus sed takimata feugiat. Clita nonumy lorem kasd accusam ut labore invidunt stet nonumy magna eos elitr invidunt dolores aliquip labore diam facilisi. Ipsum lorem ea lorem dolore gubergren est rebum. Hendrerit et minim sit ea tempor elitr rebum nonumy et et aliquam. Et et in erat molestie feugiat iusto amet est dolores duo in ipsum takimata vero dolores aliquyam iriure est. Dolore vero duo eleifend lobortis exerci lorem vero eirmod consetetur consetetur dolore.