如何给生成的PDF文件加入书签
调用Acrobat的接口把多个PDF文档合并成一个PDF文档,并且要加入书签,现在合并没问题,不知道怎么加入书签,请教一下大家,谢谢。下面是部分代码:
public void mergePDFFiles(string inDirectiory, string outMergeFile, string[] fileList)
{
Acrobat.CAcroApp AcroApp = new Acrobat.AcroAppClass();
Acrobat.CAcroPDDoc PDDoc = new Acrobat.AcroPDDocClass();
Acrobat.CAcroPDDoc InsertPDDoc = new Acrobat.AcroPDDocClass();
int iNumberOfPagesToInsert;
int iLastPage;
if (!PDDoc.Create())
{
MessageBox.Show("Create PDF Error");
return;
}
for (int i = 0; i < 2; i++)
{
iLastPage = PDDoc.GetNumPages() - 1;
if (!InsertPDDoc.Open(inDirectiory + fileList[i]))
{
MessageBox.Show("Read Error");
return;
}
iNumberOfPagesToInsert = InsertPDDoc.GetNumPages();
if (!PDDoc.InsertPages(iLastPage, InsertPDDoc, 0, iNumberOfPagesToInsert, 0))
{
MessageBox.Show("Insert Pdf Error");
return;
}
if (!InsertPDDoc.Close())
{
MessageBox.Show("Close PDF Error");
return;
}
}
if (!PDDoc.Save(1, outMergeFile))
{
MessageBox.Show("Save PDF Error");
return;
}
if (!PDDoc.Close())
{
MessageBox.Show("Close PDF Error");
return;
}
}