Free Support Forum -

XPS to PDF conversion causes links to not display correctly

I’m trying to use Aspose.Pdf to convert an Outlook mail message into a PDF using an intermediate XPS document. The code:

private void CreatePdf(MapiMessage message, string outputFilePath)
var tempFilePath = Path.GetTempFileName();
using (var tempFileStream = File.Create(tempFilePath, 4096, FileOptions.DeleteOnClose))
var mi = MailMessageInterpretorFactory.Instance.GetIntepretor(message.MessageClass);
var mm = mi.Interpret(message);

var printer = new MailPrinter() { FormattingFlags = MessageFormattingFlags.MailInfo };
printer.Print(mm, tempFileStream, PrintFormat.XPS);

tempFileStream.Position = 0;

var document = new Aspose.Pdf.Document(tempFileStream, new XpsLoadOptions());

using (var fs = File.OpenWrite(outputFilePath))

Which produces the attached files for the temporary XPS and final PDF. You will notice that places where links should exist in the PDF show no text, but there is a clickable region that launches the appropriate URL. The intermediate XPS looks correct.

Hi Barry,

Thanks for using our products.

I have tested the scenario using Aspose.Pdf for .NET 7.5.0 and I am able to reproduce the same problem. However when I have tested this scenario with upcoming release version of Aspose.Pdf for .NET 7.6.0, the problem does not seem to be occurring. I would suggest you to please be patient and wait for the new release version which is under testing phase and we plan to release it in current week.

For your reference, I have also attached the output PDF file which I have generated with v7.6.0. Once this new version becomes available, we will update you within this forum thread. We are sorry for this inconvenience.

Hi Barry,

I am pleased to share that Aspose.Pdf for .NET 7.6.0 has been released. Please try using the latest release version and in case you encounter any issue or you have any further query, please feel free to contact.