diff --git a/src/UglyToad.PdfPig/Fonts/Type1/CharStrings/Type1CharStringParser.cs b/src/UglyToad.PdfPig/Fonts/Type1/CharStrings/Type1CharStringParser.cs index 846c454b..d41294a3 100644 --- a/src/UglyToad.PdfPig/Fonts/Type1/CharStrings/Type1CharStringParser.cs +++ b/src/UglyToad.PdfPig/Fonts/Type1/CharStrings/Type1CharStringParser.cs @@ -83,7 +83,8 @@ if (command == null) { - throw new InvalidOperationException($"Could not find command with code {b}."); + // Treat as invalid but skip + continue; } interpreted.Add(new Union.Case2(command)); diff --git a/src/UglyToad.PdfPig/Fonts/Type1/Parser/Type1CharstringDecryptedBytes.cs b/src/UglyToad.PdfPig/Fonts/Type1/Parser/Type1CharstringDecryptedBytes.cs index 99d88fb4..3e9a721e 100644 --- a/src/UglyToad.PdfPig/Fonts/Type1/Parser/Type1CharstringDecryptedBytes.cs +++ b/src/UglyToad.PdfPig/Fonts/Type1/Parser/Type1CharstringDecryptedBytes.cs @@ -34,5 +34,10 @@ Subroutine, Charstring } + + public override string ToString() + { + return $"{Name} {Source} {Index} {Bytes.Count} bytes"; + } } }