DynaPDF Manual - Page 210

Previous Page 209   Index   Next Page 211

Function Reference
Page 210 of 839
This function marks the current path as clipping path. The function must be called after a closable
path was created. A path that consists of a MoveTo() and LineTo() only call cannot be closed!
A clipping path can also be filled, stroked, or both in one pass. However, the combination of a
clipping path operator with a path painting operator is seldom used and not supported in all PDF
viewers. To avoid unnecessary problems a path should always be clipped and painted in two
separate steps, also if this causes some unnecessary overhead.
Once the clipping was created and activated with ClipPath() you can draw arbitrary contents into it,
such as images, text, or vector graphics.
A clipping path is part of the current graphics state. The only way to deactivate a clipping path is to
restore the graphics state with RestoreGraphicState(). This assumes that it was saved with
SaveGraphicState() before the clipping path was created.
Note that it is not possible to extend or widen an active clipping path. It is only possible to intersect
it with a new one. The intersection of two clipping paths is never larger than the initial clipping
path.
Remarks:
Text objects are handled separately in PDF for use as clipping path. See SetTextDrawMode() for
further information.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
CloseAndSignFile
Syntax:
SI32 pdfCloseAndSignFile(
const PPDF* IPDF,
// Instance pointer
const char* CertFile, // File path to a PKCS#12 certificate file
const char* Password, // Password to decrypt the cert's private key
const char* Reason,
// Optional reason string
const char* Location) // Optional signers location string
This function finishes the PDF file, digitally signs it, and frees all used resources if the file was not
created in memory. The parameter CertFile must be a valid path to a PKCS#12 certificate file.
DynaPDF signs PDF files on Windows with the Windows Crypt API. This signature handler
supports certificates with up to 4096 bits key length.
On non-Windows systems the function uses the AiCrpyto library to sign PDF files. This signature
handler supports certificates with up to 1024 bits key lengths only. However, if certificates with a
stronger encryption should be used it is possible to sign the file with an external signature handler
(see CloseAndSignFileExt() for further information).
 

Previous topic: ClearErrorLog, ClearHostFonts, ClipPath

Next topic: Importing signed PDF files, Possible function errors