Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

DynaPDF Manual - Page 151

Previous Page 150   Index   Next Page 152

Function Reference
Page 151 of 750
SI32 PDF_CALL PDFError(const void* Data, SI32 ErrCode, const char*
ErrMessage, SI32 ErrType)
{
printf("%s\n", ErrMessage);
return 0;
}
int main(int argc, char* argv[])
{
SI32 tmpl;
void* pdf = pdfNewPDF();
pdfSetOnErrorProc(pdf, NULL, (void*)PDFError);
pdfCreateNewPDF(pdf, "c:/cppout.pdf");
pdfSetPageCoords(pdf, pcTopDown);
pdfAppend(pdf);
tmpl=pdfBeginTemplate(pdf,pdfGetPageWidth(pdf),pdfGetPageHeight(pdf));
pdfSetFont(pdf, "Arial", fsItalic, 40, true, cp1252);
pdfWriteFText(pdf, taCenter, "This is a template!");
pdfEndTemplate(pdf);
pdfPlaceTemplate(pdf, tmpl, 0, 0, 0, 0);
pdfPlaceTemplate(pdf, tmpl, 0, 50, 500, 0);
pdfPlaceTemplate(pdf, tmpl, 0, 100, 450, 0);
pdfEndPage(pdf);
pdfCloseFile(pdf);
pdfDeletePDF(pdf);
}
Output:
This is a template!
This is a template!
This is a template!
 

Previous topic: BeginTemplate

Next topic: The Group's Bounding Box