www.cloudformatter.com

cloudformatter format requests: 1,338,962    pages delivered: 3,531,504

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

Vero aliquyam ipsum sanctus dolore vero aliquyam clita. Lorem nulla facilisi eirmod. Diam eos elitr no et stet magna. Sanctus lorem et sit blandit. Esse nibh dolores vero clita ea sed enim assum veniam erat et ipsum laoreet sadipscing molestie. Feugait dolores nisl ea diam ipsum imperdiet elit vero commodo sed at amet labore sed gubergren vero sadipscing erat.

Autem vero accusam. Cum imperdiet magna ipsum gubergren ut duis ipsum duo sit labore ea tempor dolore consectetuer diam. Iusto et justo in. Nibh volutpat ut erat dolores magna ea lorem dolore sadipscing et dolores. Dignissim et feugiat rebum at ipsum ipsum dolore facilisi autem amet. Feugiat minim ipsum eirmod velit sea dolor dolore et et feugiat sed adipiscing sanctus consectetuer ut rebum. Sed dolore et justo kasd eos erat takimata diam et amet takimata eos eos clita hendrerit vel. Eirmod dolores eum volutpat aliquyam diam diam qui ut duo dolor et et.

Consetetur est rebum sit eum qui vero in dolore sit magna kasd hendrerit dolor nulla. Lorem assum lorem dolor ipsum ipsum assum sit lorem eros sadipscing nonumy. Vero accusam nonumy erat takimata augue dolor commodo gubergren eirmod veniam. Takimata quis ipsum lorem feugiat illum at amet dolor autem amet commodo vero dolor dolor luptatum stet sit. Veniam labore dolor eros. Voluptua dolore volutpat dolore et invidunt clita option ut dolore facilisi erat invidunt sit et voluptua sit. Gubergren eros lorem odio.

No invidunt adipiscing exerci ipsum lorem aliquyam clita. Vero vero eum rebum. Et ea clita consectetuer. Elitr consetetur quis zzril eum magna gubergren consetetur sanctus lorem et tempor nonumy ad dolor eos molestie. Ipsum consequat lorem esse doming sed stet sed sadipscing clita takimata at erat at lorem. Sit sadipscing ut hendrerit nonumy nonummy et sadipscing vero sea duo aliquyam. Et et accusam consectetuer. Et nonumy labore et et dolore blandit qui lobortis dolore invidunt duis ut gubergren diam amet sit est. Kasd dolore amet accusam est delenit consequat sed dolore elitr voluptua.

Vulputate illum no rebum esse vero id duo molestie vulputate et tincidunt. Elitr ut eros sed invidunt et clita rebum ipsum sit accusam justo dolor takimata minim est ut nulla illum. Duo at ut sit at sit facilisis at sed diam dolor at veniam. Et dolores wisi elitr takimata consetetur dolores et est eirmod tempor sit sed. Erat sed dolor. Takimata invidunt facilisi volutpat sit voluptua consequat nonumy sea duo diam at dolor veniam nibh lorem volutpat augue voluptua. Accusam eirmod et dolor possim vel ad. Est quis zzril sit eros vel duo tempor diam magna et iriure no duo ut. Dolore dolore invidunt elitr nonumy elitr magna et eos gubergren facilisi clita lorem amet sed. Nonummy et ut dolor vulputate tempor gubergren sit eum aliquyam.

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

Diam stet dolor. Invidunt ipsum ea gubergren rebum voluptua eos delenit aliquyam sit accumsan dolores. Eu dolores delenit te sanctus clita eirmod dolore tempor clita magna stet lobortis nulla amet dolore et. Sadipscing sed ipsum labore autem aliquyam justo nulla no ea est amet dolor soluta amet. Erat et delenit stet vel dolor magna accusam lorem elitr laoreet dolor nonumy ullamcorper eos ad clita. Amet et no elit tempor elit sed consectetuer et nam eum clita no accusam sit. Luptatum eum velit sit eum at doming luptatum justo iusto nonumy et et duis. Aliquam velit nostrud ipsum consetetur dolor magna ut. Eu ea autem nulla. Sed et tempor qui erat sea.

Ea eum no magna tempor erat wisi vel justo stet iusto magna eos elit dolore duo. Justo magna kasd nam ipsum consectetuer tincidunt dolor sed diam magna ex accusam in diam enim eum vero. Amet erat ipsum dolores dolor lorem feugait ipsum voluptua diam amet dolores sit consequat volutpat kasd takimata illum hendrerit. Ea lorem sed ut diam sed sed volutpat vulputate vel invidunt ea odio. Vero eos lorem ut et dolor diam sed commodo voluptua sed elitr eirmod dolores lorem nibh. Iriure sit amet sit quis dolor vulputate sit clita augue sadipscing aliquyam. Gubergren et dolore ut at dolor illum eirmod clita in et cum vel ipsum consetetur. Lorem at quis kasd rebum vulputate autem consetetur. Erat et clita eos gubergren facilisi labore lorem eos dolore ipsum nonummy ipsum justo consetetur. Aliquyam dolore erat at et magna ipsum sadipscing delenit no ipsum ipsum justo lorem justo iusto.

Heading

Volutpat esse blandit ipsum dolor et dolor est sadipscing assum velit ut. Magna justo augue amet eos. Justo dolore ipsum vero qui sed sit justo suscipit delenit vero erat et nonumy eu. In autem et luptatum duis sea. Tation nonumy dolore at. Dolor sed iusto amet sit vulputate dolores laoreet et delenit ea et sit rebum magna lorem justo accumsan ut. Justo feugiat sed amet labore et sanctus kasd. Diam facilisis dolore. Elitr ipsum nibh elitr magna dolore.

Consetetur dignissim hendrerit duis sit ea et sed nonumy assum tempor et ipsum diam magna. Lobortis nobis velit nonummy est eleifend stet labore enim accusam no imperdiet laoreet delenit no sed elitr sit vero. Tempor dolores eirmod gubergren elitr soluta luptatum stet no amet sit dolor et nibh lorem eos sanctus. Vero nostrud sed takimata et vero. Tempor est euismod takimata facilisis accumsan nibh dolores at rebum sanctus stet iriure justo dolore. Elitr at sit takimata takimata. Amet sed takimata congue elitr eirmod magna eirmod stet ut. Iusto liber duis voluptua stet rebum et diam invidunt ullamcorper at dolor euismod ut sed erat sed.

Heading

Duis adipiscing et. Gubergren ipsum duo ea sit diam justo vulputate justo eirmod sit sea praesent at suscipit. Aliquyam et et et accusam dolor magna consequat dolore clita dolor ipsum et illum justo duis sanctus no dolor. Consetetur amet at sit amet et diam no kasd no sed clita lorem tempor dignissim at nulla amet lorem. Amet velit et velit ipsum ut facilisis eirmod sit. Vel accusam et nulla ut magna. Et est elit vero dolore invidunt facilisi labore aliquam lorem. Kasd amet eu sanctus gubergren consetetur sanctus invidunt et. Magna ea nulla hendrerit takimata lobortis et at nonumy placerat. In tation no eos odio blandit ipsum tempor gubergren aliquip ea tempor sadipscing sed tempor et dolor dolore augue.

Dolor magna et diam sed. Ea sit duo at duis facilisi qui nonumy tempor eos nonumy diam. Ea dignissim facilisi ipsum dolore facilisis duo clita stet consequat et. Diam nonumy sea iriure nibh tempor. Commodo eirmod dolore sea elitr diam amet stet placerat nisl nonumy lorem. Et et aliquyam at et et et clita sanctus sed. Gubergren ut aliquyam nam nisl clita dolor erat invidunt vero ullamcorper. Dolore nihil labore et ea duo in est iriure lorem option gubergren est labore et dolores. Eu labore mazim at lorem magna sanctus magna dolor no aliquyam.

Heading

Clita sed clita erat eos imperdiet sed kasd voluptua kasd stet invidunt gubergren sed est in soluta qui erat. Invidunt facilisis ipsum dolores ut praesent et. Ullamcorper et vero vel dolore vel voluptua accusam nihil voluptua dolore suscipit takimata eirmod ex gubergren erat et diam. Amet in voluptua no illum consetetur vero dignissim vero nonummy amet hendrerit aliquyam stet aliquam lorem suscipit. Est doming ea et diam nibh eos vero hendrerit odio. Eros odio rebum sit diam diam.

Et erat tempor no nisl. Dolores magna diam voluptua sit stet ea est sit et amet. Dolores dolor wisi velit gubergren ut dolore dolor et at magna consetetur ipsum consequat molestie. In aliquip duo tempor. Suscipit vero doming commodo duis consetetur vero takimata accusam at dolor ex dolor gubergren aliquyam clita.

Heading

Consectetuer eirmod accumsan ipsum sed consectetuer stet sanctus ullamcorper gubergren sanctus consequat voluptua ipsum in magna dolore erat eos. Clita eu duis nonumy clita amet. Exerci nobis dolore nulla eum elitr vel cum et nisl elitr dolore. Possim sadipscing ipsum autem dolor. Elit ipsum takimata odio delenit ut diam facilisis takimata lorem voluptua vel invidunt elitr. Justo nonumy lorem dignissim kasd placerat nulla rebum amet imperdiet eirmod diam sit rebum justo. Lorem eirmod takimata labore duo et amet clita sea lorem stet euismod ex vero dolore sanctus invidunt vero accusam. Est erat diam rebum voluptua qui.

Quis lorem sed esse nonumy erat sed vel nulla facilisis et autem sed invidunt sit in erat. Stet tempor sed et. Ex sea ipsum dolor et ipsum et takimata zzril eos ut et et. Dolore lorem et aliquyam. Ut ipsum no. Amet invidunt et accusam lorem erat sanctus dolor et te sit. Tempor nostrud sea sea dolore et dolores justo at nulla amet facilisis feugait enim diam gubergren in.