| PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
| Links are missing after rendering to pdf https://forum.pdfsharp.net/viewtopic.php?f=2&t=968 |
Page 1 of 1 |
| Author: | MH_2106 [ Thu Dec 03, 2009 12:00 pm ] |
| Post subject: | Links are missing after rendering to pdf |
I have created a document with MigraDocs with several links. When i save the document to rtf i have all links, i have created in this document. After saving this file with following code to pdf, some links are gone: Code: PdfDocumentRenderer bsnRenderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always); bsnRenderer.Document = document; bsnRenderer.RenderDocument(); bsnRenderer.PdfDocument.Save(strFilename); (document is my MigraDoc.DocumentObjectModel.Document) I have two different locations of links: - In my header i have inserted four links to URLs. Three of them are working fine, the fourth is the last one in the line and there is only the text, but not the link. - I have 2 tables, which are printed in the document, which have a 1:n relation. To add some usability i gave the user a link from the parent record to navigate in the other printed table using a link. And all child record have also a link to the parent record. In the parent table all links are gone. In the child table only the first record has only the text and not the link, the following child records of one parent record have the link. How i said, using rtf format all links working correct, but i need this document as pdf. Are there some setting or anything else to affect links while rendering a pdf document? |
|
| Author: | Thomas Hoevel [ Thu Dec 03, 2009 1:53 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
Hi! You can create an MDDDL file from your document and check if all hyperlinks are there. If they are, then there likely is a problem during rendering. The MDDDL file would help us locate the problem. If they are not, then there probably is a problem while creating the document. See also here: http://www.pdfsharp.net/wiki/MigraDocDDL.ashx |
|
| Author: | MH_2106 [ Thu Dec 03, 2009 2:46 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
There are the Links. I have uploaded the 3 files, see above the links. It is the last link "zürich" which doesnt work! http://thcid-smokey.net/Test.pdf http://thcid-smokey.net/Test.rtf MDDL http://thcid-smokey.net/Test As you can see, i have the link correct in rtf and mddl, but not in pdf. |
|
| Author: | Thomas Hoevel [ Thu Dec 03, 2009 3:28 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
I didn't get the MDDDL file. Please check the link. |
|
| Author: | MH_2106 [ Thu Dec 03, 2009 3:40 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
Sorry - now it works! |
|
| Author: | Thomas Hoevel [ Thu Dec 03, 2009 4:02 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
I have the file, I can replicate the bug. I will look after it on Monday. |
|
| Author: | MH_2106 [ Wed Dec 09, 2009 5:37 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
Have you already done anything regarding this problem? Just saw there is a new release. |
|
| Author: | Thomas Hoevel [ Thu Dec 10, 2009 9:57 am ] |
| Post subject: | Re: Links are missing after rendering to pdf |
Hi! It's a bug and it's not yet fixed. The MDDDL contains Code: \hyperlink[Name = "www.google.de" Type = Web]{Zürich}\space(1) It works if there is text following the hyperlink. It also works if the hyperlink is at the end of line. I just dropped the "\space(1)" from the file and the link was there. Would you give me a code-snippet that creates the paragraph with this link? |
|
| Author: | Thomas Hoevel [ Thu Dec 10, 2009 10:17 am ] |
| Post subject: | Re: Links are missing after rendering to pdf |
Hi! This is not my area of expertise, but I guess the routine Code: void RenderSpace(Character character) in ParagraphRenderer.cs must call RealizeHyperlink(). Here is my changed version: Code: void RenderSpace(Character character) { XUnit width = GetSpaceWidth(character); this.RenderUnderline(width, false); this.RealizeHyperlink(width); this.currentXPosition += width; } Provided as is without any warranties ... |
|
| Author: | MH_2106 [ Fri Dec 11, 2009 5:28 pm ] |
| Post subject: | Re: Links are missing after rendering to pdf |
Great it works! Thank you very much! Still have the problem in my tables, but it is a bit hard to give you a file with it, because i am working with customer data...I try to fix it myself! |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|