Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 707

Previous Page 706   Index   Next Page 708

Function Reference
Page 707 of 750
Draw Mode
Description
dmFillClip
Tread the glyph outlines as path to be filled and add this path to the
current clipping path. The settings of the current line width and fill color
are used to paint the path.
dmStrokeClip
Tread the glyph outlines as path to be stroked and add this path to the
current clipping path. The settings of the current line width and stroke
color are used to paint the path.
dmFillStrokeClip
Tread the glyph outlines as path to be stroked and filled and add this path
to the current clipping path. The settings of the current line width, fill
color and stroke color are used to paint the path.
dmClipping
Tread the glyph outlines as path and add this path to the current clipping
path.
How to use text as clipping path?
As mentioned earlier the usage of text as clipping path is not the same as a normal clipping path. The
following example shows how a text can be used for clipping:
Example (C++):
#include "dynapdf.h"
using namespace DynaPDF;
// First we declare an error callback function.
SI32 PDF_CALL PDFError(const void* Data, SI32 ErrCode, const char*
ErrMessage, SI32 ErrType)
{
printf("%s\n", ErrMessage);
return 0; // We ignore non-fatal errors
}
int main(int argc, char* argv[])
{
void* pdf = pdfNewPDF();
if (!pdf) return 2; // Out of memory?
pdfSetOnErrorProc(pdf, NULL, PDFError);
// The document info entries are changed by the function if set
pdfSetDocInfo(pdf, diSubject, "Text as clipping path");
pdfSetDocInfo(pdf, diCreator, "C++ example test project");
pdfSetDocInfo(pdf, diTitle, "Text as clipping path");
pdfSetPageCoords(pdf, pcTopDown);
pdfCreateNewPDF(pdf, "c:/cppout.pdf");
pdfAppend(pdf);
 

Previous topic: SetTextDrawMode

Next topic: SetTextFieldValue