DynaPDF Manual - Page 198

Previous Page 197   Index   Next Page 199

Function Reference
Page 198 of 821
{
pdfFreePDF(PDF);
return -2;
}
pdfCloseFile(PDF);
}
TPDFError msg;
msg.StructSize = sizeof(msg);
SI32 e, errMsgCount = pdfGetErrLogMessageCount(PDF);
for (e = 0; e < errMsgCount; e++)
{
pdfGetErrLogMessage(PDF, e, &msg);
printf("Error: %s\n", msg.Message);
}
return 0;
}
int main(int argc, char* argv[])
{
// Process as many files as possible with one instance
void* pdf = pdfNewPDF();
if (!pdf) return -3; // Out of memory?
pdfSetOnErrorProc(pdf, NULL, PDFError);
pdfSetLicenseKey(pdf, "...");
// Not required but strongly recommended. External CMaps should be available when converting
// imported PDF files. The files are only loaded if necessary.
// Use an absolute path if possible! Otherwise the CMaps cannot be loaded if the working
// directory was changed.
pdfSetCMapDir("c:/MyAppPath/Resource/CMap/", TLoadCMapFlags(lcmDelayed | lcmRecursive));
SI32 retval = PDFToPDFA(pdf, "c:/test.pdf", "c:/cppout.pdf");
pdfDeletePDF(pdf);
return retval;
}
 

Previous topic: Return values

Next topic: CheckFieldNames


Start Chat