-
Notifications
You must be signed in to change notification settings - Fork 313
System.IndexOutOfRangeException : Index was outside the bounds of the array in Glyph.MergeContourEndPoints #954
Copy link
Copy link
Closed
Description
This error is happening quite often happening for various PDF documents. Here is an example:
broken_colour.pdf
Glyph.MergeContourEndPoints(IGlyphDescription glyph)
Glyph.Merge(IGlyphDescription glyph)
GlyphDataTable.ReadCompositeGlyph(TrueTypeDataBytes data, TemporaryCompositeLocation compositeLocation, Dictionary`2 compositeLocations, IGlyphDescription[] glyphs, IGlyphDescription emptyGlyph)
GlyphDataTable.ReadGlyphs()
Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
Lazy`1.CreateValue()
GlyphDataTable.get_Glyphs()
GlyphDataTable.TryGetGlyphBounds(Int32 glyphIndex, PdfRectangle& bounds)
TrueTypeFont.TryGetBoundingBox(Int32 characterCode, Func`2 characterCodeToGlyphId, PdfRectangle& boundingBox)
<4 more frames...>
ShowText.Run(IOperationContext operationContext)
BaseStreamProcessor`1.ProcessOperations(IReadOnlyList`1 operations)
ContentStreamProcessor.Process(Int32 pageNumberCurrent, IReadOnlyList`1 operations)
PageFactory.ProcessPage(Int32 pageNumber, DictionaryToken dictionary, NamedDestinations namedDestinations, MediaBox mediaBox, CropBox cropBox, UserSpaceUnit userSpaceUnit, PageRotationDegrees rotation, TransformationMatrix initialMatrix, IReadOnlyList`1 operations)
BasePageFactory`1.Create(Int32 number, DictionaryToken dictionary, PageTreeMembers pageTreeMembers, NamedDestinations namedDestinations)
Pages.GetPage[TPage](IPageFactory`1 pageFactory, Int32 pageNumber, NamedDestinations namedDestinations, ParsingOptions parsingOptions)
Pages.GetPage(Int32 pageNumber, NamedDestinations namedDestinations, ParsingOptions parsingOptions)
PdfDocument.GetPage(Int32 pageNumber)
To recreate it run the following code:
UglyToad.PdfPig.PdfDocument document = UglyToad.PdfPig.PdfDocument.Open("broken_colour.pdf");
Page page = document.GetPage(0);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels