Migradoc Embedded Files #254
-
Hello, I call the The problem is that while the image and the text is there the hyperlink is not opening anything. It doesn't even look like a hyperlink (changing cursor and adding background, at least in firefox). The code I use is the following: _section.Document!.AddEmbeddedFile(file.FileId, tempFile);
var hyperlink = paragraph.AddHyperlinkToEmbeddedDocument(file.FileId);
var image = hyperlink.AddImage(PdfLogo);
image.Width = 32;
hyperlink.AddText("\n" + file.FileName); I open the pdf with notepad and I can see the embedded files section:
I can also see some annotations with the specified names.
Am I missing something from adding the links to the embedded document? ---Edit Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone looking for the same.
As mentioned in the comments:
The destinationPath must follow the Destination specification of the PDF file and target a specific Destination. If you have no specific destination, adding just a The correct way to open the document is: var hyperlink = paragraph.AddHyperlinkToEmbeddedDocument(file.FileId + "\\"); |
Beta Was this translation helpful? Give feedback.
For anyone looking for the same.
AddHyperlinkToEmbeddedDocument()
adds a hyperlink to a Destination (destinationPath
) of the Embedded document, and not the document itself.As mentioned in the comments: