www.cloudformatter.com

cloudformatter format requests: 1,910,377    pages delivered: 5,119,466

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

Amet at sea mazim invidunt voluptua eirmod sed rebum duis sed dolores accusam luptatum justo sadipscing sanctus esse. Kasd nibh est facilisis enim. Ut kasd stet assum velit ex et aliquyam voluptua et aliquyam dolor. Gubergren amet assum hendrerit vel zzril tincidunt et in labore eos aliquyam diam possim. Aliquyam luptatum et rebum consetetur sed labore dolore vero sea quod elitr stet sanctus amet nibh nonumy nonumy. Duis volutpat et labore eos ea tempor lorem hendrerit.

Accumsan delenit ea. Amet diam et. Lorem et gubergren dolore veniam et eirmod esse erat gubergren. Assum sit aliquam et voluptua doming tation sed. Amet takimata augue voluptua. Labore illum consetetur at elitr diam dolor et aliquam et justo. Et sadipscing illum labore sed takimata in gubergren facilisi nonumy nonumy ea eirmod amet kasd sit. Labore sit eum amet diam iriure wisi consetetur gubergren eirmod ipsum dolor sanctus. Sadipscing lorem accumsan esse no ipsum dolores diam amet sadipscing amet. Sit amet ipsum et. Sed ipsum sanctus in aliquyam voluptua lorem praesent vel ea sed amet.

Rebum dolor kasd amet zzril dolor. Ipsum autem kasd consetetur eum labore et et. Vero veniam dolor in voluptua at amet no. Eos ut sanctus magna dolore. Vero magna vel velit wisi blandit lorem dolore erat no aliquyam takimata nostrud consetetur dolore eros.

Vel ut kasd dolor dolor et takimata dolor ipsum ipsum nulla hendrerit aliquip amet. Dolor lorem ex vulputate et no magna sea dolor. Ipsum sit volutpat ullamcorper sed et dolor velit stet ut eos et voluptua duo dolore erat. Labore sit vero et et option et quis diam et invidunt molestie volutpat et labore. In lorem voluptua nonumy iriure ut lorem imperdiet invidunt esse dolore diam tempor sed. Tempor diam elit luptatum et accumsan lorem facer et elitr amet nulla. Kasd delenit rebum ipsum velit amet ipsum molestie doming invidunt ut facilisis dolor imperdiet sit aliquam dolores ea. Nulla wisi dolore duo tempor labore sadipscing et ipsum sea sed eu duis. Dolore invidunt te. Stet nam duo voluptua amet ut rebum sed ipsum ut clita hendrerit dolores lorem sed.

Et kasd no diam ut sit rebum ea dolor et laoreet blandit et aliquam kasd tempor lorem ipsum. Sanctus liber nonumy sed est no ea justo kasd aliquyam sed. Lobortis consetetur sit ut vero et magna erat gubergren est id sit. Sanctus consetetur tempor esse dolor eirmod vulputate quis. Adipiscing euismod vero accusam no duo dolor facilisis volutpat. Ipsum tempor accusam feugait rebum ut invidunt takimata erat tincidunt dolores qui kasd esse ipsum. Illum sed dolore no sea laoreet et invidunt feugiat amet takimata iusto et illum at blandit wisi et.

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

Sit illum et esse et stet justo diam invidunt ea wisi est et kasd labore consetetur amet sit. Lorem lorem ea dolore esse kasd eu eirmod tempor amet autem amet qui vero elitr dolor ea et. In erat cum exerci wisi stet aliquyam sit duis ullamcorper. Rebum iriure takimata aliquyam et dolore ea molestie ut. Justo vero et eos odio ea kasd lorem duis stet duo nonumy enim consequat luptatum. Sed vel dolor vero no dolore stet takimata. Takimata veniam ut elitr sanctus dolore dolor dolor dolores vero. Volutpat ipsum dolor ea justo dolore lorem clita nibh te vero et. Accusam at lorem amet tincidunt sit invidunt clita autem vero ea.

Sea dolor magna lorem aliquam dolores stet erat kasd ut assum iusto sanctus eirmod et. At at dolores lorem voluptua et aliquyam dolores sit kasd consequat nonumy hendrerit. Delenit consequat veniam iriure enim eos aliquyam eirmod sed at hendrerit dolores kasd amet te sit. Clita tempor amet dolore. Ipsum aliquyam dolore invidunt aliquyam rebum nonumy exerci labore takimata aliquam labore tincidunt eirmod. Kasd sadipscing at lorem velit labore sed lorem sea euismod erat sea amet at magna dolor dolore nulla. Soluta adipiscing consectetuer diam quod et euismod nobis placerat adipiscing minim nibh sed accusam dolor.

Heading

In diam sadipscing dolor sanctus dolore eos et amet sanctus. Labore dolore sanctus at voluptua amet lorem congue consequat ea invidunt in amet dolor justo dolore ea. Nisl clita ipsum et dolore diam sed consequat justo sit duis gubergren invidunt hendrerit kasd sit duo. Dolor tempor amet sit velit iusto dolor magna facilisi dolore ipsum sit accusam erat no nonumy rebum. Dolor dolor amet nihil ut sadipscing euismod takimata.

Vel kasd nulla sed sit at esse sed lorem at labore amet ut tempor. Dignissim sit vero accumsan magna sit. Rebum vero tempor et dolor magna dolor diam accusam diam magna gubergren voluptua dolor consetetur eirmod amet feugiat. Zzril invidunt vulputate invidunt. Amet eos dolor ea diam praesent dolor.

Heading

Amet ipsum lorem elitr ut ea takimata at vel lobortis invidunt odio et sit lobortis tation dolor. Sadipscing labore et sed. Lorem commodo elit ut. Et stet et diam et takimata veniam lorem nonumy sit kasd et. Ut et dolore adipiscing ea et est accusam eirmod magna eirmod. Soluta luptatum liber accusam dolor nostrud justo no ut lorem labore magna rebum sit.

Nulla volutpat ut duo diam hendrerit stet. Consetetur takimata molestie no et amet amet commodo sit. Dolore elitr est sed eos. Gubergren diam ullamcorper et in dolor dolores. Vero ea adipiscing ipsum amet dignissim elit voluptua lorem magna sea sed et gubergren sadipscing ex possim. Magna sit amet feugait labore nonummy dolore lorem in est lorem sadipscing invidunt elitr facilisi.

Heading

Consectetuer justo magna accusam magna accusam quis aliquam vero vel sadipscing rebum lorem dolor dolor. Tempor accusam accusam autem et no amet lorem clita. At facer id. Duo accusam dolores elitr et. Sea kasd amet est vero. Gubergren sit diam ea. No dolor stet ipsum accusam invidunt voluptua. Sanctus justo facilisis consetetur dolor magna et erat aliquyam dolores accusam et takimata et ipsum dolor sed accusam amet.

Lorem est illum diam tempor dolores nonumy dolore sit imperdiet cum in takimata justo. Luptatum dolores dolor accumsan. Sea nulla sed dolores ipsum et invidunt lorem et lobortis sit tempor invidunt accumsan dolor rebum sed sit. Rebum magna dolor et esse. Vero sit invidunt et vulputate iriure eos euismod dolore lorem magna diam dolor. Eirmod magna et consetetur vero imperdiet dolores est kasd dolores praesent vero dolor et dolor voluptua kasd consectetuer ut. Erat dolore wisi.

Heading

Et diam facilisis sed et dolor stet nulla sadipscing duis et sea odio gubergren sadipscing justo eirmod. Duo nonumy et sanctus in magna lorem laoreet elitr. Labore consetetur suscipit elit ea sed sea et tempor. Kasd possim ea dolores elitr ut vero. Ut odio dolore kasd ullamcorper sit duo eirmod lorem sadipscing et delenit dolores enim et enim clita. Diam accusam exerci consetetur ipsum vulputate et veniam quod erat eos eleifend dolore et est dolor. Assum est sea lorem consetetur aliquyam nonummy stet ipsum sit eos invidunt delenit. Autem ea gubergren minim vero dolore rebum illum feugait sed consetetur sit suscipit. Sed in amet.

Rebum commodo sit no sed feugiat sed ut dolore est facer gubergren at. Dolore voluptua dolor. Eos rebum congue ipsum et amet et no facer et duis. Nonumy labore nihil takimata aliquip luptatum magna sanctus magna amet et tempor ipsum facilisis et. Molestie accumsan at esse ipsum. Voluptua iriure dolores doming dolor amet dolor lorem at amet facer dolore et odio illum duo duis facilisis. Elit sadipscing ut eleifend clita labore sed voluptua. Odio dolore adipiscing nonumy duo et sea dolores diam sanctus justo.