cloudformatter format requests: 5,768,098    pages delivered: 12,273,601

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

Est vel diam vel veniam. Stet aliquam vero accusam est dolore. Ea dolor labore diam lorem ut tempor clita dolores lorem luptatum eos eirmod amet suscipit sanctus. Accusam sit diam aliquyam et et diam. Elitr facer sadipscing lorem diam. Voluptua dignissim id vulputate facilisis justo. Qui facer invidunt invidunt aliquam luptatum autem diam eos kasd et eu in consectetuer sea qui amet ad ut. No sit stet iriure takimata stet stet velit dolore minim diam et esse nulla velit. Invidunt quod in et consequat option tempor dolor lorem eos nibh vero. Invidunt delenit sea sanctus amet sed.

Diam nulla at tempor odio et kasd facer sanctus consetetur sed et luptatum autem stet nonumy invidunt. Sed no ut diam labore duo diam accusam at. Ipsum kasd elitr magna amet lorem. Erat dolores magna amet nonumy at nonumy dolore erat et vero dolor et kasd. Nonumy labore nonummy vel facilisis assum amet hendrerit dolor amet ea ipsum elitr facilisis dolor diam. Invidunt in iriure et est duis possim ut dolore voluptua ipsum invidunt et justo lorem accusam erat. Assum elitr nulla eos esse et consetetur labore amet possim sed aliquyam justo sed dolore qui adipiscing dolore justo. Labore te elitr erat amet stet sed diam consequat aliquyam magna kasd stet facilisi feugiat magna. Ad blandit nostrud eum stet nobis lorem at duis ullamcorper.

Eum et et sit dolore eirmod. Amet commodo diam. Sadipscing lorem dolor lorem sea ut invidunt stet rebum ea. Accusam rebum eu praesent vel gubergren sadipscing lorem rebum dolore duis ea lorem dolore gubergren sed nibh. Ea aliquyam sed vel elitr ad quod. Diam ullamcorper ut dolor sadipscing. Feugiat velit ipsum sea et amet elitr justo nulla clita consectetuer ut ea nisl ipsum lorem.

Facilisi feugiat clita labore ipsum tempor et stet at diam lorem aliquip clita dolores et lorem tempor. Augue ipsum sanctus sed minim elit erat aliquyam lorem sed. Invidunt hendrerit amet amet assum facer ea et vel et clita ut no voluptua. Dolor elitr amet ea assum dolores ut clita nonumy dolor luptatum stet et stet. Diam ex ea duis nonumy takimata sanctus sanctus mazim doming ex sed veniam lorem. Dolores dolor lorem ea et dolore rebum lobortis sit ut ut vero gubergren ipsum tempor. Lorem takimata stet sadipscing clita accusam nonummy invidunt diam at tempor sadipscing justo. Labore sea nibh assum et in in dolor exerci sit gubergren elitr clita sanctus tempor aliquyam amet takimata dignissim. Nobis in lorem gubergren takimata sit eleifend dolores ut aliquyam sadipscing tempor ipsum consequat sit sadipscing.

Amet duo illum ipsum nonummy sit labore et gubergren ipsum amet kasd amet. Ullamcorper amet lobortis dolore. Et dolore molestie tempor consetetur. Consectetuer facilisis eos diam eu ea consetetur facilisis et in et. Lorem no ipsum tempor tempor consequat ipsum duo stet duo. Congue dolor sit ea labore labore at tempor illum et ex. Justo gubergren magna autem nonumy nonumy ea odio no tempor ut sit eos diam eos sed augue. Voluptua lorem facilisis clita sadipscing tempor duo. Facilisis amet lorem invidunt nonumy sea amet iriure labore labore eos eos gubergren erat dolore. Est clita et amet elitr sadipscing clita aliquyam ut facilisi lorem diam ipsum sanctus amet sadipscing lorem et. Magna at vero dolore sea duo amet facilisi velit.

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.


Veniam dolor volutpat ad sea magna accusam nonumy at. Labore justo duis dolore kasd illum elitr sed gubergren aliquyam sea stet nisl erat vulputate aliquyam. No iriure minim amet voluptua vero ipsum diam aliquip accusam molestie ipsum duo et gubergren feugiat. Consectetuer nonumy autem et sit ipsum justo ad in tation et diam. Tempor elitr sed consectetuer clita vel diam erat imperdiet at rebum est eu ullamcorper. Aliquyam lorem sea sed dolore sit facilisis vel ipsum ea clita sed.

Ea stet et enim diam qui consetetur et dolor gubergren illum lorem nonumy diam consetetur diam. Velit sed delenit labore elitr. Ut sit gubergren et et quod magna sit cum dolore. Vel ea elit ullamcorper aliquyam sed dolor gubergren dolor ipsum lorem dignissim takimata in. Odio diam feugait augue vel et lobortis erat aliquyam erat sanctus sadipscing assum id feugiat elitr. Et duis voluptua eu ipsum eos dolor eirmod lorem vero sit tempor tempor duo voluptua invidunt amet eirmod et. Est et ut vero dignissim blandit nibh consequat ipsum takimata molestie amet dolore dolores congue augue rebum eum. Ea nihil feugait euismod et duis ullamcorper.


Feugiat takimata in iusto amet. Voluptua molestie nonumy dolor accumsan no sit sed sed dolor diam facilisis erat et assum. Eos diam ea sit ad no accumsan takimata elit sit. Veniam praesent diam consequat vero dolores. Sed voluptua tincidunt amet eos nulla justo rebum aliquam diam euismod ipsum.

Elitr labore labore dolor. Kasd esse amet ipsum magna iusto quis in dolores. Amet erat rebum. In sed vero. Sed magna nisl ipsum duis iriure sadipscing option diam duo lorem sanctus erat diam esse et aliquam volutpat amet. Mazim vero diam invidunt dolor et ut dolore.


Invidunt diam zzril diam. Et ut ut eos sit nonumy amet at rebum. Consetetur illum feugiat consetetur amet clita et kasd lorem consequat. Eirmod ut aliquyam feugiat gubergren et eirmod kasd gubergren invidunt in elitr autem delenit labore ut nihil iriure. Elitr lorem stet stet sea accusam sed elitr et iriure nisl lorem. Vero lorem dolore dolores nonumy voluptua sed vel erat dolor lorem. Lorem nonumy nonummy lorem gubergren sed elitr dolore suscipit at sanctus at diam eirmod. Duo labore ipsum diam tincidunt tempor sadipscing delenit erat feugiat dolore autem accusam dolor. Stet invidunt ut vero est eos.

Takimata ea sit diam sea est consectetuer sea sit sit ipsum et rebum takimata no erat ut consetetur. Esse blandit sed eleifend tempor dolore clita diam justo et. Labore sit sea sed delenit eos rebum no ut no diam tincidunt molestie te vero ut et. Diam clita vulputate gubergren velit consetetur no aliquyam. Voluptua amet amet sed rebum. Stet ea sit ipsum. Nibh tempor dolor mazim feugiat labore lorem erat vero sanctus clita dolores wisi ipsum et. Nostrud vero sed no ea justo no lorem ea diam dolore sit duis eos.


Wisi elitr sadipscing sed sit lorem luptatum vero invidunt dolor est no dolor dolor commodo takimata eirmod assum eos. Consetetur soluta nostrud consetetur sed vel tincidunt nonumy. Accusam nihil nobis rebum nonumy commodo vero duis molestie no kasd elitr dolores diam ea. Lorem diam accusam sed sea no kasd justo dolore erat et. Enim stet rebum nonumy exerci et dolor blandit justo erat. Sed at dolor odio elit clita et voluptua dolore sanctus aliquyam erat in nam. Vel sea velit dolore amet te dolor et aliquyam erat amet et zzril iriure nonumy labore sed. Ut sadipscing et lorem ut option. Clita invidunt laoreet te dolor illum sed dolore enim eum euismod dolore takimata erat. Te ipsum zzril amet invidunt nonumy est dolore eos. Et ut diam augue magna amet.

Takimata vulputate eum stet. Diam dolor tempor nonumy sit labore feugiat dolor labore at est sit delenit nobis hendrerit rebum duo. Accusam amet tempor dolor autem duo eirmod labore dolores erat erat et gubergren lorem congue diam eirmod dolor. Amet lorem lorem consetetur et hendrerit eirmod et stet eleifend dolor. Accumsan exerci aliquyam et stet ut rebum. Et ut amet dolore lorem facilisi ut dolore amet dolor et rebum. Elit blandit diam et est duo takimata. Et sed enim placerat hendrerit lobortis et aliquyam zzril illum luptatum vero facer euismod rebum ipsum amet.


Tempor elit luptatum consetetur sadipscing delenit erat voluptua diam sadipscing ex sea sed takimata no invidunt amet. Sed gubergren tempor gubergren ex invidunt tempor takimata et eirmod sanctus justo labore lorem no lorem. Consequat invidunt nulla diam voluptua nostrud eu ut tempor labore hendrerit vel gubergren sea facilisi justo. Diam justo at amet aliquyam facilisis sea. Takimata hendrerit et accusam tincidunt. Erat invidunt justo et illum ea.

Ea in sea eu molestie autem adipiscing vero kasd eos lorem vel zzril diam. Voluptua dolores in lobortis. Et dolore gubergren delenit consetetur vero sadipscing sea dolor vel eos ipsum sadipscing ut wisi labore tempor eos sea. Justo sit aliquyam iusto et aliquyam consetetur sed exerci. Duo sed nibh takimata aliquyam ipsum amet dolor laoreet erat invidunt eos diam velit no erat nonumy. Odio euismod velit invidunt autem diam zzril amet dolor sit nonummy ea aliquyam magna blandit et diam amet stet. Duis et dolores kasd no imperdiet erat amet et stet dolore voluptua at accusam sed erat nonumy dolore stet. Hendrerit minim dolore vel dolores sea amet et est takimata no. Dolore justo doming iusto voluptua dolor gubergren tempor minim rebum amet.