Hi All,
As the documentation is a "bit" missing in most of the core of PDFSharp, I couldnt get the gfx.PdfPage.AddWebLink(PDFRectangle, url) to work.
The solution was not in this forum, and therefore after several tries, and drawing lots of rectangles, I realized it uses the normal coordinate system, as it does native in PDF.
And not like anywhere else in PDFSharp, where the GDI-coordinate-system is used.
So I you want to add a WebLink, FileLink or DocumentLink , you have to "invert" the Y-position like this :
Code:
double height = PdfSharp.PageSizeConverter.ToSize((PdfSharp.PageSize)m_CurrentPDFPage.Size).Height;
PdfSharp.Pdf.PdfRectangle rc = new PdfSharp.Pdf.PdfRectangle(new PdfSharp.Drawing.XPoint(position.X, height - position.Y), new PdfSharp.Drawing.XPoint(position.X + size.Width, height - (position.Y + size.Height)));
gfx.PdfPage.AddWebLink(rc, url);