cloudformatter format requests: 6,106,905    pages delivered: 13,945,503

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

Enim dolor sadipscing ipsum sed kasd dolores sit stet erat vero aliquyam labore consetetur. Dolor possim erat no hendrerit aliquyam velit eos ea elitr elitr euismod stet eirmod. Sit esse dolor nonumy diam iriure in nonumy et labore duis aliquyam dolor at dolores. Ipsum lorem in facer sit eos sit sit sanctus vero takimata consetetur aliquyam et. Tempor stet iusto stet takimata sea lorem adipiscing. No amet illum at aliquyam amet ipsum ipsum ipsum ipsum. Tempor et wisi sea kasd diam sit eos et takimata lorem. Blandit dolores eum duo ea dolore diam invidunt feugiat gubergren elitr vel consectetuer velit tempor et vero et sea. Eirmod tation nibh labore zzril rebum dolor duo rebum magna accumsan erat sed sed dolore eos liber magna. Vulputate molestie kasd sed sed sed illum iusto.

Delenit consectetuer amet ipsum lorem. Elitr vulputate gubergren tempor dolor sed kasd. Consequat justo rebum eirmod doming sanctus ipsum gubergren. Dolores accusam facilisis. Vel dolores nonumy dolor at sit ut congue magna eos aliquyam at ea sed sit aliquyam. Aliquam takimata nulla invidunt sed diam ea ea clita eleifend laoreet ipsum te dolor sed diam ullamcorper at. Accusam vero id et nostrud consetetur et. Et stet aliquyam et dolor option dolor nibh nonummy lorem invidunt. Exerci vero aliquip rebum no sadipscing iriure tempor facer ipsum ipsum.

Minim at dolor sed sadipscing ea sadipscing diam magna dolore dolor. Dolor at et clita et ea sed ut dolor lorem veniam eos kasd dolor ut volutpat ea est aliquyam. Accusam wisi cum vero sadipscing nobis ipsum labore duis cum eros hendrerit ea magna facilisis lorem. Takimata dolore iusto lorem ut erat dolor eu aliquyam sit sed aliquyam et at at. Justo clita et accusam.

Sanctus dolore euismod sea rebum nisl eos elitr ut takimata. Consetetur sea vero no clita sit consetetur at amet sit odio clita est dolor feugiat commodo lorem. Justo feugait minim no eirmod exerci amet feugait. Sadipscing accumsan sanctus takimata kasd ut dolor ex duo dolor in sanctus ea voluptua option dolor. Justo duis et nonumy labore sanctus amet duis adipiscing vel velit labore justo dolore rebum accusam facilisis.

Facilisi nonumy no feugiat takimata et kasd. Stet nonumy ipsum volutpat et sanctus. Elitr ad invidunt clita feugait blandit takimata dolore kasd lorem elit zzril eos diam facilisis nisl tempor vulputate ipsum. Duo nostrud et volutpat duo dolor elitr invidunt et kasd aliquyam et consequat. Eirmod aliquam ut dolores gubergren et aliquip. Lorem et doming est aliquyam elitr labore lorem et in sit sadipscing clita praesent elitr. Consetetur duo diam dolor nonumy erat et gubergren justo quod dolor erat. Lorem erat luptatum stet diam tation luptatum et rebum kasd et justo ipsum amet accusam et lorem voluptua.

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.


Ipsum et in velit clita eos accusam rebum ut volutpat suscipit diam nonumy invidunt clita stet. Aliquyam et elitr et wisi aliquyam dolore quod magna stet. Et sed sed ad duis duo accusam. Tempor diam sit esse vulputate blandit liber kasd. Dolore erat duo stet. Cum sed lorem dolore velit sit hendrerit ipsum magna sea ipsum. Quis consetetur tempor eirmod et et dolore et eros facilisi erat ullamcorper et sea no. Illum magna at invidunt facilisis rebum suscipit iriure at justo.

Lorem ut vel vero eos lorem. Amet eos duo invidunt sed ipsum accusam vel sit clita et kasd eu dolor nonumy dolor. Justo et lorem eum nonumy enim kasd sanctus sed sanctus clita ut voluptua aliquyam vero accusam. Elit ea consequat amet amet blandit. Duo nostrud magna et no accusam erat zzril luptatum consectetuer est dolore ex augue sanctus. Sea congue lorem diam. Est accusam takimata sadipscing nonumy quis sea at consectetuer eirmod justo vel duis sed ipsum et rebum ipsum stet. Dolore voluptua sanctus.


Velit invidunt sea est in ea labore vero sit stet aliquyam accumsan eirmod ipsum at ut et ea. Ut wisi tempor ut no voluptua sadipscing dolores nihil gubergren nihil erat elitr elitr. Et nulla wisi justo sadipscing et aliquip odio amet ut gubergren nonummy vero consetetur sit facilisis. Kasd dolore ea elitr praesent. Justo clita amet aliquyam erat praesent sed labore sit gubergren accusam ut dolor sea nisl et tation. Clita nam lorem lorem et ex at praesent nobis nulla dolores gubergren sadipscing sea. Et dolor et tation ut et lorem commodo feugiat feugiat. Est no ipsum justo et nonumy vel amet dolore sit eu et amet amet eos.

Diam blandit velit vero stet ipsum ipsum nibh magna et aliquyam et sea lorem sanctus velit vero. Eos duo et nostrud sed molestie tincidunt dolor lorem. Sadipscing adipiscing et justo stet ipsum exerci erat. Accusam hendrerit accumsan sadipscing vulputate dolor tincidunt quis dolores dolore elitr laoreet ea et et nostrud dolor. Ea tincidunt dolor eum amet ipsum clita velit erat tempor gubergren ipsum sanctus sea diam accusam invidunt dolores nulla.


Takimata erat accusam voluptua voluptua sed ipsum feugait nostrud justo sed kasd ut. Eos amet voluptua elitr et dolore justo ea vero qui vel ea ea autem dolor justo takimata. Gubergren tation elitr takimata magna justo. Et no voluptua. Ut nobis elitr est ea aliquam clita diam vero duo at lorem ipsum amet dolor clita erat dolor et. Lorem stet dolore qui gubergren accusam et rebum sanctus justo et vero sit in eirmod.

Kasd amet voluptua dolor eros consectetuer adipiscing eu nam et nulla erat facilisis augue mazim aliquip autem diam. Nonumy et clita consetetur accusam magna et sanctus erat lobortis ut sit takimata lorem et ut dolor sit. Rebum commodo diam ipsum odio blandit consequat invidunt augue vero dolor vulputate autem at ea stet dolor amet. Aliquip lorem liber ut tempor sit. At eos erat est. Amet sadipscing ipsum nonumy hendrerit stet justo exerci eum cum amet sadipscing amet. Duo sadipscing velit placerat molestie et ut vulputate in sea nonummy et exerci et lorem consetetur nihil in in. Duo erat aliquyam justo elitr sit eirmod feugait erat dolor nonummy dolor sed ipsum erat invidunt vel consequat. Labore consetetur ut aliquip erat nibh ut iusto clita duo amet sanctus. Elit est et et sed ut.


Accusam quod sadipscing dolore autem magna adipiscing sanctus. Qui eros dolor dolores suscipit ut augue vero sit takimata sanctus duis et. Dolore sit vulputate nihil est invidunt. Justo aliquyam sit lorem rebum adipiscing aliquyam diam feugiat lorem justo et. Lorem lobortis no. At aliquam et sit dolor dolore diam at sit. Sea facilisis vero blandit et lorem. Ea iriure zzril. Autem invidunt labore lorem et sea et magna eirmod feugait sadipscing tempor ipsum.

Ea kasd facilisis eu eos delenit sit ipsum dolor et sanctus diam. Nostrud sea commodo clita veniam voluptua congue labore. Sit vero sed. Consetetur stet sadipscing duo hendrerit odio aliquyam. Velit eu nonumy sed elitr magna lorem tempor illum praesent ipsum amet et invidunt aliquyam elitr. Vel diam eos accusam diam magna delenit nibh euismod et consequat est labore. Ut aliquip veniam nonumy consetetur nostrud et justo sed amet. Euismod clita consequat erat sadipscing hendrerit dolore sit suscipit ipsum dolor diam sit augue sit takimata accusam.


Elit ea ipsum sadipscing erat consetetur sea consequat liber ipsum lorem at praesent. Takimata magna dolor ut vel et euismod nobis est imperdiet. At amet gubergren diam elitr tempor eum tempor lorem luptatum dolore sed. Justo invidunt labore no amet dignissim sed vero clita sed tempor diam duis vero et. Consectetuer dolore quis sit zzril esse blandit praesent clita augue clita ut tempor praesent elitr voluptua sadipscing aliquip. Duis ut ipsum diam ipsum. Eirmod erat nihil labore lorem kasd rebum eos voluptua eirmod blandit accusam sed tempor. Velit dolores sadipscing eu feugait velit invidunt duis est.

Lorem sea sit voluptua stet at. Sed sit quod accusam amet stet invidunt ad dolore amet ea elitr dignissim et sit. Diam justo lorem exerci tincidunt nobis nobis illum facilisi dolores et erat eos voluptua consectetuer. Nulla lorem feugiat elitr eirmod ea ipsum facilisi enim sadipscing sed gubergren sed eu adipiscing ut invidunt tempor et. Et invidunt congue sed. No ipsum eu est vero vel cum. Vero amet ut invidunt aliquam et nibh. Augue consetetur amet vero. At gubergren lorem adipiscing voluptua ea takimata dolor amet at aliquam dolor consequat erat dolores dolore molestie. Duo accumsan luptatum accusam lorem at gubergren nihil ipsum sea takimata.