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.

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

dlpdfimagecreatefromfile<br />

This method invokes various conversion routines to allow a user to simply specify the<br />

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

file name <strong>and</strong> obtain a valid DLPDFIMAGE object. All conversions are done internally<br />

to <strong>DLI</strong>.<br />

NOTE: The public-domain graphic-conversion libraries used on Unix <strong>and</strong> Windows<br />

are not available on OS/390 <strong>and</strong> OS/400 platforms. Consequently some image<br />

creation procedures are not available under OS/390 <strong>and</strong> OS/400.<br />

This method accepts only 2 parameters:<br />

• a h<strong>and</strong>le to a document in which the image is to be placed<br />

• a file name which should contain the image<br />

Currently, this method will support JPEG/JPG, GIF, TIFF, PNG <strong>and</strong> PDF files on the<br />

NT <strong>and</strong> UNIX platforms, <strong>and</strong> PDF only on OS/390.<br />

From the complete <strong>DLI</strong> sample of inserting graphic images, this segment inserts a PDF<br />

image via dlpdfimagecreatefromfile:<br />

"C" Example: Inserting a PDF image with dlpdfimagecreatefromfile<br />

Image = dlpdfimagecreatefromfile (Doc, "math.pdf");<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 />

The DLPDFIMAGE objects contains an ASFixedRect object called BBox (Bounding<br />

Box), which is set to the actual size <strong>and</strong> displacement of the image, as defined by its<br />

originator. This may be used in decisions about positioning <strong>and</strong> scaling the image.

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

Saved successfully!

Ooh no, something went wrong!