var hasBookmarks = document.TryGetBookmarks(out Bookmarks bookmarks);
I found another problem.
So I am using Unity, and with the nuget package I can get PDFPig to run well. However when I build for WebGL I get the error
"InvalidOperationException: Could not find AFM resource with name: UglyToad.PdfPig.Fonts.Resources.AdobeFontMetrics.Courier-Bold.afm."
Since I did not had source code I couldn't find the reason and though it was because WebGL was not loading the file properly.
I put the source files of PDFPig into Unity without errors and to what I believe works well and now I get the same error in the Editor.
I don't know why this does not happen in the editor with the nuget version. However as I am running in the editor I got a better look at the error.
UglyToad.PdfPig.Fonts.Standard14Fonts.Standard14.AddAdobeFontMetrics (System.String fontName, System.String afmName, System.Nullable`1[T] type) (at Assets/Scripts/PDFPig/UglyToad.PdfPig.Fonts/Standard14Fonts/Standard14.cs:120)
Rethrow as InvalidOperationException: Could not load Courier-Bold from the AFM files.
The file is at \UglyToad.PdfPig.Fonts\Resources\AdobeFontMetrics\Courier-Bold.afm
I can provide the unity project if needed. Anyone have a clue?