PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Rendering hyperlink error - Value of 0 is not valid emsize
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3019
Page 1 of 1

Author:  Venkat0110 [ Mon Dec 29, 2014 7:38 pm ]
Post subject:  Rendering hyperlink error - Value of 0 is not valid emsize

I am getting the error when i try to render hyperlink in pdfdocument.

Error:

Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue.
Parameter name: emSize

Here is the code:
var pdfDoc = new PdfDocument();
var page1 = pdfDoc.AddPage();
var gfx1 = XGraphics.FromPdfPage(page1);

Document document = new Document();
var renderer = new DocumentRenderer(document);

Section section = document.AddSection();
Paragaragh para = section.AddParagraph();

var link = para.AddHyperlink(@"http://www.google.com/", HyperlinkType.Web);
link.AddText("Click Here");

renderer.RenderObject(gfx1, XUnit.FromPoint(50), XUnit.FromPoint(44), "6cm", para);

Author:  () => true [ Thu Jan 01, 2015 12:46 pm ]
Post subject:  Re: Rendering hyperlink error - Value of 0 is not valid emsi

Hi!

Thanks for showing some code.
But no information about the version you use.
An SSCCE would be better:
viewtopic.php?f=2&t=832

Any reasons for not using RenderDocument instead of RenderObject?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/