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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Generated output Option list for fit_textline( )<br />

Kraxi<br />

e) boxsize={0 35} position={left center} orientate=west<br />

Aligning text at a horizontal or vertical line. Positioning text along a horizontal or<br />

vertical line (i.e. a box with zero height or width) is a somewhat extreme case which may<br />

be useful nevertheless. In Figure 8.4d the text is placed with the bottom centered at the<br />

box. With a width of 50 and a height of 0, the box resembles to a horizontal line.<br />

To align the text centered along a vertical line we will orientate it to the west and position<br />

it at the left center of the box. This case is shown in Figure 8.4e.<br />

8.1.3 Fitting Text into a Box<br />

In this section we use various fit methods to fit the text into the box. The current font<br />

and font size are assumed to be the same in all examples so that we can see how the font<br />

size and other properties will implicitly be changed by the different fit methods.<br />

Let’s start with the default case: no fit method will be used so that no clipping or scaling<br />

occurs. The text will be placed in the center of the box which is 100 units wide and 35<br />

units high (see Figure 8.5a).<br />

Decreasing the box width from 100 to 50 units doesn’t have any effect on the output.<br />

The text will remain in its original font size and will exceed beyond the box (see Figure<br />

8.5b).<br />

Proportionally fitting text into a small box. Now we will completely fit the text into<br />

the box while maintaining its proportions. This can be achieved with the<br />

fitmethod=auto option. In Figure 8.5c the box is wide enough to keep the text in its original<br />

size completely so that the text will be fit into the box unchanged.<br />

When scaling down the width of the box from 100 to 58, the text is too long to fit<br />

completely. The auto fit method will try to condense the text horizontally, subject to the<br />

shrinklimit option (default: 0.75). Figure 8.5d shows the text being shrunk down to 75 percent<br />

of its original length.<br />

When decreasing the box width further down to 30 units the text will not fit even if<br />

shrinking is applied. Then the meet method will be applied. The meet method will decrease<br />

the font size until the text fits completely into the box. This case is shown in Figure<br />

8.5e.<br />

Fitting the text into the box with increased font size. You might want to fit the text so<br />

that it covers the whole width (or height) of the box but maintains its proportions. Using<br />

fitmethod=meet with a box larger than the text, the text will be increased until its<br />

width matches the box width. This case is illustrated in Figure 8.5f.<br />

Completely fitting text into a box. We can further fit the text so that it completely fills<br />

the box. In this case, fitmethod=entire is used. However, this combination will rarely be<br />

used since the text will most probably be distorted (see Figure 8.5g).<br />

Fitting text into a box with clipping. In another rare case you might want to fit the<br />

text in its original size and clip the text if it exceeds the box. In this case, fitmethod=clip<br />

8.1 Placing and Fitting Textlines 201

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

Saved successfully!

Ooh no, something went wrong!