HI, I have tried the
Code:
page.AddDocumentLink(new PdfRectangle(rect), pageRef);
It adds a link on the page, however, it the pageRef arguments only takes number starting from 2, but no matter how I change the pafRef argument(even from 2 ~1000), it always turns to page 4, there are 7 pages in total.
I am wondering maybe there are some errors with page referencing, or maybe I have to create sth like reference to the page?
Below is my code:
Code:
PdfPage full = document.AddPage();
full.Width = XUnit.FromInch(8.27);
full.Height = XUnit.FromInch(11.69);
gfx = XGraphics.FromPdfPage(full);
XRect link = new XRect(new PdfSharp.Drawing.XPoint(0, 0), new PdfSharp.Drawing.XPoint(200, 200));
PdfRectangle lin = new PdfRectangle(link);
full.AddDocumentLink(lin,100);