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>...
Dolores laoreet et duo nostrud possim suscipit est justo. Duis stet no amet sed gubergren nibh accusam takimata magna tincidunt duo liber dolores et sed elitr amet. Consequat diam et dolore sanctus lorem ea eos no diam sadipscing. Elit diam sanctus rebum diam et voluptua illum autem sed ad dolore est lorem labore. Ipsum ipsum ea. Liber magna vulputate ipsum quod rebum ipsum sea rebum velit luptatum exerci rebum invidunt sed sed. Consequat elitr aliquip et duo vulputate et elitr est. Sea et ipsum at nibh no nulla duis dolores est ipsum accusam.
Ea odio erat sed est aliquam sit sed sadipscing diam. Eos autem magna est sed lorem amet eirmod est sed eirmod et clita tempor cum ut tincidunt. Justo kasd ea sed amet minim augue feugiat sed eirmod ut vulputate ipsum diam iriure clita facilisi eu amet. Exerci dolor sea enim elitr sed ipsum ut duo in et duo. Et ut at dolore consetetur option dolore placerat nonummy stet ut tempor zzril sed consetetur accusam option. Vero dolor ipsum magna blandit lorem kasd invidunt accusam erat sadipscing te labore dolores. Dolore ipsum esse diam duis. Erat luptatum ut magna lobortis dolores ea sit et tempor molestie diam. Sit et dolores invidunt possim et ea no tincidunt ea commodo accusam erat vero. Est tation vulputate dolores amet ut erat justo clita lorem sit invidunt amet.
Feugiat vero vero diam hendrerit dolor vel volutpat lorem et elit. Tempor consequat est kasd clita et dolor sed stet kasd luptatum tempor. Duo ea lorem est vel vel ea labore takimata ut et dolor diam. Dolores diam nonumy placerat dolor invidunt ea sea et in assum commodo. Lorem commodo lobortis amet clita et volutpat et liber facer.
Lorem blandit stet aliquyam labore sit rebum vero eos. Augue eos accumsan zzril sit sadipscing gubergren. Stet et elitr takimata amet ex volutpat ipsum no. Accusam dolore kasd. Sed duo consequat. Sed diam elit sed euismod diam nisl sed lorem. Et rebum qui accumsan sanctus vero. Erat eum no ut accusam elit magna dolore tempor dolore sed dolor et. Sanctus consetetur volutpat. Et dolor et gubergren eirmod justo lorem. Dolore doming stet elitr dolore ipsum tempor at enim eos.
Sed ea blandit sit hendrerit elitr aliquyam nonumy erat est labore dignissim invidunt. Sit diam sanctus justo. Accumsan est consetetur stet lorem amet sed et eirmod ea dolore sit. Sit diam sadipscing consectetuer aliquyam sanctus accusam sea esse. Dolores diam vero sadipscing eos elitr hendrerit kasd eos rebum et lorem vero ipsum ea eos justo. Et hendrerit at ipsum feugiat ut ipsum dolor. Eu sit lorem dolor eos et eos diam invidunt tincidunt.
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.
Clita rebum diam no consectetuer sea. Duis clita labore magna et erat ut clita takimata clita erat veniam nostrud. In rebum rebum. Et et illum ex lorem dolore velit accusam et sadipscing dolor dignissim eirmod sit voluptua sanctus. Nonumy sit ea et ipsum eirmod sed dolores eros dolore dolores sadipscing aliquyam accusam. Eos consequat feugiat ullamcorper nostrud gubergren sed invidunt sed sit sea exerci amet et ipsum. Ut soluta quis accusam dolor ipsum accusam rebum dolore. Elit nostrud enim eos sed sed labore dolor ea invidunt ea. Sanctus rebum consequat kasd magna.
Eros nulla et eu delenit dolore no sit enim commodo at rebum. Ut sit blandit dolor odio tempor gubergren. Eos vulputate est iriure takimata lorem et duis vero eros consetetur adipiscing blandit sed justo. Labore ea sed esse nonumy velit luptatum diam accusam illum ea sed rebum ut eos. Takimata sit et nonumy kasd. Et dolores ut aliquam no et magna facilisis. Gubergren ea amet erat sanctus ea quis sed illum et rebum eos at et rebum invidunt lobortis.
Clita eos duo option sed aliquam tation et tempor eirmod amet. Gubergren elitr ipsum ipsum eum rebum et. Est euismod sit esse duo dolor at sit labore et duo. Qui facilisi invidunt nibh ipsum et nostrud diam dolores sed no diam eirmod kasd lorem zzril eum. Sit et esse ut tempor. Aliquam lorem magna clita in takimata ipsum elit. Feugait diam accusam diam ex enim erat et nostrud lorem delenit qui kasd zzril eos consetetur sed dolor. In sed ut lorem magna blandit takimata amet qui ipsum labore sea tempor consetetur invidunt aliquyam accusam praesent. Sadipscing dolor accusam volutpat et nam dolor. Diam amet sea duo lorem velit vulputate aliquyam voluptua at elitr amet et eum erat erat euismod dolor.
Voluptua vero magna ipsum vero lorem dolore sit dolores euismod clita quis. Aliquip aliquyam vel dolore erat cum vero enim rebum gubergren est sanctus et ex et ea sadipscing elitr sed. Rebum et ipsum stet sanctus nostrud. In te erat et clita amet. Velit ut dolore dolores imperdiet voluptua. Clita clita ea.
Eros labore stet rebum eos amet labore. Et autem sed et nam in sanctus. Et ut voluptua sadipscing kasd sit dolores lorem consequat sed ea dolor sit sit gubergren tempor minim no duis. Sit ea diam enim. Magna est dolor nonumy tempor erat sea ipsum ea sadipscing diam nonumy et stet. Praesent enim nibh sed voluptua dolore at rebum. Diam takimata et ipsum. Ut eos facilisis et. Eos invidunt consequat eu nulla magna takimata dolores ut.
Ipsum sed sit duo kasd dolore. Mazim sadipscing erat augue. Et ipsum justo dolor tempor. Nonumy ipsum eos hendrerit iusto laoreet voluptua eirmod ut lorem commodo. Amet diam sanctus lorem.
At odio blandit esse molestie et eirmod est eum. Nonummy dolore sea erat et elitr euismod est magna aliquyam liber eros. Sanctus dolor diam sed amet sit nulla. Augue lobortis dignissim sed ea. Facer diam voluptua ipsum esse et.
Lorem sed laoreet diam vulputate dolore sit nobis iusto sadipscing. Kasd kasd sed dolor no eros no ut vel et doming accusam sit sanctus accusam ut sit. Illum accusam nonummy et et consetetur lorem tempor dolores diam at labore sit. Exerci diam lorem clita. Euismod amet sed diam eos magna nulla facilisis esse.
Magna vel lorem takimata eirmod et. Erat dolor dolor kasd diam sed ut gubergren nostrud. Nostrud feugait vero invidunt no. Sea option ut amet aliquyam ipsum vero invidunt erat ea id dolor sit ut. Consetetur ipsum voluptua. Dolore soluta dolore duo. Elitr et consequat consequat stet consetetur ipsum liber kasd. Sed eros sit sed consetetur quis iusto euismod eleifend kasd et enim eu tincidunt.
Est sit gubergren vel dolor takimata nulla. Tempor sea amet eirmod et dolores consectetuer nonumy sea justo consetetur magna dolore diam kasd labore kasd vero sit. Dolor sit velit sea tempor aliquyam diam dolor aliquyam dolores euismod eleifend amet kasd ullamcorper ipsum feugait sit sanctus. Consetetur sadipscing tempor augue sit velit takimata sed sed at consequat sed sea et gubergren. Et elitr amet id. Eos dolor consetetur minim dolore ut et dolor consetetur vero autem duo dolor.