22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

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.

7.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />

"C" Example: Container with Scale<br />

void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />

userdata *UserData)<br />

{<br />

Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />

DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />

DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />

}<br />

dlpdfcontentscale (Content,<br />

FloatToFixed (1/ 1000),<br />

FloatToFixed (1/10));<br />

USERDATA *UserWork = UserData;<br />

while (UserWork)<br />

{<br />

WriteLine (UserWork, Content);<br />

UserWork = UserWork->next;<br />

}<br />

dlpdfcontenttopage (Content, Page);<br />

Inversion<br />

This case assumes that the data in your text is based on the upper right h<strong>and</strong> corner of<br />

the page. Scale factors remain as for the previous example. Note that in the data<br />

writing routine, all vertical positions must be inverted: e.g. something placed at 4<br />

points below the top of the page would be specified to <strong>DLI</strong> as -4.<br />

"C" Example: Container Moved to Top of Page<br />

void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />

userdata *UserData)<br />

{<br />

DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />

DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />

}<br />

dlpdfcontenttranslate (Content, 0, Depth);<br />

dlpdfcontentscale (Content,<br />

FloatToFixed (1/ 1000),<br />

FloatToFixed (1/10));<br />

userdata *UserWork = UserData;<br />

while (UserWork)<br />

{<br />

WriteLine (UserWork, Content);<br />

UserWork = UserWork->next;<br />

}<br />

dlpdfcontenttopage (Content, Page);

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

Saved successfully!

Ooh no, something went wrong!