DynaPDF Manual - Page 823

Previous Page 822   Index   Next Page 824

Function Reference
Page 823 of 839
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;
}
int main(int argc, char* argv[])
{
double alpha = 0.0;
double y, pageCenter;
SI32 i;
void* pdf = pdfNewPDF();
if (!pdf) return 2; // Out of memory?
pdfSetOnErrorProc(pdf, NULL, PDFError);
pdfSetPageCoords(pdf, pcTopDown);
pdfCreateNewPDF(pdf, "c:/cppout.pdf");
pdfAppend(pdf);
pdfSetFont(pdf, "Arial", fsNone, 20.0, true, cp1252);
pageCenter = pdfGetPageWidth(pdf) / 2.0;
y = -(20.0 + pdfGetDescent(PDF)) / 2.0; // Font size + descent
for (i = 0; i < 12; i++)
{
pdfSetFillColor(pdf, (0x00C08080 | ((SI32)alpha) << 6));
pdfWriteAngleText(pdf,"Circular Text",alpha,pageCenter,300,24,y);
alpha += 30.0;
}
pdfEndPage(pdf);
pdfCloseFile(pdf);
}
Output:
Circular Text
 

Previous topic: WriteAngleText

Next topic: WriteFText, Output rectangle