using Aspose; using Aspose.Pdf; using Aspose.Pdf.InteractiveFeatures.Annotations; using Aspose.Pdf.InteractiveFeatures; ......
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(_pdfFilePath); ImagePlacementAbsorberabs = new ImagePlacementAbsorber(); //查找图片 foreach (ImagePlacement imagePlacement in abs.ImagePlacements) { XImage image = imagePlacement.Image; } //创建超链接 LinkAnnotation link = new LinkAnnotation(page, new Aspose.Pdf.Rectangle(imagePlacement.Rectangle.URX - 175, imagePlacement.Rectangle.URY - 90, imagePlacement.Rectangle.URX + 4, imagePlacement.Rectangle.URY + 3)); link.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Empty); //创建透明外框 link.Border = new Border(link); link.Border.Style = BorderStyle.Solid; link.Border.Effect = BorderEffect.None; link.Border.Width = 0; link.Action = new GoToRemoteAction(@"..\..\test.pdf", 1); //连接到其他文件 //link.Action = new Aspose.Pdf.InteractiveFeatures.GoToURIAction("www.google.com"); //网址超链接 page.Annotations.Add(link);
原文地址:http://116833.blog.51cto.com/106833/1613081