DynaPDF Manual - Page 167

Previous Page 166   Index   Next Page 168

Function Reference
Page 167 of 839
Remarks:
This function is implemented in an Ansi and Unicode compatible version.
Please note that embedded files must be associated with a PDF object in PDF/A 3 files. See
AssociateEmbFile() for further information.
Return values:
If the function succeeds the return value is the handle of the embedded file, a value greater or equal
zero. If the function fails the return value is a negative error code.
AttachImageBuffer (Rendering Engine)
Syntax:
LBOOL rasAttachImageBuffer(
IRAS* RasPtr,
// Instance pointer of the rasterizer
BYTE** Rows,
// Pointer to a row buffer or alternatively
BYTE* Buffer,
// Pointer to an image buffer that was allocated
// as one large buffer.
UI32 Width,
// Width in Pixel
UI32 Height,
// Height in Pixel
SI32 ScanlineLen) // Scanline length in bytes
The function attaches a new image buffer to the rasterizer. The function supports two different types
or pointers to the image buffer depending on how the buffer was allocated.
When the image buffer was allocated as one large block then set the parameter Rows to NULL and
pass the buffer to the parameter Buffer. If the scanlines were allocated separately or in blocks then
use the parameter Rows instead. One of these parameters must be set but never both. The function
checks first whether the parameter Rows is present.
The rasterizer uses internally an array of scanlines to achieve optimal processing speed. Therefore,
the function must maybe reallocate the internal pointer array when the new image height is larger
than the previous one. When there is no sufficient memory to allocate the row pointer array then the
function will fail and returns false. The one and only reason why this function can fail is out of
memory.
The return value must not be ignored since the rasterizer will cause an access violation if you try to
raster into a non-existant image buffer.
The rasterizer requires no special alignment of the scanlines, the scanlines can be byte aligned.
However, the scaline length can be longer than necessary, e.g. to achieve aligment requirements of
certain image formats like Bitmaps. A negative value of the scanline length mirrors the image
vertically.
Remarks:
This function is not included in the Visual Basic 6 interface.
 

Previous topic: AttachFile, AttachFileEx

Next topic: AutoTemplate