2012-11-19 2 views
2

다른 페이지의 좌표로 점프하는 기존 PDF에 대한 링크를 추가하고 싶습니다. 내가 클릭 할 수있는 링크를 만들 비슷한 할 수있는 방법기존 PDF에 iTextSharp가있는 다른 페이지에 하이퍼 링크를 어떻게 삽입합니까?

PdfContentByte overContent = stamper.GetOverContent(1); 
iTextSharp.text.Rectangle rectangle = new Rectangle(10,10,100,100,0); 
rectangle.BackgroundColor = BaseColor.BLUE; 
overContent.Rectangle(rectangle); 
stamper.Close(); 

:이 코드를 사용하여 사각형을 추가 할 수 있어요

? 감사.

+0

허용되는 답변이나 기존 의견에 대한 의견을 표기하십시오. 귀하의 답변이 아닌 이유는 무엇입니까? – Sinatr

답변

1

이 내용은 "iText in Action - Second Edition"의 7 장에서 설명합니다. 더 구체적으로 http://kuujinbo.info/iTextInAction2Ed/index.aspx

: 당신은 C# 버전이 필요하면 http://itextpdf.com/examples/iia.php?id=150

이하는 여기에서 살펴 보시기 바랍니다 : 당신은 여기에서 예를 찾을 수의 수는이 코드 샘플 page에서 http://kuujinbo.info/iTextInAction2Ed/index.aspx?ch=Chapter07&ex=TimetableAnnotations2

PdfAnnotation annotation = PdfAnnotation.CreateLink(
    stamper.Writer, rect, PdfAnnotation.HIGHLIGHT_INVERT, 
    new PdfAction("http://itextpdf.com/") 
); 
stamper.AddAnnotation(annotation, page); 

입니다 링크를 추가하려는 페이지와 rect은 해당 페이지의 좌표를 정의하는 Rectangle 개체입니다.

관련 문제