64,666
社区成员
发帖
与我相关
我的任务
分享
try
{
PDFlib pdf;
// 设置兼容参数
pdf.set_parameter("compatibility", "1.4"); // 兼容Acrobat 5
// 打开文档
if(pdf.open("cfc.pdf") == -1)
throw("打开文件出错!");
// 设置文档信息
pdf.set_info("Creator", "PDF Creator");
pdf.set_info("Author", "kiwi");
pdf.set_info("Title", "Convert to PDF");
pdf.set_info("Subject", "PDF Creator");
pdf.set_info("Keywords", "hello");
// do something here
pdf.close();// 关闭PDF文件
}
catch(PDFlib::Exception &ex)
{
// cerr << "错误信息:" << ex.get_message() << endl;
TRACE0(ex.get_message());
AT_ASSERT(0);
}
catch(char *pStrErr)
{
// cerr << pStrErr << endl;
TRACE0(pStrErr);
AT_ASSERT(0);
}
catch(...)
{
// cerr << "发生未知异常!" << endl;
AT_ASSERT(0);
}