Skip to content

Opening page of PDF document fails with font issue #1013

@vlko

Description

@vlko

Issue Description:

Opening page of PDF document fails with font issue.

Exception Details:

I can see two types of exception.
On page 2:

Could not find the font with name /F1 in the resource store. It has not been loaded yet.
   at UglyToad.PdfPig.Graphics.ContentStreamProcessor.ShowPositionedText(IReadOnlyList`1 tokens)
   at UglyToad.PdfPig.Graphics.ContentStreamProcessor.ProcessOperations(IReadOnlyList`1 operations)
   at UglyToad.PdfPig.Graphics.ContentStreamProcessor.Process(Int32 pageNumberCurrent, IReadOnlyList`1 operations)
   at UglyToad.PdfPig.Parser.PageFactory.Create(Int32 number, DictionaryToken dictionary, PageTreeMembers pageTreeMembers, NamedDestinations namedDestinations, InternalParsingOptions parsingOptions)
   at UglyToad.PdfPig.Content.Pages.GetPage(Int32 pageNumber, NamedDestinations namedDestinations, InternalParsingOptions parsingOptions)
   at UglyToad.PdfPig.PdfDocument.GetPage(Int32 pageNumber)
   at Program.<Main>$(String[] args) in C:\diera\#net\2025.03\PdfPigFontFailed\PdfPigTest\Program.cs:line 10

and on page 3 and 4:

Parsing not implemented for fonts of type: /CIDFontType2, please submit a pull request or an issue.
   at UglyToad.PdfPig.PdfFonts.FontFactory.Get(DictionaryToken dictionary)
   at UglyToad.PdfPig.Content.ResourceStore.LoadFontDictionary(DictionaryToken fontDictionary, InternalParsingOptions parsingOptions)
   at UglyToad.PdfPig.Content.ResourceStore.LoadResourceDictionary(DictionaryToken resourceDictionary, InternalParsingOptions parsingOptions)
   at UglyToad.PdfPig.Parser.PageFactory.Create(Int32 number, DictionaryToken dictionary, PageTreeMembers pageTreeMembers, NamedDestinations namedDestinations, InternalParsingOptions parsingOptions)
   at UglyToad.PdfPig.Content.Pages.GetPage(Int32 pageNumber, NamedDestinations namedDestinations, InternalParsingOptions parsingOptions)
   at UglyToad.PdfPig.PdfDocument.GetPage(Int32 pageNumber)
   at Program.<Main>$(String[] args) in C:\diera\#net\2025.03\PdfPigFontFailed\PdfPigTest\Program.cs:line 10

Attached Document:

document_with_failed_fonts.pdf

Steps to Reproduce:

Open document with PdfDocument.Open and then open pages

Sample Code to Reproduce the Issue:

PdfPigFontFailed.zip
Sample code output:

Opening document ...
Loading page 1
Error loading page 2: Could not find the font with name /F1 in the resource store. It has not been loaded yet.
Error loading page 3: Parsing not implemented for fonts of type: /CIDFontType2, please submit a pull request or an issue.
Error loading page 4: Parsing not implemented for fonts of type: /CIDFontType2, please submit a pull request or an issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions