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.

esult = p.fit_table(tbl, llx, lly, urx, ury, optlist);<br />

if (result.equals("_error"))<br />

throw new Exception("Error: " + p.get_errmsg());<br />

p.end_page_ext("");<br />

8.3.5 Table Instances<br />

The rows of the table which are placed in one fitbox comprise a table instance. One or<br />

more table instances may be required to represent the full table. Each call to fit_table( )<br />

will place one table instance in one fitbox. The fitboxes can be placed on the same page,<br />

e.g. with a multi-column layout, or on several pages.<br />

The table in Figure 8.37 is spread over three pages. Each table instance is placed in<br />

one fitbox on one page. For each call to fit_table( ) the first row is defined as header and<br />

the last row is defined as footer.<br />

3 Cone Head Rocket<br />

Our Paper Plane Models<br />

Fig. 8.37<br />

Table broken into several<br />

table instances placed in<br />

one fitbox each.<br />

table instance<br />

header<br />

row join<br />

group<br />

footer<br />

Material Kent paper 200g/sqm<br />

BenefitOur Paper This paper Plane arrow can Models be<br />

thrown with big swing. It<br />

2 Long Distance Glider<br />

stays in the air a long time.<br />

Material Drawing paper 180g/sqm<br />

BenefitOur Paper With this Plane paper rocket Models you<br />

1 Giant Wing<br />

can send all your messages<br />

even when sitting in the<br />

Material Offset print cinema paper pretty 220g/sqm near the back.<br />

Benefit It is amazingly robust and<br />

Amazingly robust!<br />

can even do aerobatics. But<br />

it is best suited to gliding.<br />

With big swing!<br />

Page 3<br />

table’s fitbox<br />

Page 2<br />

The following code fragment shows the general loop for fitting table instances until the<br />

table has been placed completely. New pages are created as long as more table instances<br />

need to be placed.<br />

Page 1<br />

do {<br />

/* Create a new page */<br />

p.begin_page_ext(0, 0, "width=a4.width height=a4.height");<br />

/* Use the first row as header and draw lines for all table cells */<br />

optlist = "header=1 stroke={{line=other}}";<br />

/* Place the table instance */<br />

result = p.fit_table(tbl, llx, lly, urx, ury, optlist);<br />

if (result.equals("_error"))<br />

throw new Exception("Error: " + p.get_errmsg());<br />

p.end_page_ext("");<br />

8.3 Table Formatting 237

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

Saved successfully!

Ooh no, something went wrong!