DynaPDF Manual - Page 308

Previous Page 307   Index   Next Page 309

Function Reference
Page 308 of 839
int main(int argc, char* argv[])
{
SI32 pat1, pat2, pat3;
PPDF* pdf = pdfNewPDF();
if (!pdf) return 2; // Out of memory?
pdfSetOnErrorProc(pdf, NULL, PDFError);
pdfSetDocInfo(pdf, diSubject, "Standard hatch patterns");
pdfSetDocInfo(pdf, diCreator, "C example test project");
pdfSetDocInfo(pdf, diTitle, "Standard hatch patterns");
pdfSetPageCoords(pdf, pcTopDown);
pdfCreateNewPDF(pdf, "c:/cppout.pdf");
pdfAppend(pdf);
pat1 = pdfCreateStdPattern(pdf, spCross,2,8,PDF_RED,NO_COLOR);
pat2 = pdfCreateStdPattern(pdf, spDiaCross,1,4,PDF_BLUE,PDF_YELLOW);
pat3 = pdfCreateStdPattern(pdf, spDiaCross,1,4,PDF_BLUE,NO_COLOR);
pdfApplyPattern(pdf, pat1, cmFill, 0);
pdfApplyPattern(pdf, pat2, cmStroke, 0);
pdfSetLineWidth(pdf, 10.0);
pdfRectangle(pdf, 50, 50, 50, 50, fmFillStroke);
pdfApplyPattern(pdf, pat3, cmStroke, 0);
pdfRectangle(pdf, 120, 50, 50, 50, fmFillStroke);
pdfEndPage(pdf);
pdfCloseFile(pdf);
pdfDeletePDF(pdf); // Do not forget to delete the PDF instance
}
 

Previous topic: CreateStdPattern

Next topic: CreateStructureTree