PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Dec 09, 2024 9:30 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Aug 28, 2024 1:57 pm 
Offline

Joined: Wed Aug 28, 2024 1:03 pm
Posts: 1
In the footer I add an email link with page.AddWebLink(LINK).
LINK is something like "mailto:xxx@yyy.zz".
Clicking on this link, my Outlook opens perfectly. Everthing is perfect.
I'm using pdfsharp.dll version 1.51.5185.0.

Now I observe, that at the top of my pages, in a XRect the mouse cursor turns to the pointer as well as in the link at the end of the page.
The size of the XRect at the top has the same size as the XRect at the bottom.
However, on the top no text is visible.
It seems, that pdfsharp inserts my link twice: once at the bottom, once at the top.
I checked my XRect, no error found. No double call of page.AddWebLink(LINK) in my code.
The same problem was observed when I use page.AddFileLink(...);

Here the code as example:

Code:
for (int p = 0; p < doc.Pages.Count; p++)
{
    px = GetPositionLeft;
    py = GetPositionTop;
    email = "xxxx@yyyy.zz";
    using (XGraphics gfx = XGraphics.FromPdfPage(doc.Pages[p]))
    {
        [...]
        txt = email;
        width = gfx.MeasureString(txt, FontFooter).Width;
        txt = "mailto:" + email;
        XRect rect = new XRect(px, py, width, FontFooter.GetHeight());
        PdfRectangle rectLink = new PdfRectangle(rect);
        doc.Pages[p].AddFileLink(rectLink, txt );
        txt = email;
        gfx.DrawString(txt, FontLink, XBrushes.Blue, px, py, XStringFormats.TopLeft);
        [...]
    }
}


Any help is appreciated. Kind regards.


Attachments:
pdfsharpLinkProblem.jpg
pdfsharpLinkProblem.jpg [ 87.56 KiB | Viewed 13385 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group