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.

Image Display 11.9<br />

Inserting a PDF Image with dlpdfimagecreatefrompdf<br />

/* Open the file <strong>and</strong> obtain the bounding box of page 0 */<br />

{<br />

PDDoc<br />

pdDoc;<br />

PDPage<br />

pdPage;<br />

ASFixedRect<br />

BB;<br />

/* Open the document */<br />

pdDoc = PDDocOpen ("Image.pdf", NULL, NULL, TRUE);<br />

pdPage = PDDocAcquirePage (pdDoc, 0);<br />

PDPageGetBBox (pdPage, &BB);<br />

PDPageRelease (pdPage);<br />

PDDocClose (pdDoc);<br />

Image = dlpdfimagecreatefrompdf (Doc, "Image.pdf",<br />

BB.right - BB.left,<br />

BB.top - BB.bottom,BB.left,BB.bottom,1);<br />

/* "Paste" the image into the container, centered over the<br />

* red box */<br />

dlpdfcontentreferenceimage (Content, Image,<br />

(fixedFour * 72) - ((Image->BBox.left + Image->BBox.right)/2),<br />

(fixedFour * 72) - ((Image->BBox.top + Image->BBox.bottom)/2),<br />

0, fixedOne, fixedOne);<br />

}

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

Saved successfully!

Ooh no, something went wrong!