目标:对话框加载pdf,并在打开对话框时就显示到指定的节点。
我的思路:
我创建了一个form,在form中添加组件c1FlexViewerPane,设置dock属性为fill。之后拖入一个C1PdfDocumentSource空间到这个form中,设置c1FlexViewerPane1的documentSource属性为c1PdfDocumentSource1。之后再load函数中加入代码
c1PdfDocumentSource1.LoadFromFile(strPdfFile);
OutlineNodeCollection ol = c1PdfDocumentSource1.Document.Outlines;
在shown函数中加入
c1FlexViewerPane1.NavigateToOutlineNode(ol[2]);
问题:
c1FlexViewerPane1.NavigateToOutlineNode(ol[2]);这个函数没有执行,显示的还是默认的第一页。跳转的节点时存在的,如果我在添加一个定时器,设置间隔为2秒,在timer的相应函数中加入c1FlexViewerPane1.NavigateToOutlineNode(ol[2]);,是可以完成跳转的。
如何完成加载到Pdf指定节点的功能?(打开pdf,跳转到指定节点)
|
|