描述:
请问用VC如何读取PDF文件中的内容,最好有代码例子。谢谢!!
解决方案1:
PDF SDK有一个例子--AddImage,该例子生产一个dll,放在Acrobat的安装目录下,然后启动Acrobat,就看到多了一个菜单项“AddImage”,就可以调用AddImage了。我的问题是:如何不生成dll给Acrobat调用,而是直接运行AddImage的功能?
解决方案2: 这个问题我也不是太了解
帮斑竹顶
应该是使用PDF LIB吧
不过有些函数无法调用
郁闷
不知道Google如何处理PDF的
google搜索出pdf后,可以不用查看pdf,google提供了一个“一般文件档案”的连接
可以直接查看文字信息
下载免费开发包http://partners.adobe.com/asn/acrobat/sdk/fdftk/FDFToolkitForWindows.zip
解决方案5: void CPDFAppDlg::OnConvert()
{
// TODO: Add your control notification handler code here
try
{
int iFont;
PDFlib pPDF;
CFileDialog m_FileDlg(FALSE,"pdf","",OFN_OVERWRITEPROMPT,"Adobe Acrobat PDF 文件(*.pdf)|*.pdf|所有文件(*.*)|*.*||",this);
char pFileName[255];
CEdit* pPDFText=(CEdit*)GetDlgItem(IDC_EDITPDF);
CString strPDFText;
pPDFText->GetWindowText(strPDFText);
char pPDFInfo[1024];
sprintf(pPDFInfo,"%s",strPDFText);
char pAttachFileName[255];
sprintf(pAttachFileName,"%s",m_AttachFileName);
if(m_FileDlg.DoModal()==IDOK)
{
m_PDFFileName=m_FileDlg.GetFileName();
sprintf(pFileName,m_PDFFileName);
if(pPDF.open_file(pFileName)==-1)
{
//
}
pPDF.set_parameter("hypertextencoding","host");
pPDF.set_info("Creator","DigitalSky");
pPDF.set_info("Author","DigitalTitan");
pPDF.set_info("Title","Title");
pPDF.begin_page((float)a4_width,(float)a4_height);
iF />
pPDF.setfont(iFont,12);
pPDF.set_text_pos(50,a4_height-50);
pPDF.setcolor("fill","rgb",0,0,1,0);
pPDF.show("Version 1.0 (C) CopyRight By Digitaltitan");
iF />
pPDF.setcolor("fill","rgb",0,0,0,0);
pPDF.setfont(iFont,24);
pPDF.continue_text("转换文档生成为");
pPDF.setcolor("stroke","rgb",0.24f,0.51f,0.047f,0);
pPDF.moveto(50,a4_height-80);
pPDF.lineto(a4_width-50,a4_height-80);
pPDF.moveto(50,a4_height-78);
pPDF.lineto(a4_width-50,a4_height-78);
pPDF.stroke();
pPDF.attach_file(a4_width-50,0,0,a4_height-90,pAttachFileName,"DigitalSky","DigitalTitan","doc","paperclip");
pPDF.set_text_pos(50,a4_height-100);
iF />
pPDF.setcolor("fill","rgb",0,0,0,0);
pPDF.setfont(iFont,12);
pPDF.continue_text(pPDFInfo);
//Word文件如何导入?
pPDF.end_page();
pPDF.close();
}
}
catch(PDFlib::Exception &ex)
{
//
}
}