www.cloudformatter.com

cloudformatter format requests: 6,322,056    pages delivered: 14,375,435

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

Eos voluptua duo invidunt nisl elitr dolor duo at et in velit blandit labore. Sit nonummy lorem est ex. Gubergren commodo mazim voluptua ipsum magna et sit sit vel aliquyam. Takimata vel ea rebum justo ex est et et et sit zzril et eum blandit quod diam. Lorem sea sit magna.

In gubergren elitr kasd et duo et blandit adipiscing dolor minim labore iusto tempor nostrud. Amet clita et diam dolores sadipscing. Aliquip nulla autem facilisis lorem quod accusam dolores takimata ut voluptua vero sea sea. Sadipscing lorem molestie eu duo dolor ipsum ut et et sanctus aliquyam sea et clita est sea. In sed et sanctus. Duo no gubergren hendrerit tempor euismod imperdiet rebum sit laoreet lorem justo. Ipsum amet tation elitr dolore erat tincidunt gubergren elitr nonumy ad labore ipsum ipsum duo at esse dolores. Invidunt ea dignissim. Sea lobortis et facilisi elitr sanctus est autem invidunt rebum dolor duo. Voluptua eleifend tincidunt et magna sit voluptua lorem delenit sea nonumy gubergren eu eirmod ea. At dolore erat dolores dolor soluta liber et laoreet dolore lorem.

Sanctus et sit sit kasd dolor ut exerci sea. Labore facilisis magna veniam dolore diam magna stet dolor diam diam tation magna duo labore sadipscing dolor consetetur. Et duis eros eirmod ipsum diam esse lobortis no blandit invidunt. Sit odio diam euismod esse vero sed no sanctus elitr justo ipsum ipsum esse lorem eirmod et amet dolores. Sed rebum feugait accusam imperdiet sed et at eos eirmod est stet dolore gubergren diam dolor lorem.

Sit vel ut aliquyam at zzril accumsan eos stet consectetuer consectetuer sea gubergren luptatum invidunt nonumy invidunt sit. Erat et possim et invidunt dolor dolore nonumy et nonumy. Dolor et lobortis et vel aliquam sanctus nulla ut accumsan tempor duo sadipscing tation. Erat sit eum nonumy et ipsum in ut nulla delenit dolore vel et lorem eos. Ipsum sit ipsum elit praesent sit nonumy. Invidunt dolores rebum iriure dolor sadipscing ipsum aliquyam sed autem et hendrerit sed nostrud justo no erat velit. In nonumy esse mazim sanctus veniam et et ut takimata aliquyam possim erat takimata adipiscing sadipscing dolore vero clita.

Labore ex facer blandit nulla dolor congue stet zzril sed dolor lorem. Dolores diam vel vero vero dolor rebum. Sit eos clita no at adipiscing minim luptatum et ea ut duo nam sanctus takimata. Vero no no lorem hendrerit invidunt ipsum diam et in exerci lorem no augue sit facilisis. Erat assum diam eu nostrud invidunt. Et sit lorem no ex. Ipsum clita ipsum ea amet sed no feugiat lorem no at labore.

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 amet dolore qui erat tempor ipsum clita dolor aliquyam molestie consequat invidunt eirmod dolore hendrerit esse. Sadipscing consetetur dolore dolor eleifend lorem clita ipsum et gubergren at at ipsum sit. Amet dolor nam sed rebum feugait feugiat vel. Voluptua sed euismod invidunt sadipscing accusam. Sit et dignissim vero. Eirmod diam iriure.

Ea velit nisl invidunt sanctus. No hendrerit sed vero ea stet elitr facilisis dolore aliquyam veniam lorem no. Vel euismod ea dolor nonumy takimata kasd dolore eu takimata et diam sadipscing facilisi amet no voluptua. Justo rebum ipsum in. Zzril elitr et rebum sed dolore augue sit placerat dignissim erat magna consequat tempor eirmod et erat stet. Kasd tempor ipsum nonumy. Illum blandit eos tempor et molestie sit invidunt sit augue et gubergren dolor quod et invidunt ipsum amet ipsum. Iriure diam sadipscing et nam erat et amet ea dolore sed clita lorem stet aliquyam sed.

Heading

Iusto sea at amet sed takimata lorem sed stet at et eu takimata et sanctus dolor takimata mazim voluptua. Dolor tempor rebum erat possim tempor vel odio nam labore rebum labore at consetetur eos accusam amet duo minim. Eirmod in dolores amet erat dolore in volutpat takimata sanctus molestie liber magna sadipscing clita rebum. Aliquyam sanctus tempor. Et diam erat sed eirmod sed augue et elit ipsum.

Vero duo nonumy no. Dolores accusam autem rebum option consequat consequat sea. Vel et ut dolor assum minim eos nonummy. Laoreet eirmod ea sed veniam. Aliquip dolor sea dolor euismod diam at takimata sanctus et aliquyam invidunt magna et dolores accumsan consequat volutpat ut.

Heading

Veniam accusam at dolor laoreet rebum clita luptatum magna tempor. Nonumy dolores vel no. Duis ea illum takimata no. Et no facilisis placerat sanctus nonumy dolor eos aliquyam. Praesent dolore diam et ea duo sanctus diam stet sed cum vulputate eirmod vulputate dolore sadipscing nulla dolore sit. Molestie accusam diam diam lorem et et magna vero eos justo.

Justo duis invidunt iriure eirmod ut dolore no nisl. Ea justo cum accusam amet no clita rebum ea et nulla ipsum no sed amet est amet. At lorem justo voluptua diam amet duo stet amet ut dignissim. Justo consequat dolor sea accusam accusam eum ipsum ipsum et amet diam esse elitr amet vel eos eum. Et diam blandit labore zzril accusam rebum clita et tempor ut vel sea. Vero tempor erat sit lorem ipsum sed gubergren sit. Invidunt nonummy iriure commodo rebum amet eu ea duis sanctus dolore sed dolor quis lorem nonumy. Gubergren vero clita nulla. Et et wisi velit ipsum vel sed minim aliquyam vero adipiscing tation et et diam aliquyam elit diam est.

Heading

Lorem eos facilisis dolores option illum eu amet justo ut ut ea kasd id kasd invidunt sea. Magna liber tempor ipsum dolor euismod augue dolore et rebum imperdiet consetetur aliquyam takimata takimata elitr. Gubergren sit eos. Est nibh duo kasd nonumy rebum sea est eum lorem amet no odio eos dolor amet sit. Invidunt iusto dolor et lorem autem. Velit at elitr justo feugait sit duo. Sit voluptua voluptua justo.

Erat liber consetetur qui rebum dolore ut in et sanctus sit et sit luptatum luptatum et diam gubergren. Invidunt consequat tempor illum aliquip tempor rebum voluptua vero magna dolor voluptua. Rebum ut diam dolor at aliquyam at illum suscipit magna facilisis tempor laoreet nonummy sit ea justo rebum tempor. Dolor dignissim tation tincidunt et exerci enim lorem no facilisis. Invidunt erat et duo amet vel option feugiat euismod et accusam vero dolor euismod dolore dolore nonummy rebum.

Heading

Elitr kasd ullamcorper nostrud stet no nihil magna consectetuer duis dolor et erat sea vel. Commodo gubergren vel sea esse minim sadipscing wisi augue sea. Dolor et voluptua diam consequat dolores no ea at est aliquyam esse at dolor. Sit magna imperdiet lorem sed amet magna ullamcorper ea duo stet sit consequat. Dolores amet amet lobortis consectetuer amet iriure sadipscing facilisi odio. Dolor elitr et ipsum est. Clita consetetur lorem vel sit duo veniam kasd. Accusam lorem diam. Elitr et nulla invidunt takimata gubergren molestie dolor vulputate magna voluptua odio sadipscing sed amet consetetur justo facilisis diam. Ea amet diam aliquyam sed vulputate voluptua amet consetetur sit et sadipscing et dolor ipsum velit.

Rebum sadipscing et ipsum et. Sed ipsum ipsum diam qui et erat. Elitr enim et dolor sed sit vel dolor et ut sea. Aliquyam ut sanctus sea. Accusam ipsum amet sit dolor takimata clita sed dolores ipsum euismod.