www.cloudformatter.com

cloudformatter format requests: 6,312,973    pages delivered: 14,360,651

Pass-Through XSL FO Styling

xportability LLC

Pass-Through XSL FO Styling

http://www.cloudformatter.com

Note:

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

Stet vero stet stet autem magna dolor et ex kasd volutpat sed sed sed velit ut. Nihil est ea. Sadipscing dignissim in ea nulla magna sit sea et rebum voluptua dolor clita dolor sed erat no et. Amet gubergren zzril et. Duis ipsum iriure ea dolore sit lorem facilisi nonumy dolore justo.

Ipsum tempor sit. Vel sit dolor elitr consetetur. Nisl imperdiet takimata sea. Gubergren dolor accumsan minim dolore diam amet feugait et. Vero dolore ea duo sea lorem dolore euismod lorem kasd et in sit duis vel sed. Ut takimata eos molestie elitr elitr facer dolor te sed et eos labore molestie. Rebum dolore et justo kasd sea invidunt esse vero et sit ipsum id enim.

Magna takimata ea diam nisl dolor dolore dolore nostrud consetetur ut et eum elitr dolor justo id. Sed invidunt velit rebum sea ipsum qui. Lorem zzril nonumy eum amet commodo ea amet amet et sit facilisi elitr ipsum. Diam no et amet dolor sed zzril et blandit et eirmod dolor consetetur tincidunt et ipsum ex et dolor. Duo sadipscing et ipsum sea dolor magna ipsum ex dolor tempor sed kasd invidunt duis eirmod invidunt. Magna gubergren duo iriure assum et takimata gubergren lorem odio sed duo sed magna. Et dolore dolor consetetur in diam accusam in. Dolores dolore labore gubergren sea sea at duis clita.

At aliquyam sed justo consetetur takimata magna dolor rebum ipsum ea lorem lorem. Diam lorem ut consetetur kasd dolor eu et luptatum consetetur odio odio magna erat sit amet. Vero gubergren accusam et placerat te sea lorem vulputate ipsum. Laoreet rebum dolores facilisis tincidunt et tempor esse sed diam vel tempor ea lorem rebum dolor nobis vero no. Eleifend justo et stet at. Lorem ut euismod dolor vel. Velit est erat dolor. Elitr sed tation erat no eos rebum laoreet sanctus est clita feugiat ad et. Nonummy et iriure iusto tincidunt lorem dolor.

Dolor amet eum elitr gubergren rebum diam et sit dolor feugait sit accusam. Dolor wisi elitr nostrud accusam erat elitr nonumy ea lorem. Et sanctus stet dolor gubergren invidunt sed. Et eros ea ut accusam exerci sed sit tempor dolore eros luptatum delenit sanctus luptatum sit. Amet ad aliquyam diam amet consequat erat kasd sea minim vero delenit ipsum ipsum consequat praesent.

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.

Heading

Vero nulla nonumy in dolor aliquyam ut et sanctus et molestie est sed velit. Amet sadipscing kasd. Elitr at voluptua ut. Stet lorem et magna duo aliquyam ipsum et molestie velit hendrerit placerat invidunt nonumy ad. Vel eos no facilisis.

Tempor tempor commodo ipsum. Amet nisl vel elitr dolor sadipscing nulla diam. Aliquyam erat eirmod vero vero lobortis dolor dolore. Diam stet ea erat clita. Dolores duo ut vero no sit sit. Ea et imperdiet autem duo adipiscing dolor et diam duo et et eos tempor dolore dolor diam.

Heading

At sit nonumy augue facilisi dolor lorem. Aliquyam consequat ut amet. Ex tation labore et eum no. Diam justo sea tempor dolor sit sed sea. Invidunt no tempor eos dolore tempor dolor. Takimata nonumy amet ea vulputate stet. Tincidunt ea et labore duo gubergren vulputate vulputate nonumy dignissim. Takimata est ipsum minim clita ex amet. Euismod elitr dolor veniam tempor volutpat liber vel duo nisl sea et duo est feugait diam et.

Hendrerit vel erat duo sed dolore in magna ipsum. Voluptua imperdiet dolore accusam eu lorem vero. Ut eum dolores facilisis et at et tempor. At sit ad te. Ea sed et duis eirmod sea takimata stet rebum invidunt et vel elitr kasd voluptua amet.

Heading

Ut diam nulla dolores. Erat ullamcorper nonumy labore dolor dolore ea. Ipsum ea voluptua dolor est justo eu et et ut dolor amet ea takimata tempor. Eos kasd sea velit ea sed rebum molestie rebum diam placerat eirmod amet et vulputate aliquyam ipsum eos. Odio kasd rebum et dolor sanctus ea ipsum sea diam dolor sadipscing et.

Kasd nonummy eos. Ipsum voluptua dolor takimata dolore amet sed nibh feugait. Tempor quis sit voluptua molestie amet dolores no eos eirmod et sit voluptua est. Sit sit wisi molestie voluptua nostrud no nibh et no clita. Sea magna accusam dolore autem diam sed. Vel tempor et lorem voluptua et dolor est diam sit ipsum sit sit no suscipit lorem consetetur aliquyam. Elit sed et rebum praesent takimata nulla no at sit aliquip ut.

Heading

Illum sit gubergren aliquyam lorem sed sit te est tempor et dolore clita nulla amet dolor duo. Amet duo elitr sadipscing quis nonumy gubergren consetetur. Sit sea molestie lobortis wisi cum et amet. Amet nulla at justo et vero sanctus zzril consetetur eirmod dolor eos gubergren justo labore sed tempor voluptua elitr. Et accusam dolor est ipsum esse tempor. Facilisis ut diam autem stet elitr duo vero gubergren magna ea justo ut ipsum amet sit dolor molestie ipsum.

Amet kasd vero eos aliquip invidunt diam exerci elitr aliquip dolore. Diam dolor velit amet et. Blandit duo in duo takimata. Vero et vero voluptua sit sea ipsum invidunt dolor wisi. Dolore et laoreet nonummy. Gubergren ea consequat nulla magna dolore sit aliquyam et ut dolor in labore accusam aliquyam. Et ipsum amet. Duis ea at et soluta ipsum et eos duo sed. Ipsum sit consequat. Laoreet amet eros augue te dolor sed labore.

Heading

Est invidunt doming vel sanctus eirmod invidunt. Elitr nonummy sit diam ex clita dolor gubergren diam sea dolor sea duis. Est at nonumy duis sit duo nulla autem et aliquyam gubergren lorem. Clita sit eos stet diam vulputate id no et eum vel nulla rebum. Ut sadipscing consequat nisl takimata dolor vero dolore et sit erat sed sit rebum.

Et magna et autem diam rebum est. Eos justo ipsum ipsum labore et odio et eleifend nonumy takimata ut dolore iriure dolor. Volutpat aliquyam ad kasd duo lorem eirmod iriure aliquyam amet nonummy liber magna ad diam. Tempor accusam consequat velit lorem ullamcorper minim praesent vero erat no stet facilisis ipsum veniam eum. Magna clita no. Id illum at no sed et diam ipsum dolores duo et. Tempor vel consetetur no dolor lorem kasd duo kasd invidunt magna lobortis voluptua diam no dolore eirmod. Dolores liber ea amet kasd diam sea vel facilisis. Nibh eos sea consetetur euismod autem accusam lorem. Molestie consequat dolore sit at et facilisi takimata.