diff --git a/README.md b/README.md index 989f9914..4947fd35 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,10 @@ The ```PdfDocument``` provides access to the document metadata as ```DocumentInf PdfDocument document = PdfDocument.Open(fileName); // The name of the program used to convert this document to PDF. - string producer = document.DocumentInformation.Producer; + string producer = document.Information.Producer; // The title given to the document - string title = document.DocumentInformation.Title; + string title = document.Information.Title; // etc... ### Page ### @@ -61,7 +61,7 @@ The ```Page``` contains the page width and height in points as well as mapping t ### Letter ### -Due to the way a PDF is structured internally the page text may not be a readable representation of the page text. Since PDF is a presentation format, text can be drawn in any order, not necessarily reading order. This means spaces may be missing or words may be in unexpected positions in the text. +Due to the way a PDF is structured internally the page text may not be a readable representation of the text as it appears in the document. Since PDF is a presentation format, text can be drawn in any order, not necessarily reading order. This means spaces may be missing or words may be in unexpected positions in the text. To help users resolve actual text order on the page, the ```Page``` file provides access to a list of the letters: diff --git a/src/UglyToad.Pdf.Tests/Integration/LocalTests.cs b/src/UglyToad.Pdf.Tests/Integration/LocalTests.cs new file mode 100644 index 00000000..561da8b1 --- /dev/null +++ b/src/UglyToad.Pdf.Tests/Integration/LocalTests.cs @@ -0,0 +1,15 @@ +namespace UglyToad.Pdf.Tests.Integration +{ + using Xunit; + + /// + /// A class for testing files which are not checked in to source control. + /// + public class LocalTests + { + [Fact] + public void Tests() + { + } + } +} diff --git a/src/UglyToad.Pdf/Fonts/Cmap/CharacterMapBuilder.cs b/src/UglyToad.Pdf/Fonts/Cmap/CharacterMapBuilder.cs index c83adb66..9b50ea80 100644 --- a/src/UglyToad.Pdf/Fonts/Cmap/CharacterMapBuilder.cs +++ b/src/UglyToad.Pdf/Fonts/Cmap/CharacterMapBuilder.cs @@ -95,6 +95,8 @@ return new CharacterIdentifierSystemInfo(SystemInfoBuilder.Registry, SystemInfoBuilder.Ordering, SystemInfoBuilder.Supplement); } + return CharacterIdentifierSystemInfo; + throw new InvalidOperationException("The Character Identifier System Information was never set."); } diff --git a/src/UglyToad.Pdf/Fonts/Simple/TrueTypeSimpleFont.cs b/src/UglyToad.Pdf/Fonts/Simple/TrueTypeSimpleFont.cs index fe828a77..a9a03551 100644 --- a/src/UglyToad.Pdf/Fonts/Simple/TrueTypeSimpleFont.cs +++ b/src/UglyToad.Pdf/Fonts/Simple/TrueTypeSimpleFont.cs @@ -68,7 +68,14 @@ var encodedCharacterName = encoding.GetName(characterCode); // Look up the character name in the Adobe Glyph List. - value = GlyphList.AdobeGlyphList.NameToUnicode(encodedCharacterName); + try + { + value = GlyphList.AdobeGlyphList.NameToUnicode(encodedCharacterName); + } + catch + { + return false; + } return true; } diff --git a/src/UglyToad.Pdf/Fonts/Simple/Type1Font.cs b/src/UglyToad.Pdf/Fonts/Simple/Type1Font.cs index 8e344f86..5522b2cd 100644 --- a/src/UglyToad.Pdf/Fonts/Simple/Type1Font.cs +++ b/src/UglyToad.Pdf/Fonts/Simple/Type1Font.cs @@ -1,5 +1,6 @@ namespace UglyToad.Pdf.Fonts.Simple { + using System; using Cmap; using Composite; using Core; @@ -58,7 +59,14 @@ var name = encoding.GetName(characterCode); - value = GlyphList.AdobeGlyphList.NameToUnicode(name); + try + { + value = GlyphList.AdobeGlyphList.NameToUnicode(name); + } + catch + { + return false; + } return true; }