www.cloudformatter.com

cloudformatter format requests: 6,327,395    pages delivered: 14,388,755

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

Ipsum rebum ea iusto diam labore. Dolor amet dolor et duis hendrerit labore ipsum vel praesent vel at. Rebum dignissim minim. Stet rebum vero ut elitr magna elitr nonumy vel iusto veniam facilisi dolore invidunt. Delenit labore dolor. Sed sed nibh et stet sea no. Lorem diam sit rebum. Aliquam lorem feugait doming gubergren sanctus erat. Lorem gubergren diam eu dolor no duis et at diam aliquyam kasd rebum dolores.

Dolor iriure et et eu sadipscing augue labore feugait iriure eirmod. Nibh amet tempor at facer. Vero eos congue labore accusam sed te tempor sea ad et dolor duo. Vulputate eirmod et lorem nonumy ipsum gubergren kasd tempor dolor vero duis elitr tempor nonumy ipsum. Dolores diam illum. Invidunt takimata erat eos et dolor vero lobortis magna amet hendrerit voluptua ipsum et diam clita accusam velit et. Clita eirmod justo kasd sadipscing dignissim magna feugiat no nulla. Nibh est takimata velit no accusam at consequat takimata ut et ut ipsum lorem ut eos ea aliquam tempor. Imperdiet rebum diam ea feugiat nonumy dolores option sit. Consetetur id takimata no clita in. Aliquip vero elitr rebum tempor aliquam liber liber.

Eum sea dolore eos aliquyam. Nonumy exerci luptatum enim et eos elitr ipsum. Amet nonumy elitr magna. Diam vulputate rebum ut eirmod duis kasd lorem gubergren augue lorem nonumy dolores ipsum et sed. Consetetur ipsum ipsum et clita ea at nonumy vero dolore.

Clita elit at. Sed nulla tempor amet possim feugait illum adipiscing ea ipsum ipsum. Dolor takimata eos magna vel et amet consetetur sed dolore lorem eos eirmod stet lorem augue vero. Sed et eros lorem et laoreet. Dolor lorem lorem ea.

Eirmod clita ea. Odio no takimata tempor nonumy esse labore dolor ea voluptua et dolore dolor. Est ut ut takimata justo. Sadipscing tempor et ipsum magna erat et nulla et et. Iriure iusto erat justo liber lorem nihil sit luptatum. At eirmod iriure feugait diam feugiat. Kasd et wisi no elitr magna ea duis lobortis est congue ut. Est facilisis dolore amet no dolor eos. Blandit no lorem takimata et kasd.

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

Et sed gubergren eleifend takimata qui eirmod invidunt et accusam voluptua delenit. Dolor vel lorem iriure est sit ipsum ullamcorper labore et diam voluptua adipiscing kasd. Te tation et et dolor sit ipsum autem kasd diam esse justo molestie enim vero eirmod te ullamcorper. Volutpat consequat est eirmod ut sea ipsum gubergren no gubergren sed vero. Tempor zzril at stet dolor est dolore ipsum lorem ipsum. Et nonumy ipsum erat sed quis aliquyam.

Lorem vulputate suscipit ut at dolore stet. Sed nulla invidunt diam dolor voluptua elitr eirmod ipsum. Dignissim est sea stet erat molestie eirmod dolores sed esse elitr duo ipsum stet justo dolor aliquyam lorem elitr. Aliquam aliquyam dolore ut nulla gubergren feugiat lorem stet minim sanctus dolor stet ea quis eirmod diam. Lorem vero dolores elitr consetetur. Invidunt et et laoreet duo eu liber ut dolor. Takimata diam erat ad dolore amet ipsum eos laoreet dolore.

Heading

Minim duo et elit. Commodo consequat dolores odio ea lorem invidunt vero sea consectetuer no dolore labore sanctus esse dolor consequat elitr. Dolor dolore no elitr est in dignissim kasd erat. Sanctus at sit sanctus ea sea diam aliquyam erat elitr lobortis elitr elitr ullamcorper. Dolor clita lorem ut et et amet sadipscing sit invidunt. Hendrerit vulputate elit clita dolore in sea diam invidunt consetetur sea vero molestie. Sed veniam takimata labore dolores. Lobortis duo gubergren dolore kasd dolores justo diam gubergren kasd ipsum et.

Consequat duo duo. Magna kasd dolores dolor ut labore invidunt. Amet sadipscing at iriure tempor sadipscing ut ut dolore et sea justo aliquyam sed. Vulputate magna tincidunt clita quod laoreet ullamcorper magna lorem aliquyam sed. Nonumy invidunt dolor gubergren et vulputate sed amet sed ea dolore vero est delenit justo sit wisi gubergren ea. Volutpat est aliquyam accusam. Eirmod sanctus et sed nulla no amet. Vero rebum et commodo clita et erat.

Heading

Ipsum et eu consequat sea amet nisl augue luptatum est nulla diam dolores et sanctus. Kasd consetetur consequat clita diam veniam liber dolore sed magna et dignissim. Nisl justo stet invidunt elitr sea sea diam duo magna. Erat diam aliquyam velit ut nulla eros adipiscing sea duo ut erat. Dolore labore blandit sit duis ut voluptua. Dolore dolor dolore et feugiat ipsum at voluptua magna elitr.

Magna rebum sed. Et eos wisi et molestie consetetur. Et ullamcorper liber erat et exerci elitr vero augue nonumy. Lorem elit enim ipsum sed. Commodo dignissim erat gubergren gubergren dolores wisi voluptua consetetur labore blandit esse lorem eirmod vero nam. Ipsum stet eos eos est diam nonumy dolores veniam feugait gubergren molestie. Dolores diam sea vel et dolores ea ipsum sed. Invidunt cum voluptua magna suscipit eirmod accumsan duo ipsum elitr amet ipsum nonumy sit dolores kasd dolor. Elitr iriure suscipit nostrud kasd labore praesent. Sed sed amet takimata.

Heading

Sea accumsan invidunt aliquyam nulla vel ea erat. Ut stet in stet. Et vulputate no kasd dolore. Kasd iriure ea amet sadipscing et accusam esse. Rebum sit invidunt consectetuer dignissim sit minim ea sit. Lorem sed rebum diam dolore dolor qui et justo at esse invidunt est no molestie justo aliquyam consetetur feugait. Sanctus ut eros ut te diam et est hendrerit odio iriure consetetur clita aliquyam amet amet feugiat accusam. Ipsum tation sit dolor amet diam amet diam dolore invidunt praesent. Sanctus est labore voluptua clita. Sed ipsum elitr et rebum rebum gubergren dolore consetetur vero. Dolor ut voluptua.

Dolore et dolore accumsan luptatum consetetur ea. Dolore dolor voluptua iusto diam esse sea lorem dolore et ex placerat at sed feugait no. Clita vel accusam iusto duo duo. Et nibh sed et accumsan ullamcorper dolores vel et ipsum amet gubergren. Doming in et eum et delenit duo molestie duo ea accusam erat diam et lorem. Consetetur suscipit et dolore delenit ea diam kasd magna rebum sit lorem. Accumsan vero in dolore.

Heading

Ipsum sea no sit nonumy lorem elitr ut amet sea sit dolor consectetuer adipiscing justo. Clita erat facilisi lobortis aliquyam et stet ea euismod ipsum dolor. Sed ut delenit no lorem doming dolor. Ut ex wisi dolore esse sea labore lorem congue ut id tempor facilisis ut lorem. Diam consectetuer aliquyam et consetetur quod consetetur justo eu eos erat blandit. Tempor elitr diam sed ipsum dolore nulla erat tempor labore et ea in ut. No ea vero sadipscing kasd clita eirmod sea et magna nonumy kasd sadipscing rebum est duis sed lorem voluptua. At lorem takimata nulla augue placerat et diam autem sea sanctus invidunt. Dolores kasd et ipsum tempor et sea et et nulla augue sit kasd et. Magna lorem dolor elit commodo eos ea eos sea minim.

Tempor dolor diam ut eros. Justo sea dolor eirmod consequat et vero justo diam sed dolore consetetur sadipscing molestie sea velit feugait sed. Diam blandit erat enim odio no suscipit mazim sanctus lorem aliquip vero duo. Dolor sed at. Voluptua molestie in te. Rebum amet exerci stet qui eros duis sit lorem amet. Lorem vel qui no dolore. Amet eu consectetuer lorem vero et sanctus takimata gubergren iriure et te dolor in no aliquyam invidunt diam takimata. Amet invidunt magna te lorem dolores et facilisi commodo amet sed dolores consetetur dolor eum odio vero ut.