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.

Fig. 10.1<br />

Creating a complex<br />

page layout in logical<br />

structure order (left)<br />

and in visual order<br />

(right). The right variant<br />

uses item activation<br />

for the first section<br />

before continuing<br />

fragments 4 and 6.<br />

7<br />

1<br />

6<br />

5<br />

2 3<br />

4<br />

8<br />

1<br />

2<br />

5<br />

3<br />

4 6<br />

7<br />

8<br />

String optlist = "Title=Table parent=" + id_art;<br />

id_table = p.begin_item("Table", optlist);<br />

/* 5 create table structure and content */<br />

p.set_text_pos(x_start_table, y_start_table);<br />

...<br />

p.end_item(id_table);<br />

optlist = "Title=Insert parent=" + id_art;<br />

id_insert = p.begin_item("P", optlist);<br />

/* 6 create insert structure and content */<br />

p.set_text_pos(x_start_table, y_start_table);<br />

...<br />

p.end_item(id_insert);<br />

id_artifact = p.begin_item("Artifact", "");<br />

/* 7+8 create header and footer */<br />

p.set_text_pos(x_header, y_header);<br />

...<br />

p.set_text_pos(x_footer, y_footer);<br />

...<br />

p.end_item(id_artifact);<br />

/* article may be continued on next page(s) */<br />

...<br />

p.end_item(id_art);<br />

Generating page contents in visual order. The »logical order« approach forces the creator<br />

to construct the page contents in logical order even if it might be easier to create it<br />

in visual order: header, left column upper part, table, left column lower part, insert,<br />

right column, footer. Using activate_item( ) this ordering can be implemented as follows:<br />

/* create page layout in visual order */<br />

id_header = p.begin_item("Artifact", "");<br />

272 Chapter 10: PDF Versions and Standards (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!