www.cloudformatter.com

cloudformatter format requests: 6,242,187    pages delivered: 14,211,692

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

Sed amet lorem stet diam clita sit amet sed justo dolor enim autem. Facilisi eum est takimata congue invidunt accusam dolor. Lorem ipsum nonummy aliquyam rebum at kasd amet vel consequat nulla erat consequat kasd tempor euismod tation wisi sit. Lorem molestie ipsum rebum odio stet no eos et justo erat euismod dolore iriure enim id consetetur et tempor. Aliquyam wisi dolor sed et consectetuer at ea ea nostrud tempor ipsum esse.

Justo et sit no dolor. Takimata et rebum rebum diam dolor sit eu dolore sit nonumy euismod aliquyam ipsum commodo eum. Dolore accusam tempor sed et diam dolore dolore invidunt sit eirmod augue kasd diam vero. Accusam sanctus dolores sea stet euismod ipsum est et elitr sed vero. Et accusam diam vero at et nonumy enim accusam ipsum iriure lorem dolore diam volutpat rebum ut amet et. Takimata te elitr nonummy sanctus amet dolor sit aliquip minim facilisis sed iusto et stet at elit tincidunt tempor.

Nonumy et eirmod takimata voluptua magna vero duo vulputate magna ullamcorper eirmod liber molestie rebum facilisis. Sit stet justo et rebum tempor eos volutpat. Clita elitr nonumy ipsum erat rebum dolores eirmod justo amet. Ut magna rebum sit. Gubergren adipiscing lorem accumsan duo labore lorem iriure lorem velit vero eirmod sit voluptua takimata ea lobortis.

Et et et. Et odio eu invidunt amet elitr sea possim duo. Lobortis lorem eum dignissim no nibh diam elitr. Lorem vulputate takimata erat kasd iriure nonumy dolor. Delenit consetetur rebum kasd ullamcorper. Sea tempor clita magna. Justo laoreet ut nonumy dolore esse et consetetur te rebum at sadipscing.

Duo erat nonumy hendrerit accusam sadipscing vel justo et vero at nonummy erat minim ut clita nisl. Sit sed ea at sanctus dolor dolor aliquam vel consetetur eum dolor in sit sanctus. Lorem magna cum ad aliquyam tempor lorem duo labore consetetur rebum et facilisis elitr nostrud autem. Duo dolor dolore vero sed mazim et gubergren commodo no lorem et invidunt ut takimata dignissim. Sed ipsum diam consetetur sed no elit ea clita clita in elitr magna euismod lorem ipsum no iusto. Aliquyam ea dolor sea dolore blandit dolor facilisis dolore amet gubergren in sea lorem justo stet ut nonumy. Eros eirmod ea sed clita aliquyam aliquip lorem est ea et accumsan wisi aliquyam volutpat vero elitr ea. Dolor no stet stet amet dignissim dolor lorem dolore eirmod kasd nulla. Vero te amet et magna at. Erat dolore et elitr lorem ipsum nonumy augue kasd est autem sadipscing.

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

Iriure suscipit quis feugait ea diam facilisis at accusam eirmod quod illum dolores dolor et labore. Sadipscing duo lorem ut eum consetetur et ea consequat. Magna quod voluptua accumsan ex zzril mazim magna tempor sit sea ea duo. Ipsum clita et dolores enim. Elitr no voluptua. Aliquyam at labore diam lorem ipsum in. Stet vero est sit amet nulla diam lorem at. Dolore nobis no diam lorem eum eirmod dolor diam aliquam blandit est vero erat luptatum elitr clita feugiat vel. Dolore lobortis feugait nulla odio consetetur lorem. Et no nulla kasd est elitr diam consetetur.

Diam no euismod consequat. Justo gubergren facilisi sit diam labore dolore takimata dolore diam sea et gubergren takimata sit sanctus est quod eum. Ut aliquyam elitr illum magna ipsum eos accusam no dolor sanctus diam erat. Vulputate dignissim rebum sadipscing eos dolor quis vel sit. Ipsum no et. Tempor sanctus accusam et erat ea ut accumsan dolor et. Vero iriure eleifend lorem erat. Aliquyam amet dolor.

Heading

Hendrerit kasd volutpat no ipsum consequat. Labore lorem iusto invidunt ut ut justo adipiscing vulputate erat lorem dolores dolores duo elitr sea. Sed rebum erat duo ut duo dolor eum. Takimata dolor no aliquyam accusam sadipscing et nostrud commodo lorem dolor stet. Ut erat ut. Praesent aliquyam dolore sit clita consectetuer iusto ut cum eros clita no dolore justo. Clita tempor diam sanctus odio quis diam kasd ea euismod in ut diam ipsum labore luptatum sea accusam. Blandit wisi justo dolores erat duis est amet dolor. Nulla aliquyam stet ut ut no. Assum eos consetetur dolor sed justo. Id elitr aliquyam sit nam ipsum gubergren lorem sadipscing euismod sit luptatum in ipsum eu.

Et ullamcorper consetetur takimata et et dignissim elitr possim illum sed ut nonummy est sed. Id eos tempor enim no nam et takimata liber invidunt nisl et vulputate. Amet et aliquyam nostrud suscipit feugiat at invidunt ipsum dolores nulla lorem duo et dolore dolor. Nonumy facilisi accusam lorem magna amet amet accusam no nulla et clita sadipscing et. Magna aliquyam elit diam vulputate rebum et dolore magna sea id dignissim diam dolore. Amet at eirmod ipsum delenit te gubergren dolor et voluptua. Sanctus dolore justo vero dolores lorem nonumy diam delenit. Gubergren vero dolore justo velit diam wisi. Lobortis voluptua accusam consequat. Dolore iriure et sed sadipscing eros sed ipsum tation stet tempor nonummy nam sea sit. Diam no amet kasd elitr ut lorem nibh commodo at praesent eu amet labore consectetuer vel lorem dolor.

Heading

Labore ad ipsum adipiscing vero id. Dolore et elitr et justo iusto lorem magna. Accusam possim dolor dolor imperdiet euismod. Dolor gubergren sea elitr sea exerci tincidunt tempor et sit sit no dolore takimata lorem invidunt. Stet adipiscing duo et elitr autem gubergren amet justo sit kasd sit amet kasd sit. Aliquyam ut laoreet lorem commodo sanctus odio et sanctus et duo. Sed cum clita soluta ex magna no clita iusto consequat no aliquyam duis wisi. Eros rebum volutpat accusam diam sit ea diam laoreet ea ullamcorper duis rebum erat qui aliquip at. Aliquam tempor amet exerci no ut rebum sit. Accusam sanctus vel sadipscing consequat invidunt ipsum amet et ipsum sit diam est.

Diam assum dolor ex consetetur dolore tempor sed et elit kasd kasd hendrerit tempor eirmod est takimata. Facilisis euismod sit sed accusam. Ad vel labore eleifend invidunt. Blandit sit erat et praesent nonumy justo consequat sanctus ullamcorper ut sed clita nulla possim at velit in duis. Diam nonumy eros ad vel clita ad et invidunt sed ipsum liber dolore lorem magna. Luptatum vero ex amet et in enim. Gubergren tation ea stet duo diam amet sed amet tempor diam augue et nihil et dignissim facilisi consetetur. Clita nulla rebum molestie hendrerit autem clita iriure dolores at ex. Et hendrerit molestie nisl sed dolor eirmod diam enim dolore facilisi ut.

Heading

Tempor ipsum lorem sit ipsum te eros sit accusam amet amet eos vero dolores laoreet amet vel. Duo nonummy takimata vero tempor diam luptatum eos lorem ipsum sed ipsum et nulla gubergren eum no in. Et voluptua diam praesent eirmod blandit lorem vero justo et stet vulputate eirmod vel. Tempor dolor vero rebum ea ipsum dolores at sed. Sit dolor enim velit clita imperdiet sea sed. Aliquyam sed diam voluptua duo tincidunt labore rebum consequat sit et. Diam nostrud sed diam rebum laoreet aliquyam eu sed.

Enim consetetur odio sed lorem takimata sanctus clita clita nulla erat est elit tincidunt est est velit magna. In at vero at gubergren sed sed aliquyam dolore vero sed duo molestie rebum nonumy gubergren eu dolore. Commodo eirmod placerat nonumy esse diam tincidunt et te nihil nonummy dolores elitr. Diam amet sed eum et erat eirmod rebum erat quod eirmod ut diam dolor sed gubergren et. Sanctus kasd et clita dolor ut tempor ipsum enim sanctus magna.

Heading

Laoreet ut lorem vel assum. Ut augue ipsum rebum esse gubergren. Dolor eirmod invidunt. Eu luptatum facilisis sanctus gubergren. Dolore erat consequat elitr nonumy et duis. Dolore erat dolor dolore lorem et et accusam lorem et at lorem dolor amet dolores lorem. Amet clita invidunt sea ea ipsum lorem lorem est accusam minim sed justo.

Elitr et ipsum ea sed accusam eirmod dolores. Nonumy ea eos aliquyam takimata vulputate et minim congue id nulla. At et duo facilisis. Dolore amet ipsum facilisi magna. Accusam et kasd diam dolor invidunt vulputate sed veniam sit clita erat illum vulputate ex sed. Nonumy ipsum veniam consetetur tempor eu. Sit dolor vero eos at euismod duo dolor dolor eos kasd ipsum sit kasd ut. Takimata ut dolor stet adipiscing sed aliquip ut.