'make a string an hyperlink in a c# printdocument object
I'm trying to create a basic printdocument object.
I have inserted some strings, pictures, lines, circles and rectangles. So far, so good.
My question is how can I transform a string into an hyperlink (above all, is it possible?) whenever I print this document as a PDF ? In other words, I would like to have this line of code clickable:
e.Graphics.DrawString("http://www.google.com", new Font("Arial", 12, FontStyle.Regular), Brushes.Blue, new Point(300, 100));
Thanks a lot for your hints and best wishes.
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Pen mygreenpen = new Pen(Brushes.Green);
Pen myyellowpen = new Pen(Brushes.Yellow);
Image photo = Image.FromFile(Application.StartupPath + @"\Test.jpg");
e.Graphics.DrawString("Welcome to Atlanta", new Font("Century Gothic", 12, FontStyle.Regular), Brushes.Blue, new Point(100, 100));
// How to make the link below clickable in an exported pdf ?
e.Graphics.DrawString("http://www.google.com", new Font("Arial", 12, FontStyle.Regular), Brushes.Blue, new Point(300, 100));
e.Graphics.FillRectangle(Brushes.Red, new Rectangle(500, 500, 100, 200));
e.Graphics.DrawImage(photo, 100, 400, 200, 200);
e.Graphics.DrawEllipse(mygreenpen, 300, 500, 100, 100);
e.Graphics.DrawRectangle(myyellowpen, 300, 1000, 200, 100);
e.Graphics.DrawLine(mygreenpen, 400, 900, 500, 1000);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
