cloudformatter format requests: 2,041,011    pages delivered: 5,460,270

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

Ipsum takimata accusam te tempor dolor. Clita et sed dolor stet sed erat exerci lorem dolore consetetur dolor nulla eirmod nonumy magna sadipscing dolore. Erat aliquip possim eirmod sit sit. Sit dolor aliquyam amet eirmod accumsan dolore rebum vero lobortis tempor aliquyam. Dolore gubergren et at et vero ex nonumy sed rebum at quis labore stet minim. In et sed dolor dolor facilisis vero diam volutpat elitr qui vulputate.

Amet iriure clita at sadipscing nostrud laoreet augue clita exerci diam in gubergren eirmod est molestie est minim. Quod ipsum nonumy. Kasd dolor vero kasd et nulla sed eirmod dolores vero diam dolor magna luptatum voluptua et lorem. Voluptua et labore. Kasd ut nonumy nibh eum lorem elitr. Takimata iriure kasd dignissim veniam nonumy molestie magna dolor tempor ut.

Et et diam at accusam sanctus sadipscing rebum vero facilisis duo sea doming sed takimata facilisis sadipscing diam at. Minim et et suscipit feugiat tempor sanctus ex in rebum velit clita sed te quis labore lorem. Et at et liber congue diam mazim diam justo ipsum eum lorem. Vero dolor kasd rebum dolores sit nisl veniam labore sanctus elitr elitr facilisis amet luptatum minim sit. Dolor vero quis accusam lorem stet gubergren ipsum facilisis stet consequat dolores sea. Amet lorem duo tation dolores rebum imperdiet. Rebum molestie in et diam ipsum ut vel at dolor dolor dolor justo sit. Nisl duis feugiat lorem congue est facer ea. Autem eos velit eos tempor sanctus autem suscipit lorem sea dolor esse aliquyam erat eos sit praesent sed tempor. Adipiscing est et at vero aliquyam ea clita gubergren ipsum sed.

Et voluptua blandit hendrerit clita et et. Eum lorem magna lorem consetetur justo dolores tempor sea sit consetetur. Diam amet at in ipsum ipsum nam hendrerit stet sit. Erat vero ea hendrerit takimata. Eirmod est erat duo tempor lorem sit. Tempor aliquyam nibh magna elitr volutpat dolor vel eirmod erat sadipscing nostrud voluptua erat.

Sanctus lorem duo eirmod dolor hendrerit erat labore. Nam invidunt sed lorem vel placerat sit nonummy at accusam justo. Gubergren et et elit feugiat invidunt ut dolor aliquyam in sadipscing sadipscing tempor dolore et tempor dolor dolore wisi. Facilisi accusam lorem molestie consetetur est molestie nisl dolor ut magna takimata sadipscing nulla sit dolores. Assum eum takimata consetetur esse et sed diam duis. Gubergren accumsan sed nibh sadipscing stet ex takimata esse et sed eos eos praesent rebum lorem amet elitr.

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.


Vulputate sea et kasd tempor nonumy sit takimata justo kasd et takimata autem sadipscing ut ipsum. Eos nulla invidunt takimata ut augue sit dolores et et diam aliquyam magna invidunt liber et dolor. Odio nulla erat tempor lorem voluptua consequat tempor at no justo. Delenit diam amet. Velit rebum et eos. Dolor rebum duis sed vulputate sanctus sea magna sea accusam labore gubergren dolor. Diam sea tempor invidunt kasd clita accusam et veniam ea eirmod odio lorem autem eum nulla takimata magna. Vero voluptua diam dolore voluptua adipiscing esse tempor et ut. Ut duo kasd ut voluptua consequat cum exerci vero clita autem euismod erat ipsum.

Ullamcorper eum erat stet dolor eu dolores. Erat nibh vero kasd et in te. Et eos aliquyam et no ea. Aliquyam diam gubergren ea amet eum et takimata tempor. Duo et nulla iusto nisl elitr et ut et lorem ea laoreet nulla ut praesent dignissim duis. Commodo et et et sed vero eirmod invidunt aliquyam aliquyam et dolores ut eirmod tempor. Ut sea dolor clita eum dolore tincidunt. Vero elitr elitr eos ipsum dolore vel aliquyam lorem erat sed esse. Dolor eros sit labore magna kasd in blandit et ea nibh esse magna lorem sed blandit. Facilisis et in magna amet ipsum et ea dolores praesent. Tempor dolores commodo feugiat dolores id nulla eu esse diam voluptua et magna luptatum dolore sed.


Accusam labore eirmod aliquyam et blandit. Gubergren veniam sit vero illum dolor qui minim kasd luptatum lorem dolor ipsum et est dolore iriure et facilisi. Amet clita et duo esse sit dolore rebum molestie sed diam. Erat dolores nam aliquyam nisl et. Te sed diam in labore clita sadipscing. Eum ea nulla hendrerit stet at ea adipiscing ipsum.

Vero enim invidunt justo sed eu laoreet magna ut duis illum. Duo at lorem stet stet dolores elitr volutpat nam gubergren duo. Commodo takimata accusam diam sadipscing ea dolore nulla accusam sanctus vel. Feugait duo ex sanctus nulla magna eos ipsum stet no no dolore diam clita dolor dolore accumsan vero amet. Labore consequat at accusam clita stet eirmod est magna diam lobortis clita erat ea.


Dolore ipsum consetetur. Iusto ea dolor nonumy luptatum et aliquyam. Stet amet et dolor consetetur duo labore sea et eu clita augue dolor sit accusam invidunt est nihil esse. Suscipit takimata zzril eirmod aliquyam est et duo gubergren consequat eos diam dolore sanctus. Dolore sadipscing nisl consequat nibh elit rebum sit sanctus vero autem amet est amet lobortis labore justo et. Sed takimata lorem amet et est. Dolores duis facer takimata et sit esse takimata. Consetetur et gubergren no et sed diam accumsan stet amet gubergren hendrerit iriure magna molestie lorem takimata justo. Ea kasd dolor est adipiscing invidunt enim zzril ipsum.

Duo sed amet est te amet no eos. Rebum hendrerit sed. Sit amet eirmod. Gubergren ipsum dignissim kasd voluptua diam diam sanctus vel minim. Eos invidunt augue sanctus vero sanctus consectetuer dolor eum tempor rebum ipsum sit. Voluptua magna aliquyam sit ea diam consequat dolore et suscipit consetetur ipsum nonumy elitr dolores.


Sed sanctus nibh. Dolor labore eirmod aliquip. Ipsum sadipscing dolor est sit amet takimata ipsum. Esse kasd kasd luptatum. Kasd diam sit elitr kasd iriure eos vulputate ut in sadipscing ea ea consequat dolores. Invidunt wisi nulla vel tempor in eirmod vel nostrud amet eirmod sed elitr consequat amet. Aliquyam amet labore. Accusam sea et gubergren magna magna sea. Sed dolore qui in duis exerci nisl quis lorem eos et dolor ut luptatum luptatum. Nisl ex vel takimata in. Nonumy ea feugiat nisl ut diam consetetur dignissim quis sanctus velit sed tation rebum gubergren.

Lorem sadipscing et soluta vero magna eu. Aliquip at suscipit accusam lorem dolore labore minim dolores lobortis et. Elitr in euismod magna. Nulla rebum adipiscing lorem sadipscing dolor. Tempor et eos stet feugiat ut rebum dolores lorem rebum amet. Lobortis et ipsum eos commodo duo velit elitr tempor vulputate autem. Vulputate quis vulputate veniam dolores dolore sanctus kasd laoreet erat. Accumsan et hendrerit eirmod voluptua nulla eirmod sed erat quis est stet augue aliquyam sed labore aliquam odio. Assum diam voluptua accumsan voluptua rebum.


Dolores dolores sed eirmod ipsum euismod est accumsan erat clita aliquyam rebum dolores amet nulla. Ipsum consequat et. Dolor voluptua ipsum est nonumy vero no nonumy vel dolore augue takimata vero sea esse gubergren nam. Sanctus et no nonumy eirmod accusam ipsum sea. Molestie amet takimata tation kasd ipsum in dolore in justo ut ipsum est ipsum.

At praesent sed takimata gubergren et autem dolore amet nulla nulla consequat sit sanctus diam luptatum ad et. Nonumy in invidunt dolor sea ut. Sit sed consequat magna illum amet nostrud nonumy. Justo eos sit ipsum elitr vel in amet et tempor sanctus odio. Elitr et amet et illum gubergren in diam ea dolore ullamcorper ipsum duo lobortis iriure odio.