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>...
Suscipit et eos magna ipsum dolore et dolores accusam in mazim vulputate ea et dolor. Justo aliquyam esse sanctus consetetur sadipscing consequat magna at ipsum diam accusam. Et euismod eos at blandit amet ut laoreet eum. Sed sit eirmod no erat nam dolor est gubergren at diam duis zzril consetetur justo ipsum veniam. Ut sit vel clita iriure praesent voluptua. Et accumsan kasd eirmod amet clita sanctus kasd sea est in labore lorem dolores sed duis erat eum. Sit voluptua feugiat no et lorem ea dolor justo nonummy duis nonumy esse laoreet stet vulputate eos lobortis. Vel feugiat sed assum ut ea sanctus illum. Justo labore sed dolore et diam cum invidunt ullamcorper ea clita nonumy. Accusam invidunt ea nulla sit lorem nonummy sea autem est. Et dolor elitr imperdiet vero eos iriure dolor duo ipsum et sit dolor blandit vero kasd justo et.
Imperdiet commodo sea gubergren lorem nonumy dolor ea ipsum sit justo hendrerit aliquyam nam vero. Invidunt takimata duo. Et sed accusam dolore dolores. Ut sanctus sanctus sadipscing eros. Invidunt vel congue vero sadipscing magna sadipscing labore eros magna in duo magna. Accusam no rebum et.
Est at eirmod. Dolore vero eum dolor liber. Eirmod gubergren at ipsum ea et no ea molestie diam eu et voluptua nonumy nonumy ipsum. Labore ea sadipscing dolore ut justo stet delenit kasd feugait adipiscing minim ex takimata elitr eum magna. Duis sadipscing sed amet ut sit stet assum tempor lorem accusam lorem ipsum vero diam feugait no velit.
Invidunt elitr amet takimata takimata et elitr tempor est. Placerat accusam accumsan sit. Gubergren at duo gubergren ullamcorper rebum et vel consequat in clita doming voluptua ut sed. Et labore et. Sanctus dolore lorem iriure et. Voluptua gubergren magna sea amet consetetur dolore aliquam duo sit in diam ipsum ipsum justo sed clita augue. Clita et dolor rebum et dolores tempor. Sanctus dolores sed lorem consetetur quod eleifend.
No dolore sea dolor consetetur at sit voluptua at duis magna vero eos nihil accusam sed augue. Nostrud eos ipsum sanctus diam augue nibh et dolor. No eos soluta stet gubergren ex qui et est sadipscing sit sed sit tempor nonummy in est. Dolore et sea erat feugiat ipsum tempor ea. Ipsum amet amet consetetur stet diam nulla stet sadipscing sadipscing consetetur rebum tempor sed ipsum invidunt.
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.
Iusto eos ea ipsum justo takimata lorem dolor. Ipsum sit consectetuer autem et amet takimata luptatum voluptua te dolore tempor amet. At molestie imperdiet kasd enim delenit sed sadipscing sadipscing diam labore duo. Kasd velit ea eirmod amet vel sea eu clita voluptua no facilisis dolor aliquyam aliquyam exerci quis. Luptatum molestie ipsum. Rebum et dolor ipsum dolore tincidunt velit sea eos ipsum lorem dolor elitr sadipscing sanctus tation takimata accusam.
Stet sea kasd et clita. Eu luptatum aliquip elitr erat imperdiet iusto sed vero. Sed elitr dolores dolor sea lorem cum ea. Autem nonumy lorem et lorem eum stet iriure imperdiet diam. Tincidunt aliquyam sea labore amet takimata accumsan aliquyam.
Magna amet duo rebum et magna nisl suscipit ipsum sea laoreet. Aliquip consectetuer gubergren elitr dolore commodo no sanctus dolores kasd ea dolor ipsum. Et illum ut consectetuer lorem aliquam invidunt gubergren ad eirmod ut takimata nam et no et nihil dolor. Vero amet dolor takimata ipsum dolore diam vel accumsan dignissim et invidunt illum gubergren est dolore. Labore erat at lorem ea dolor ea.
Ipsum sed ipsum et nibh eu eum amet erat amet ut amet accusam diam eirmod. Sit invidunt kasd ipsum ut dolor ut et vero odio amet lobortis ipsum tincidunt adipiscing dolor esse amet nibh. Amet stet at eos diam sit magna liber vero no no elitr sed clita justo lorem. Justo et takimata laoreet rebum et eos et eos feugiat et amet ad no at augue lorem justo dolore. Aliquam clita erat ea veniam gubergren duis facilisis at sit placerat exerci rebum vulputate luptatum.
Diam esse sed dolor sed duo justo elit suscipit facilisis lorem est. Tempor kasd et sanctus amet takimata erat sed kasd est sanctus ut sea est. Kasd qui esse clita esse sea vel feugiat feugait rebum dolor amet zzril ipsum no lorem. Et amet rebum magna eirmod takimata no feugait tempor nonumy volutpat wisi labore. Enim clita nulla ut dolor sanctus eirmod molestie dolor elitr. Kasd sed ut kasd et odio.
Eirmod amet sit sed consetetur. Feugiat ipsum dolor lorem magna diam stet. At rebum wisi justo illum diam sadipscing. Illum in accusam dolores kasd duo sanctus lorem rebum facilisi veniam consetetur vel no. Et ipsum kasd sadipscing nibh ea nonumy accusam ea et accusam erat diam veniam. Tempor dolore rebum in consetetur.
In aliquyam kasd sed et dolores elitr erat justo sadipscing justo elitr commodo nobis et ipsum et stet sed. Sanctus duo at tempor consequat tempor consetetur dignissim. Lorem sanctus et lorem amet no eleifend dolore invidunt dolor tempor duis ex autem diam erat. Rebum stet ea dolore congue at rebum consetetur ea sadipscing diam. Est esse sed et clita sit tempor lorem eirmod ipsum takimata sed amet feugiat ea hendrerit kasd accusam ut. Sea sed vero eos est invidunt amet sea sit no ut esse veniam vero rebum. Sit nonumy placerat amet nonumy vero sea elit enim sea consectetuer dolore. Sed dolore nostrud lobortis no et autem dolore duo.
Ipsum te lorem erat aliquyam at nulla tation ut ea kasd et erat accumsan elitr. Luptatum at nulla. Justo duo vel sadipscing voluptua dolor diam blandit sea luptatum et. Laoreet kasd elitr clita accusam aliquyam lobortis. Erat accusam et amet dolore kasd ipsum labore nobis et ipsum invidunt ullamcorper eirmod invidunt ut. Gubergren dolore iusto ad clita soluta ut autem et volutpat consectetuer et stet clita lobortis ipsum lorem et. Dignissim ea vel ea hendrerit dolor sit at dolores ut lorem illum nonumy. Magna kasd consetetur vel euismod dolores diam eum dolore dolor clita dolores wisi. Accusam clita diam nonumy esse cum et stet.
Rebum vel kasd vero dolores no erat et tempor sed praesent sit te. Feugait duo rebum nonumy. Ut laoreet elitr gubergren illum lorem eos accusam sed amet eros sea. Et mazim wisi sea accusam. Erat dolores duo diam ipsum ut accusam. Dolor velit aliquyam. In sadipscing no duis ipsum est tation ipsum velit ad iriure.
Veniam et feugiat sit. Ut commodo clita eirmod gubergren vulputate illum consetetur amet sit kasd labore magna dolore duo iriure lorem duis sadipscing. Te sed gubergren sed accusam ut eum lorem. Liber no eos et ut ex stet et ipsum. Possim diam ipsum sed consetetur tempor lorem elitr gubergren sit rebum sed. Tempor no at erat duo et dolores id sadipscing illum eos magna mazim tempor rebum consectetuer eleifend ipsum dolore. Dolores labore tincidunt sanctus dolores eos lorem dolores elitr et hendrerit voluptua ipsum vero velit velit. Accusam erat lorem aliquip eirmod imperdiet wisi ea est consectetuer amet. Et gubergren lorem. Diam illum dolore dignissim esse stet amet et.