【发布时间】:2015-02-24 00:03:47
【问题描述】:
我在VS2008的C#项目的winForm中使用了Debenu PDFViewer。我想将附件保存在磁盘上。附件文件被保存,但方法的返回值为0(表示失败)。保存的文件无法在 Adobe Reader 上打开,并且弹出消息是这样的
有我的代码来加载pdf文件并保存附件文件。
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
axDPVActiveX1.OpenFile(openFileDialog1.FileName);
for (int i = 1; i <= axDPVActiveX1.DQPLEmbeddedFileCount(); i++)
{
if (axDPVActiveX1.DQPLGetEmbeddedFileStrProperty(i, 5).Contains(".pdf"))
{
if (axDPVActiveX1.DQPLGetEmbeddedFileContentToFile(i, @"C:\Users\userName\Desktop\Test folder\" + axDPVActiveX1.DQPLGetEmbeddedFileStrProperty(i, 5) == 1)
{
MessageBox.Show("Done!");
}
else
{
MessageBox.Show("Failed!");
}
MessageBox.Show(axDPVActiveX1.DQPLGetEmbeddedFileContentToString(i));
}
}
}
Would someone show me how to fix it. Thanks in advance.
【问题讨论】:
标签: c# pdf pdf-generation