how add a hyperlink in pdf page to page using itextsharp

独自空忆成欢 提交于 2019-12-11 19:38:26

问题


I want to add or create a hyperlink in bottom of the PDF page and it will redirecting to another page by using itextsharp. and next thing is for example if i have 50 pages PDF file. add 3 pages to it. and in 50th page i want 2 hyperlinks at bottom of the page. one to go for 51st page and another one to for 52nd page. next thing is if i am click back button in 51st page and 52nd page also it will come to 50th page.


回答1:


Using PdfAnnotation to create link

PdfAnnotation annotation;
                annotation = PdfAnnotation.CreateLink(
                stamper.Writer, rect, PdfAnnotation.HIGHLIGHT_INVERT,
                new PdfAction(string.Format(IMDB, screening.movie.Imdb))
              );
              stamper.AddAnnotation(annotation, page);

More details to refer this link

http://kuujinbo.info/iTextInAction2Ed/index.aspx?ch=Chapter07&ex=TimetableAnnotations2



来源:https://stackoverflow.com/questions/31107489/how-add-a-hyperlink-in-pdf-page-to-page-using-itextsharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!