The following exception appears when I add a bookmark to an existing PDF (see the image) using PDFSharp-gdi version 1.50.5147
Here is the link to the PDF I am trying to add outlines:
https://we.tl/t-yVUeVKIG1hCode:
using System;
using PdfSharp;
using PdfSharp.Drawing;
using PdfSharp.Pdf;
using PdfSharp.Pdf.IO;
using PdfSharp.Fonts;
using System.Diagnostics;
namespace Bookmarks
{
class Program
{
static void Main(string[] args)
{
string file = "C:\\temp\\1\\A101.pdf";
string accountNumber = "001234";
using (PdfDocument doc = PdfReader.Open(file, PdfDocumentOpenMode.Modify))
{
PdfPage page = doc.Pages[0];
doc.Outlines.Add(accountNumber, page);
doc.Save(file);
}
}
}
}