PdfSharpCore icon indicating copy to clipboard operation
PdfSharpCore copied to clipboard

Hyperlinks removed when combining PDF's

Open vsosinga opened this issue 3 years ago • 1 comments

Version 1.3.41

Problem When combining 1 or more PDF documents containing hyperlinks into a new PDF document the links are not clickable in the new document. Only links containing https:// are still clickable.

// Open the output document
var outputDocument = new PdfDocument();

// Open the document to import pages from it.
var inputDocument = PdfReader.Open(<input file>, PdfDocumentOpenMode.Import);

// Iterate pages
var count = inputDocument.PageCount;
for (var idx = 0; idx < count; idx++)
{
    // Get the page from the external document...
    var page = inputDocument.Pages[idx];

    // ...and add it to the output document.
    outputDocument.AddPage(page);
}

outputDocument.Save(<output file>);

Input: hyperlinks.pdf Output output.pdf

vsosinga avatar Nov 17 '22 12:11 vsosinga

Is there an update on this?

ricardoschroeder avatar Feb 12 '25 13:02 ricardoschroeder