17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Our paper planes are the ideal way of<br />

passing the time. We offer revolutionary<br />

brand new developments of the<br />

traditional common paper planes. If<br />

your lesson, conference, or lecture turn<br />

out to be deadly boring, you can have<br />

a wonderful time with our planes. All<br />

our models are folded from one paper<br />

sheet. They are exclusively folded<br />

without using any adhesive. Several<br />

models are equipped with a folded<br />

landing gear enabling a safe landing<br />

on the intended location provided that<br />

you have aimed well. Other models are<br />

able to fly loops or cover long distances.<br />

Let them start from a vista point<br />

in the mountains and see where they<br />

touch the ground.<br />

Fig. 8.21<br />

Justified text with soft hyphen characters,<br />

using default settings and a wide fitbox<br />

Our paper planes are the ideal way of<br />

passing the time. We offer revolutionary<br />

brand new developments of the<br />

traditional common paper planes. If<br />

your lesson, conference, or lecture turn<br />

out to be deadly boring, you can have<br />

a wonderful time with our planes. All<br />

our models are folded from one paper<br />

sheet. They are exclusively folded<br />

without using any adhesive. Several<br />

models are equipped with a folded<br />

landing gear enabling a safe landing<br />

on the intended location provided that<br />

you have aimed well. Other models are<br />

able to fly loops or cover long<br />

distances. Let them start from a vista<br />

point in the mountains and see where<br />

they touch the ground.<br />

Fig. 8.22<br />

Justified text without soft hyphens, using<br />

default settings and a wide fitbox.<br />

8.2.7 Hyphenation<br />

<strong>PDFlib</strong> does not automatically hyphenate text, but can break words at hyphenation opportunities<br />

which are explicitly marked in the text by soft hyphen characters. The soft<br />

hyphen character is at position U+00AD in Unicode, but several methods are available<br />

for specifying the soft hyphen in non-Unicode environments:<br />

> In all cp1250 – cp1258 (including winansi) and iso8859-1 – iso8859-16 encodings the soft<br />

hyphen is at decimal 173, octal 255, or hexadecimal 0xAD.<br />

> A character entity reference can be used if an encoding does not contain the soft hyphen<br />

character (e.g. macroman): &shy;<br />

U+002D will be used as hyphenation character. In addition to breaking opportunities<br />

designated by soft hyphens, words can be forcefully hyphenated in extreme cases when<br />

other methods of adjustment, such as changing the word spacing or shrinking text, are<br />

not possible.<br />

Justified text with or without hyphen characters. In the following example we will<br />

print the following text with justified alignment. The text contains soft hyphen characters<br />

(visualized here as dashes):<br />

Our paper planes are the ideal way of pas sing the time. We offer revolu tionary<br />

brand new dev elop ments of the tradi tional common paper planes. If your lesson,<br />

confe rence, or lecture turn out to be deadly boring, you can have a wonder ful time<br />

with our planes. All our models are folded from one paper sheet. They are exclu sively<br />

folded without using any adhe sive. Several models are equip ped with a folded<br />

landing gear enab ling a safe landing on the intended loca tion provided that you<br />

have aimed well. Other models are able to fly loops or cover long dist ances. Let them<br />

start from a vista point in the mount ains and see where they touch the ground.<br />

Figure 8.21 shows the generated text output with default settings for justified text. It<br />

looks perfect since the conditions are optimal: the fitbox is wide enough, and there are<br />

explicit break opportunities specified by the soft hyphen characters. As you can see in<br />

Figure 8.22, the output looks okay even without explicit soft hyphens. The option list in<br />

both cases looks as follows:<br />

fontname=Helvetica fontsize=9 encoding=winansi alignment=justify<br />

218 Chapter 8: Text and Table Formatting (Edition for <strong>COM</strong>, .<strong>NET</strong>, and REALbasic)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!