DynaPDF Manual - Page 353

Previous Page 352   Index   Next Page 354

Function Reference
Page 353 of 860
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
EnableImageCache (Rendering engine)
Syntax:
LBOOL pdfEnableImageCache(
const PPDF* IPDF,
// Instance pointer
UI32 MaxImageCount, // Maximum number of images to be cached
UI32 Size)
// Maximum cache size in bytes
The function creates an image cache that is used when rendering PDF pages. The maximum number
of images and the maximum cache size can be set independently of each other.
Caching can speed up rendering dramatically but caching can also slow down rendering if too
many images are in the cache. Therefore, the maximum number of images must be restricted. The
value should be between 256 and 1024 but not much higher.
The optimal cache size depends on the number of pages and whether the app is 32 or 64 bit. The
cache size can be large, e.g. up to 1 GB on 32 bit or 2 GB on 64 bit systems, if a document contains
only a few pages. Images are cached only if the system contains enough memory.
The size of the image cache should be around 30% of the entire cache size for rendered images. If the
full cache size is 1 GB, for example, then around 300 MB should be used for the image cache. Keep
all caches dynamic depending on the currently available memory.
The cache size is automatically reduced if the system has not sufficient memory.
The cache is always cleared when the PDF file in memory was closed or when FreePDF() was called.
In order to disable or delete the cache set MaxImageCount or Size to zero.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
EncryptPDF
Syntax:
SI32 pdfEncryptPDF(
const PPDF* IPDF,
// Instance pointer
const char* FileName,
// File to encrypt
const char* OpenPwd,
// Open password (user password)
const char* OwnerPwd,
// Owner password
TKeyLen KeyLen,
// Key length for RC4 encryption
TRestrictions Restrict) // Restrictions
This function encrypts a PDF file. The input file must be unencrypted or no open password must be
set and the property SetUseExactPwd() must be set to false. The file is recompressed during import;
this reduces the file size in most cases.
 

Previous topic: EditTemplate2, Ellipse

Next topic: EndContinueText (obsolete), EndLayer, EndPage, EndPattern, EndTemplate