From 4188f38ad56d7ba2ea46e94403f305243514f80c Mon Sep 17 00:00:00 2001 From: tcit Date: Thu, 24 Jul 2014 15:49:36 +0200 Subject: add pdf and mobi libraries --- .../libraries/mpdf/examples/example20_justify.php | 130 +++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 inc/3rdparty/libraries/mpdf/examples/example20_justify.php (limited to 'inc/3rdparty/libraries/mpdf/examples/example20_justify.php') diff --git a/inc/3rdparty/libraries/mpdf/examples/example20_justify.php b/inc/3rdparty/libraries/mpdf/examples/example20_justify.php new file mode 100644 index 00000000..7e9f8962 --- /dev/null +++ b/inc/3rdparty/libraries/mpdf/examples/example20_justify.php @@ -0,0 +1,130 @@ +mPDF +

Justification

+ +

Tables

+

Text can be justified in table cells using in-line or stylesheet CSS. (Note that <p> tags are removed within cells along with any style definition or attributes.)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Col/Row Header +

Second column header p

+
Third column header
Row header 1This is dataThis is data
Row header 2 +

This is data p

+
+

This is data

+
+

Row header 3

+
+

This is long data

+
This is data
+

Row header 4

+

<th> cell acting as header

+

Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim.

+

This is data

+
Row header 5Also dataAlso data
Row header 6Also dataAlso data
Row header 7Also dataAlso data
Row header 8Also dataAlso data
+

 

+ +

Testing Justification with Long Words

+

http://www-950.ibm.com/software/globalization/icu/demo/converters?s=ALL&snd=4356&dnd=4356

+
Should not split
+

Maecenas feugiat pede vel risus. Nulla et lectus eleifend verylongwordthatwontsplit neque sit amet erat

+

Maecenas feugiat pede vel risus. Nulla et lectus eleifend et verylongwordthatwontsplit neque sit amet erat

+ +
Non-breaking Space &nbsp;

The next example has a non-breaking space between eleifend and the very long word.

Maecenas feugiat pede vel risus. Nulla et lectus eleifend verylongwordthatwontsplitanywhere neque sit amet erat

Nbsp will only work in fonts that have a glyph to represent the character i.e. not in the CJK languages nor some Unicode fonts.

+ + + +

Testing Justification with mixed Styles

+

This is strikethrough in block and small strikethrough in small span and big strikethrough in big span and then underline but out of span again but blue font and ACRONYM text

+

This is a green reference32-47 and underlined reference32-47 then reference32-47 and underlined reference32-47 then Strikethrough reference32-47 and strikethrough reference32-47 and then more text. +

+

Repeated in BIG: This is reference32-47 and underlined reference32-47 then reference32-47 and underlined reference32-47 but out of span again but blue font and ACRONYM text +

+

Repeated in small: This is reference32-47 and underlined reference32-47 then reference32-47 and underlined reference32-47 but out of span again but blue font and ACRONYM text +

+ +

This is strikethrough in block and big strikethrough in big span and then underline but out of span again but blue font and ACRONYM text

+

This is reference32-47 and underlined reference32-47 then reference32-47 and underlined reference32-47 then Strikethrough reference32-47 and strikethrough reference32-47 then more text. +

+

+

+Repeated in BIG: This is reference32-47 and underlined reference32-47 then reference32-47 and underlined reference32-47 but out of span again but blue font and ACRONYM text +

+'; + +//============================================================== +//============================================================== +//============================================================== +include("../mpdf.php"); + +$mpdf=new mPDF('c','A4','','',32,25,27,25,16,13); + +$mpdf->SetDisplayMode('fullpage'); + +// LOAD a stylesheet +$stylesheet = file_get_contents('mpdfstyletables.css'); +$mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text + +$mpdf->WriteHTML($html); + +// SPACING +$mpdf->WriteHTML("

Spacing

mPDF uses both letter- and word-spacing for text justification. The default is a mixture of both, set by the configurable values jSWord and jSmaxChar. (Only word spacing is used when cursive languages such as Arabic or Indic are detected.)

"); + +$mpdf->jSWord = 0; // Proportion (/1) of space (when justifying margins) to allocate to Word vs. Character +$mpdf->jSmaxChar = 0; // Maximum spacing to allocate to character spacing. (0 = no maximum) +$mpdf->WriteHTML("
Character spacing

Maecenas feugiat pede vel risus. Nulla et lectus eleifend verylongwordthatwontsplitanywhere neque sit amet erat

"); + +// Back to default settings +$mpdf->jSWord = 0.4; +$mpdf->jSmaxChar = 2; +$mpdf->WriteHTML("
Word spacing

Maecenas feugiat pede vel risus. Nulla et lectus eleifend verylongwordthatwontsplitanywhere neque sit amet erat

"); + +$mpdf->WriteHTML("
Mixed Character and Word spacing

Maecenas feugiat pede vel risus. Nulla et lectus eleifend verylongwordthatwontsplitanywhere neque sit amet erat

"); + + + + +$mpdf->Output(); +exit; + + +?> \ No newline at end of file -- cgit v1.2.3