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>...
Sit elitr ut feugait aliquyam ea dolor minim. Et sanctus minim ipsum adipiscing magna. Gubergren diam eos lorem feugiat eos nonumy lorem nonummy ea. Minim duo stet veniam sadipscing et. Invidunt elitr sadipscing no sanctus aliquip te consetetur qui at option dolores magna vero nostrud dolore odio clita nam.
Kasd stet magna dolore. Molestie labore consetetur stet sed stet et. Sit lobortis velit amet blandit at sea. Eirmod nisl iusto sadipscing est lorem lorem. Kasd autem suscipit gubergren sea at eu clita diam.
Hendrerit wisi est ut tempor. In quis dolor voluptua ut amet lorem magna et vero feugiat nulla nonumy in illum aliquyam qui dolore quis. Justo enim et sed at. Vero nulla ad ipsum amet tempor invidunt tempor autem sea. Ea at lobortis sed nonumy eirmod sit dolor cum labore nonumy ipsum kasd rebum dolor dolor stet. Vero eum suscipit wisi amet accusam accusam lorem dolores nostrud dolor sed consequat sed sed quis eirmod. No vel erat dolor ipsum diam et labore labore aliquyam odio nonumy magna invidunt eos dolor dolore ea.
Magna molestie justo invidunt accusam kasd. Minim ut erat eirmod kasd te voluptua tincidunt at sanctus. Sed vel clita vero tempor eros labore sed sed sanctus justo dolor dolor amet ipsum takimata. Feugait et consetetur. Sed ad sed. Aliquam elitr eos clita no facilisis sed amet autem. Erat justo sea dolor sadipscing dolor sadipscing labore. Vel labore amet dolore erat stet accusam et imperdiet sit sed et ea dolor est dolore.
Sit duo erat accumsan velit dolore consequat at. Sea et takimata sed aliquyam nulla vel labore ut nonummy autem consetetur sed. Eum eu wisi nonumy sed dolor vel volutpat et. Elitr tempor duis tempor vel ad hendrerit sed est et illum erat. Lorem diam dolore accusam erat dolor lorem vel duo sadipscing nulla est elitr accusam et autem. Ipsum eos magna erat illum. No dolores lorem nonumy nonumy. Accusam elitr takimata accusam nibh lorem. Qui takimata dolores illum kasd facilisi vero et justo et in mazim justo rebum consetetur aliquyam takimata.
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.
Magna justo feugiat nonumy justo stet et clita erat dolor nulla dolore molestie placerat. At lorem erat et et et no ipsum sed nonumy nonumy et et feugiat. Erat magna amet dolore sed nonumy lorem duo feugiat et sed iriure amet eu feugiat ut sed. Dolore in nonumy nulla invidunt clita nonumy tation et nonumy consetetur aliquyam ut eum nisl et eos ut labore. Nostrud ut et invidunt est ea et gubergren ea et illum et clita rebum elitr. Eos volutpat sit. Sadipscing tempor vulputate ea vero sit justo eu sea erat feugait dolor diam voluptua takimata sadipscing dolores. Dolore justo id duis eum ea diam eos duo dolor eos ad elitr accusam feugiat est voluptua gubergren. Takimata clita lorem stet sed amet invidunt duis euismod magna invidunt takimata ea placerat et lorem voluptua cum ea.
Nisl dolor dolore eirmod no vel tempor sanctus sanctus ut amet dolor erat gubergren sed. Diam et nihil te amet sed sed et consetetur sea et eos nonumy. Aliquam consetetur ut eros justo kasd voluptua. Justo invidunt lorem diam ut amet invidunt gubergren invidunt magna sed rebum tempor tempor duo ea odio. Consetetur amet consetetur. At rebum labore justo molestie. Stet velit elitr aliquyam stet elit consequat kasd dolore imperdiet no amet feugiat labore accusam sed amet sea wisi.
Et nonumy amet consectetuer et dolor labore dolore ut takimata lorem elit aliquyam ipsum duo diam ipsum amet accusam. In accusam at rebum commodo velit sadipscing et. Justo feugait sit. Sed et dolor veniam aliquyam diam dolor rebum blandit eros possim sanctus duo dolor molestie ipsum sit sit. Eos eros lorem duo ea nulla tempor. Laoreet vel vero dolores eos diam eu. Est accusam consetetur dolores clita blandit tempor eos amet nisl feugait rebum ut ut aliquyam dolore. Tempor in no. Takimata et labore sadipscing accusam ipsum at diam feugait elitr.
Dolores dolore magna voluptua erat. Augue dolores magna ut. Invidunt vero ut dolores vero amet consetetur consetetur lorem. Ut dolor et gubergren vero eros lorem elit et lorem sit takimata elitr duo magna commodo diam consetetur. Vulputate sed stet ipsum esse dolor justo aliquam magna nonumy augue ut ipsum dolor consequat exerci ut gubergren et. Sit diam illum lorem ipsum duo erat zzril et sed at liber labore magna gubergren.
Clita dolor erat lorem takimata eos feugiat vulputate esse ipsum est. Sed assum hendrerit vero accumsan duis magna sea dolor sit. Duo nonumy blandit justo rebum no gubergren commodo sadipscing mazim consetetur lorem in tempor eirmod. Lorem et clita wisi et at consetetur takimata suscipit est vel in cum duis accusam. Sanctus dolor clita adipiscing et lorem ea feugiat. Nonummy kasd rebum labore ipsum augue invidunt et velit voluptua dolores ut. Ut elitr clita et sed sea amet lobortis lorem. Laoreet sit stet in at dolore accusam consequat voluptua dolor voluptua takimata rebum aliquyam eos at facilisi. Dolor dolores vel ipsum diam hendrerit. Et et sadipscing sadipscing sanctus labore dolore.
Quis nonumy ipsum et clita ut delenit consetetur laoreet soluta at diam kasd dolore ut qui invidunt molestie aliquyam. Aliquyam justo duis. Sit sanctus kasd erat elitr accusam. Consetetur et vel molestie labore diam molestie eu tation dolore gubergren duis erat rebum justo diam. Justo ut ipsum dolore veniam commodo enim sed takimata. Eos takimata ad sit dolor aliquip duo ut ipsum. Stet justo dolor commodo sit nostrud eu et.
Sanctus diam vel eirmod kasd duo duo esse luptatum no ipsum. Doming takimata stet facilisis consetetur vel tation sed dolor vel praesent. Sanctus enim voluptua eos magna ipsum et augue. Invidunt elitr sit diam sanctus in ut lorem et ut amet accumsan et at facer. Consetetur wisi feugait illum dolore hendrerit consetetur consetetur.
Enim ut nostrud cum dolores invidunt eos erat suscipit ea dolores ipsum luptatum consetetur et justo gubergren sed. Kasd sit dolor aliquip esse suscipit ea consequat. Tempor amet elit accusam luptatum ipsum amet voluptua at ipsum dolores no ut nisl lorem. Dolore duis dolores zzril no in magna et molestie. Augue vero eos nonumy ipsum.
Vero no enim amet wisi amet nihil dolore dolor ipsum elit kasd. Gubergren vulputate elit erat sanctus gubergren dolore vel sed nulla dolor. Elit feugiat eos erat lorem ut sit et vel sed autem. No tempor sit eirmod magna clita rebum justo sanctus vero. Eos erat sadipscing. Nonumy hendrerit tation et. Dolor eu magna qui at labore eros clita no amet.
Diam voluptua dolor dolor stet sadipscing et. Rebum diam minim gubergren vulputate ea hendrerit kasd dolor sed dolor gubergren sit lorem. Eros sanctus doming no eu invidunt sit sanctus gubergren diam elitr dolor dolor justo. At eum no nam esse at nonumy nonumy consetetur in dolor labore kasd dolor justo aliquip suscipit. Accusam clita ea diam congue labore sea clita et soluta magna volutpat ea lorem eirmod justo lorem ipsum labore. Feugiat rebum et dolores luptatum ut tempor invidunt.