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 ...
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 pagekeep-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 pagekeep-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 pagekeep-together.within-line
: set to "always" and used to keep a span
of content glued always together in a single lineThe following shows some demonstrations of these capabilities.
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>...
Nulla ea no consetetur sed sadipscing et veniam vulputate rebum voluptua. Amet nonumy ea sadipscing clita no ipsum clita et. Consetetur kasd consetetur sea magna labore enim dolores eos odio diam. Ut nibh est feugait lorem et accusam nulla. Lobortis vero consectetuer lorem erat amet. Elitr eleifend aliquyam rebum et sadipscing dolor exerci et. Eum lorem dolor nonumy diam. Ex veniam est vero accusam dignissim velit eirmod accumsan facilisis facilisi diam dolor. Feugait sit eos amet et elitr in at vero sea. Erat laoreet soluta et et.
Ea justo ut. At tempor dolore hendrerit diam elitr eos nonummy magna stet et no sea consetetur nibh dolor. Eu dolore euismod invidunt sit justo elitr amet et duo amet justo luptatum vel eos no diam autem. Sed lorem zzril delenit magna. Nisl eos sea sit et at enim nostrud. Dolore amet euismod erat. Ipsum nonumy id velit vero consequat exerci justo eirmod ipsum lorem.
Lorem eirmod sadipscing sit justo est facilisis at duis duo duis aliquyam. Eos diam nonumy kasd lorem minim quis. Gubergren nulla te. Velit amet duo. Tempor kasd dolor lorem in.
Labore vel wisi magna ea ipsum sed dolore dolore et magna congue labore aliquyam nonummy sed ipsum erat. Sea nibh labore voluptua rebum nonumy duis sanctus sed ut amet. Ipsum labore takimata sanctus dolor volutpat sed elitr eu elitr justo. Ut quod invidunt labore eos diam dolore. Voluptua sed labore. Lorem voluptua nonumy justo lorem dolor lorem dolor odio ipsum erat ea.
Aliquyam elitr kasd ipsum dolores dolore tation diam at dignissim justo euismod consequat ea facer sit. Vero lorem dolor sanctus elitr kasd facer magna vel consetetur dolores takimata. Rebum et vero. Sit diam nisl et elitr duo duis nonummy. Wisi sit stet amet et facilisis vel erat velit ea augue dolor eirmod gubergren. Commodo sit nonumy no labore eirmod. Sit suscipit duis justo zzril et nihil ipsum magna et dolor consetetur feugiat.
Thus all of this content from the header through this paragraph is together on a single page.
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.
Dolor no voluptua adipiscing sea sed takimata autem ea takimata aliquyam. Nonumy elitr aliquyam nonumy consetetur. Sed lorem nibh duis lorem aliquyam et amet et dolores ea est consetetur ipsum. Consetetur et stet dolore dolor magna duis nonumy. Ipsum clita vel esse elitr sed dolor sadipscing justo magna diam qui magna dolore eu at tation sed iriure. Sit kasd stet luptatum accusam clita voluptua adipiscing vulputate et veniam. Kasd ut ea diam sit et. Est delenit diam ut. No kasd stet stet et sit diam nonumy praesent. Rebum elitr dolore justo nobis magna ut dolor sanctus. Gubergren tation et molestie.
Aliquyam diam et nonumy consetetur vulputate euismod sanctus takimata sadipscing lorem stet dolores at ea iusto ea. Ut justo est sed option duis dolor ad molestie. Eu accusam exerci duis. In amet ad sanctus. Dignissim ut dolor sadipscing.
Eos nonumy ea consequat stet sanctus sadipscing et magna ad eirmod justo sed voluptua. Lorem invidunt praesent mazim lorem illum tempor accusam voluptua diam et minim tempor dolor erat esse stet. Sed lorem eleifend erat sit. Diam erat sit nulla amet sit dolore dolor wisi hendrerit aliquyam et dolores aliquam sed nulla kasd. Consetetur sadipscing ea. Et eos molestie sadipscing voluptua tempor iusto. Cum accusam invidunt eos ea. Magna in gubergren sanctus nulla at dolor eu eros amet et veniam vero ad. Eu ut sea stet et sanctus aliquyam elitr sit nostrud delenit magna diam eos. Euismod ad lorem illum diam esse sea tempor nisl molestie in vero magna quis vero consectetuer sanctus.
Et invidunt ea ullamcorper consetetur justo ut consequat at tincidunt. Vel et voluptua. Nobis et sea sea nonumy elit et ipsum eos kasd tincidunt. Amet ex sadipscing aliquyam dolore diam takimata tempor ipsum dolor lorem sadipscing et tempor sed ipsum consetetur. Sanctus nulla hendrerit eos no et vero ipsum dolor lorem stet. Elitr ea invidunt aliquyam consectetuer sit ut nihil ut sanctus amet et quod nonumy et et no. Mazim sed ipsum rebum diam. Suscipit eros placerat consetetur sanctus dolore eirmod lorem eos kasd est vero sea gubergren eros amet rebum veniam. Lorem nostrud et ipsum ipsum magna. Iriure takimata et dolor ea diam kasd dolore veniam at vero diam in sed duo nostrud dolor autem. Dolor sea eos eirmod ipsum ea.
Diam at nonumy duis dolor rebum dolor molestie magna at odio quis nulla erat at magna commodo. Eos vero ut dolore lorem justo ex accusam. Dolor vel ipsum magna tempor clita sit takimata laoreet at consequat iusto diam gubergren. Invidunt ut no voluptua at duo et duo. Te elitr amet eros et labore lorem sit aliquyam. Sit sanctus sed sadipscing illum lorem feugiat. Ut velit lorem dolores sit dolor ipsum sit ipsum rebum consetetur wisi ea duo. Sit et amet kasd eirmod ut tempor euismod ex in ipsum rebum magna. Sea laoreet takimata in. Ipsum clita dolores vero dolor tempor dolor diam erat invidunt.
Gubergren sed at kasd accusam eirmod vulputate sed volutpat magna dolore aliquam. Magna eos sit tempor facilisis eos accusam molestie et justo ipsum. Augue autem at eum hendrerit duo. Duis sea magna invidunt dolore ipsum tempor dolor eirmod labore kasd duo. Dolor labore lorem et et diam nonumy stet sit duis et elitr eos voluptua facilisis diam clita. Sed clita hendrerit at.
Amet vel nonumy eum lorem. Accusam eos consequat. Diam eu erat et diam. Erat eros et eu luptatum quis. Et nibh vel at. Et nonumy et duo dolore lorem sed magna dolor rebum nulla. Gubergren gubergren velit sit invidunt sit vulputate elitr sea consetetur dolore amet. Sanctus dolor eu augue dolores rebum takimata takimata. Nonumy dolore volutpat est vel.
Aliquyam et sit amet kasd et sed vero invidunt ea sed takimata et hendrerit nulla. Nonumy nonumy at dolor eu duo ut consequat ut clita in tempor elitr dolor duis. Dolore illum eum consetetur dolores sit duo molestie clita feugait eros luptatum dolores. Eos ipsum duis voluptua nonumy et. Et stet sed magna et commodo duo duis. Ea cum ex ipsum nisl labore amet rebum nonumy nonumy lorem eirmod invidunt consequat at diam sit labore. Diam ullamcorper et vero volutpat nonummy option et erat rebum amet magna justo. Sed sadipscing sea stet dolor kasd eos dolor ea clita sanctus clita molestie tempor diam molestie diam duo. Erat gubergren eu enim dolore invidunt commodo lorem rebum autem. Invidunt sit labore dolores consetetur sadipscing labore vero vel consequat luptatum accusam tempor sit duo. Magna at sadipscing vel clita et est.
Sed consetetur duis diam ut clita diam takimata. Sit tempor diam duo vero labore lorem et dignissim diam illum in amet invidunt stet amet est diam et. Magna at vel nostrud lorem amet praesent. Imperdiet eum takimata eirmod ea et amet autem elitr stet ut. Consetetur dolor augue diam no sadipscing dolore. Et sit delenit dolor no sadipscing tempor accusam vulputate amet stet ut. Dolore at vero sit sadipscing justo elitr invidunt rebum. Mazim elitr ullamcorper lobortis labore sed justo duo sed duo gubergren. Sit ipsum vero erat et et sed sea in lorem nulla no stet et velit takimata.
Laoreet accusam nisl eirmod. Kasd volutpat facilisi dolor gubergren invidunt ea vel ullamcorper at consetetur accumsan voluptua delenit enim dolores no. Sanctus nulla hendrerit dolore eleifend elitr kasd diam sed dolor ut gubergren et qui dolor in stet aliquyam amet. Molestie accusam sit rebum dolores ea dolor et augue euismod et molestie praesent rebum duis no. Duis et amet in justo et rebum duis eirmod blandit. Autem gubergren nobis labore ea diam eirmod qui dolor eu magna ipsum nonumy clita sit amet dolore dolore. Sed takimata est aliquyam dolor stet gubergren. Duo erat et amet nisl amet sadipscing molestie et sed invidunt et.