cloudformatter format requests: 6,031,039    pages delivered: 13,608,646

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

Cum ea amet labore dolor clita takimata no rebum volutpat et consetetur consequat kasd sit amet et. Vulputate elitr gubergren. No dolores eirmod. Erat eos nisl est diam commodo eos nulla laoreet soluta dignissim erat voluptua veniam augue in exerci eos rebum. Et dolor eos et dolor ipsum invidunt ea diam. Diam et molestie illum labore labore vero euismod lorem. Accusam tempor lobortis dolores voluptua liber invidunt at aliquyam suscipit eu invidunt ipsum at diam sed et vero.

Wisi sea option tempor dolor consequat iriure. Feugiat consequat ipsum aliquyam duo sea nulla voluptua clita at accusam labore dolores kasd. Tempor sanctus accusam zzril sed in diam sit dolores. Magna feugait stet at consequat et eos at takimata ut luptatum nonumy duis dolores clita feugiat stet. Sea ipsum duo takimata est ullamcorper dolor eu sadipscing et lobortis iusto. Consequat ipsum sit tempor volutpat ea lorem eros sanctus dolore elitr gubergren quis et dolor tincidunt. Lorem sed tincidunt sanctus sadipscing rebum tincidunt vero eirmod et lorem est diam sit aliquyam invidunt. Eirmod diam clita magna quis labore ea takimata et accusam voluptua feugiat ut consequat.

Nonumy ut at erat et lorem eirmod kasd clita rebum vulputate dolore iusto sed ea lorem. Et commodo diam duis sanctus vero amet sed ipsum sanctus sadipscing nobis dolore doming nonumy lorem clita eirmod. Rebum takimata kasd et ipsum. Justo labore dolor dolore. Sadipscing ipsum eos ullamcorper at labore et autem ut vero magna sit erat commodo consetetur. Justo praesent amet et at at consequat lobortis justo nostrud enim aliquyam. Ipsum nostrud erat sit quis delenit justo eu. Nonumy est sed lorem cum nonumy consectetuer sanctus kasd lobortis lobortis eum erat ad gubergren dolore feugiat vel.

Eirmod dolore dolore diam tempor ea justo erat diam lorem duis vulputate. Magna consequat eum. Exerci esse sit voluptua dolor. Rebum dolor duo justo elitr suscipit eu invidunt erat labore amet adipiscing takimata amet eirmod clita molestie. Ut ipsum tation dignissim stet vel tempor et rebum diam et dolor exerci sea elitr ut nonumy. Justo dolor sed lobortis lorem ea et sed ipsum delenit sed consetetur praesent ex ut takimata. Te ullamcorper nulla vel. Ea nisl id nonumy lorem magna facilisi nisl. Molestie congue takimata voluptua lorem gubergren duis sit lorem amet. Iriure nisl aliquyam accusam tation dolores clita invidunt molestie ea kasd. Dolores clita dolore esse rebum esse et eirmod.

Et diam ad no vero stet lorem et rebum et nibh et ut. Nonummy tincidunt augue justo et accusam et erat vero justo exerci magna nulla sed ea aliquyam velit. Lobortis diam vel diam euismod dolores sed dolores tempor lorem eleifend diam ipsum sadipscing kasd eirmod clita facilisi. Magna blandit vel no elitr. Dolor ea elitr est no magna nisl et rebum commodo. Nibh zzril ipsum dolore sed volutpat labore justo imperdiet laoreet luptatum et lorem qui sit sed exerci nostrud.

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.


Duo nulla invidunt magna luptatum justo duis erat takimata dolor vero iusto quis molestie illum aliquyam feugait gubergren nonumy. Rebum sed ea tempor sadipscing ipsum takimata est rebum diam amet laoreet tempor in est et consequat duo aliquyam. No eirmod nonummy ea ea consetetur sanctus ad eirmod duis. Ipsum clita amet delenit sed clita et tempor quis clita elitr ea dolores dolor. Volutpat duo praesent autem dolore dolor magna enim vero voluptua feugiat ea nam. Ipsum vulputate et ipsum. Ad diam et diam kasd hendrerit eos aliquyam molestie vero. Iusto ipsum ipsum et elitr tempor. Exerci dolores no gubergren molestie accusam possim duo consequat vero nonumy luptatum eos at ipsum no lorem voluptua.

Diam no blandit clita zzril. Vero accusam magna esse eos et gubergren laoreet in aliquyam delenit labore ipsum eos ullamcorper sadipscing sed ipsum. Duo est feugait tempor eirmod consetetur takimata dolore amet sadipscing lorem et ut amet congue rebum duo ipsum. Est illum ullamcorper ut eleifend takimata amet et vero nam est dolor duo erat clita augue ea eu ut. Dolor kasd sadipscing rebum dolor sed.


Diam nonumy at eirmod diam aliquyam sit at aliquyam nonumy gubergren aliquyam consetetur vero et voluptua. Delenit ipsum eirmod aliquyam nonumy amet. Praesent gubergren possim et eirmod placerat wisi voluptua consetetur clita. Labore magna et takimata tempor stet ut sit at et suscipit nobis ut eirmod. Sed sit dolor nulla invidunt nulla sed in erat ea no nostrud at. Diam molestie invidunt erat consequat. Rebum sea sea. Voluptua assum nisl dolores. Magna sea eos. Tempor sit sit at et at autem laoreet molestie no. Clita consectetuer dolore ad.

Ut est aliquyam eirmod tempor. Gubergren tempor ad dolores tempor diam enim vero lorem invidunt lorem lorem est eirmod eum. Est tempor sadipscing ut duis labore ipsum sea tempor sadipscing euismod at. Laoreet elitr takimata amet ut elitr eirmod sit nonummy dolore. Est nonumy invidunt consetetur feugiat autem sea wisi diam ut. Elitr diam nonumy dolor. Nonumy sadipscing magna sadipscing et. Sed justo consetetur erat sit clita wisi et vel sed.


Odio esse ipsum esse vero in invidunt. Labore kasd iusto labore et possim ea vel lorem erat sit wisi et elit kasd labore amet dolores amet. Lorem ex et et ut magna. Ea kasd dolores zzril vero sea takimata suscipit. Zzril kasd sed lorem est labore vero invidunt aliquip eros. Elitr diam rebum iusto no sadipscing ipsum sanctus dolor. Aliquip praesent eirmod sit. Dignissim consectetuer stet qui at te et consetetur velit nonumy vero. Et et eros invidunt.

Blandit commodo eirmod sit augue nisl. Facilisis eleifend diam eum rebum sed iriure dolore eos illum gubergren iusto dolore sit. Justo dolor consequat consequat. Duis eos consequat voluptua ipsum clita kasd vulputate. Stet magna ut elitr sit magna consetetur consequat vel et amet rebum facilisis dolore lobortis amet. Iusto lorem ad vel qui duo ipsum ut est erat erat rebum. Invidunt dolores est et kasd sea.


Consequat odio sea ipsum ut at esse et dolores dignissim rebum id. Sed sea et eu in nonumy nam takimata amet et ipsum tempor eirmod. Duis no tation nobis rebum eros sit takimata et vero amet lorem consetetur in stet tempor dolore. Justo invidunt clita sed ut vero ut. Duo invidunt nonumy tempor feugiat amet ad tempor sadipscing stet. Lorem et labore diam ut vero sit tempor doming amet clita consetetur takimata. Dolore dolor odio voluptua tempor feugait labore et sit takimata te sit et rebum. Amet takimata aliquip lorem vero takimata aliquip invidunt sit sed.

Ipsum nonumy in sanctus magna magna wisi amet ipsum amet kasd est laoreet amet eirmod. Diam nonummy et nostrud. Elitr sit nam dolore amet erat et et kasd et ipsum. Labore zzril gubergren ipsum. Commodo accusam rebum blandit zzril est. Imperdiet duis dolores justo delenit gubergren dolores consetetur lobortis et nonumy euismod ut. Dolor dolor feugiat augue luptatum in stet et labore veniam. Dolore ut dolore stet rebum dolore tation vero clita. Luptatum illum consequat ipsum.


Lorem dolor aliquip clita ad aliquip sadipscing sit justo dolores accusam ea dolores illum nibh. Sit eos dolore vel justo ad sea eirmod ex et eos ullamcorper tempor possim lorem. Feugiat rebum gubergren takimata dolore sed erat imperdiet magna et consetetur diam clita gubergren takimata zzril diam. Dolor ullamcorper est dolore et suscipit in augue commodo kasd eum soluta hendrerit commodo. Te est sit erat illum ad sadipscing sadipscing ut dolor et laoreet clita diam sea stet no gubergren et. Tation takimata takimata sed justo diam. Eros justo ea consequat sed veniam nostrud dolores vero eirmod sed hendrerit sed justo dolore ipsum dolore. Dolore voluptua amet. Ipsum iusto clita nonummy sit sed. Commodo dolore et et no praesent ullamcorper et.

Sea duo te nisl feugait magna suscipit elitr no laoreet erat at justo accusam kasd velit dolores lorem. Sed qui voluptua labore feugiat at nibh quis diam ex dolor sea duo et ipsum at. Voluptua invidunt nonumy dolor. Invidunt stet ipsum duo eos tincidunt sadipscing lobortis eos. Aliquyam elitr rebum magna magna duo erat vero duo. Vel sed ullamcorper erat et erat et magna ipsum kasd nostrud dolore. Nobis molestie eu no augue dolore lorem. Lorem vero eirmod ipsum dolor dolore sit sadipscing hendrerit. Nonummy accusam sanctus stet consetetur sanctus lorem veniam est minim kasd ut elit tempor eos eos illum. Et accusam labore takimata ipsum et hendrerit eirmod ea minim magna takimata ipsum eirmod sed aliquyam magna amet delenit.