diff --git a/src/UglyToad.PdfPig/Parser/PageContentParser.cs b/src/UglyToad.PdfPig/Parser/PageContentParser.cs index 87f0cb52..e6a8e5f5 100644 --- a/src/UglyToad.PdfPig/Parser/PageContentParser.cs +++ b/src/UglyToad.PdfPig/Parser/PageContentParser.cs @@ -94,7 +94,7 @@ throw new InvalidOperationException($"Failed to read expected buffer length {gap} on page {pageNumber} " + $"when reading inline image at offset in content: {lastEndImageOffset.Value}."); } - + // Replace the last end image operator with one containing the full set of data. graphicsStateOperations.Remove(lastEndImage); graphicsStateOperations.Add(new EndInlineImage(lastEndImage.ImageData.Concat(missingData).ToArray())); @@ -142,6 +142,13 @@ graphicsStateOperations.Add(newEndInlineImage); lastEndImageOffset = scanner.CurrentPosition - 3; } + else if (op.Data == "inf") + { + // Value representing infinity in broken file from #467. + // Treat as zero. + precedingTokens.Add(NumericToken.Zero); + continue; + } else { log.Warn($"Operator which was not understood encountered. Values was {op.Data}. Ignoring.");