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.

Fine-tuning the vertical alignment of cell contents. When we vertically center contents<br />

of various types in the table cells, they will be positioned with varying distance<br />

from the borders. In Figure 8.30a, the four text line cells have been placed with the following<br />

option list:<br />

optlist = "fittextline={position={left center} font=" + font +<br />

" fontsize=8} colwidth=80 margin=4";<br />

The Textflow cell is added without any special options. Since we vertically centered the<br />

text lines, the Benefit line will move down with the height of the Textflow.<br />

Fig. 8.30 Aligning text lines and Textflow in table cells<br />

Generated output<br />

Our Paper Planes<br />

a)<br />

Material<br />

Benefit<br />

Offset print paper 220g/sqm<br />

It is amazingly robust and can<br />

even do aerobatics. But it is<br />

best suited to gliding.<br />

b)<br />

Our Paper Planes<br />

Material<br />

Benefit<br />

Offset print paper 220g/sqm<br />

It is amazingly robust and can<br />

even do aerobatics. But it is<br />

best suited to gliding.<br />

As shown in Figure 8.30b, we want all cell contents to have the same vertical distance<br />

from the cell borders regardless of whether they are Textflows or text lines. To accomplish<br />

this we first prepare the option list for the text lines. We define a fixed row height<br />

of 14 points, and the position of the text line to be on the top left with a margin of 4<br />

points.<br />

The fontsize=8 option which we supplied before doesn’t exactly represent the letter<br />

height but adds some space below and above. However, the height of an uppercase letter<br />

is exactly represented by the capheight value of the font. For this reason we use<br />

fontsize={capheight=6} which will approximately result in a font size of 8 points and<br />

(along with margin=4), will sum up to an overall height of 14 points corresponding to the<br />

rowheight option. The complete option list of add_table_cell( ) for our text line cells looks<br />

as follows:<br />

/* option list for the text line cells */<br />

optlist = "fittextline={position={left top} font=" + font +<br />

" fontsize={capheight=6}} rowheight=14 colwidth=80 margin=4";<br />

To add the Textflow we use fontsize={capheight=6} which will approximately result in a<br />

font size of 8 points and (along with margin=4), will sum up to an overall height of 14<br />

points as for the text lines above.<br />

/* option list for adding the Textflow */<br />

optlist = "font=" + font + " fontsize={capheight=6} leading=110%";<br />

230 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!