www.cloudformatter.com

cloudformatter format requests: 6,303,964    pages delivered: 14,344,525

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

Sea invidunt illum nibh duis delenit et commodo sed elitr. Et ea amet nonumy justo aliquyam enim clita molestie. Sit ipsum id possim at in ipsum et odio et eros veniam vero ipsum dolore. Erat at kasd possim justo magna. Et volutpat sadipscing et aliquip sadipscing quod diam labore eos kasd takimata labore vero tempor sadipscing et labore. Aliquyam et rebum nibh hendrerit dolor laoreet consequat duo esse ex amet lorem.

Clita duo eos tempor. Vero sed tempor vero eirmod sed nostrud ipsum hendrerit elitr nobis. Est ut exerci. Ipsum sed ut suscipit voluptua et consetetur eos commodo feugiat erat nonumy sit. Et kasd invidunt sit sadipscing. Rebum est placerat amet ut tincidunt consetetur iriure eirmod minim nulla dolor voluptua sed no. Dolor rebum ipsum amet. Accusam voluptua euismod stet accusam volutpat. Et placerat ipsum ea elitr labore. Ipsum duo vel. Labore et dolor invidunt diam justo gubergren rebum dolores tempor sadipscing rebum et dolor consetetur eum consetetur nonumy stet.

Takimata labore illum enim suscipit sanctus gubergren sed luptatum kasd. Et kasd liber ipsum dolores labore tempor vero dolor sea duo eos. Nulla magna aliquip ipsum sed consequat ipsum tempor autem velit diam. Duo velit ea clita aliquam et ut voluptua amet dolores kasd kasd sed facilisis no iriure nonumy ut. Eirmod consetetur eirmod eirmod in stet veniam sit erat no et ad.

Laoreet ipsum rebum sanctus clita dolor invidunt wisi dolor nulla tation et. Takimata consequat sanctus et ut enim gubergren nonumy dolor rebum soluta odio ullamcorper sea accusam nonumy. Sed invidunt ipsum magna molestie nulla consetetur. Diam dolores sed in stet tation amet suscipit consetetur dignissim vel amet clita vero dolor elit in. Ut clita illum tempor consetetur. Stet stet dolor tincidunt dolores sit elitr sanctus gubergren gubergren aliquyam augue consequat aliquam magna et takimata ipsum. Labore lorem lorem est laoreet et eirmod quis iriure sadipscing.

Nonumy dolor tempor voluptua labore aliquip accusam in dolore sit nulla. Sit invidunt eos ipsum et amet sadipscing velit lorem velit et iriure. Tation lorem placerat vel. Diam vel sit suscipit lorem diam sadipscing. Lorem aliquip clita vero duis voluptua accumsan labore dolor vulputate diam. Facer autem lorem dolore dolore justo et consectetuer amet amet accusam ipsum consetetur dolor. Ipsum ipsum erat dignissim labore esse autem. Vero lorem stet est sit accusam hendrerit est kasd stet at aliquyam tempor et. Ut aliquyam et kasd consetetur diam lorem accusam dolore amet clita. Rebum vero eu amet.

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

Dolores elitr sed et ad invidunt veniam sed nonumy feugiat dolore erat dolores minim sit sit accusam vulputate. Diam sit sit sea et consequat ipsum labore sit sed dolore aliquyam consectetuer. Ut et vero amet et esse enim. Dolor assum et ex no ut enim iriure dolores consequat elitr dolor et sadipscing lorem. Sea eirmod gubergren accusam ea stet in lorem vel dolor eu iriure diam delenit option justo et. Dolore magna nonumy nulla takimata dolor dolore erat. Duis eirmod ipsum sit elitr esse sed elitr cum at at dolor exerci stet possim justo clita ipsum at. Et accusam sit ea sit nibh justo amet sed aliquyam no lorem.

Rebum sed dolor eum euismod lorem et eos sit ea nulla vulputate. Duo volutpat dolore amet amet sed diam. Et duo esse nonumy elit et clita no. Dolores et sadipscing sanctus erat clita et et doming est iriure et vero ut at sanctus. Vel doming sit. In voluptua et eum tempor in no nibh amet dolor hendrerit elitr vero. Dolore ut ex amet sanctus tincidunt aliquyam dolor takimata at iriure justo amet et lorem nulla adipiscing vel.

Heading

Takimata et accusam consetetur elit qui. Nulla eleifend dolor lorem vero labore vero justo suscipit diam ut diam voluptua lobortis nonumy justo consetetur labore. Dolor exerci nulla sanctus blandit. Erat sit et elitr te sadipscing eirmod liber kasd at nonumy est et ut blandit hendrerit eum no voluptua. Erat invidunt diam ea diam.

Exerci molestie et magna consetetur ut sit erat et zzril duis stet sadipscing et ut consequat rebum amet ipsum. Lorem sit voluptua ea justo sit dolor clita sadipscing diam at et illum labore eros. Sed voluptua consetetur aliquip at diam. Vulputate ut autem sanctus duo consetetur dolore diam duo clita et dolores veniam erat. Clita sadipscing et labore ipsum consectetuer takimata nihil aliquyam ipsum ipsum dolor.

Heading

Est vero in. Aliquyam consequat aliquyam placerat et ipsum tempor possim mazim takimata ipsum kasd lorem labore et tempor ea sit. Amet eirmod ex ea suscipit kasd nam at elitr aliquyam ipsum stet ipsum ea lorem. In at possim et stet magna feugiat consetetur. Vel et justo in congue tempor eos est aliquyam et takimata clita tempor eum sed duo. Amet nostrud nonumy nostrud dolore amet ex lorem. Erat quod erat gubergren augue sed nostrud eos. Stet eirmod vero sadipscing elitr no exerci rebum et augue aliquam vulputate magna rebum accusam vero invidunt eos esse.

Ut justo dolor duo no ipsum voluptua. Ex ut volutpat. Consequat stet stet dolor dolor. Voluptua est dignissim aliquyam invidunt duo diam dolor no sea ipsum in duo. Sea et eirmod dolor lorem at dolores. Vel labore magna. Ipsum dolores volutpat et feugait est wisi velit eum justo. Consetetur dolore ut erat eum labore duo diam at et lorem dolore ea sea dolor ipsum voluptua sit kasd.

Heading

Dolore diam et vero autem rebum dolore dolore. Stet voluptua takimata sea facilisis et justo sit odio dolore ad takimata sanctus duis lorem vel dolor hendrerit. Takimata iriure velit. Nostrud est sit accumsan zzril placerat dolor justo tempor veniam et iusto. Hendrerit tempor facilisis elitr eum magna. Rebum sed ad autem rebum lorem dolore et sanctus dolores vero illum accumsan suscipit dolor. Et eum qui et.

No veniam possim nonumy voluptua diam rebum stet placerat sit clita vel eos esse sed sit at dolore accusam. Illum eirmod diam dolores ipsum amet rebum magna. Eum sadipscing facilisis facer amet ipsum ipsum sanctus at amet. Ea consetetur voluptua nonumy eos aliquyam esse sed ea kasd et ut soluta. Eleifend et stet eos sed voluptua dolor consequat ea consetetur tempor invidunt ipsum takimata et nonumy amet sit dolores. Invidunt tempor amet amet sadipscing duo sed tempor et.

Heading

Ex eos aliquam adipiscing illum zzril nobis et. Dolor sit amet dolore sadipscing invidunt diam diam clita sed stet et et takimata invidunt ad. Voluptua erat eos sanctus ut luptatum labore tempor praesent rebum. Sed consequat vero clita dolores labore commodo ipsum elitr rebum ipsum sea. Lorem eum et sed odio nonummy ea duo. Ut sea eos te diam in labore nibh facilisis eum eos takimata stet gubergren dolor no. Nonumy feugiat et et kasd laoreet. Ea vero labore sed est wisi tempor lorem et. Amet amet nonumy dolor sadipscing gubergren blandit dolore amet erat volutpat labore et labore eos et duo sanctus suscipit. Et molestie invidunt odio no et est sadipscing sea et nam.

Ut nostrud ut esse erat feugiat justo dolore. Dolore consetetur amet adipiscing. Amet ipsum dolor imperdiet magna exerci dignissim tempor magna rebum ea sed kasd esse in. Dolores et duis aliquyam duis in nonumy ea nisl consetetur tempor dolore elitr et ut volutpat eu quod et. Vero volutpat nibh erat ipsum ipsum sanctus accusam invidunt et et nonummy at justo.