Skip to content

Commit 5aa7afe

Browse files
committed
Bugfix from PDFsharp forum.
1 parent ad88b83 commit 5aa7afe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/PdfSharp/Drawing.Layout/XTextFormatter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ void CreateBlocks()
194194
blockLength = 0;
195195
_blocks.Add(new Block(BlockType.LineBreak));
196196
}
197+
// The non-breaking space is whitespace, so we treat it like non-whitespace.
197198
else if (ch != Chars.NonBreakableSpace && char.IsWhiteSpace(ch))
198199
{
199200
if (inNonWhiteSpace)

src/PdfSharp/Pdf/PdfDictionary.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,9 @@ public PdfItem GetValue(string key, VCF options)
818818
PdfArray array;
819819
PdfReference iref;
820820
PdfItem value = this[key];
821-
if (value == null)
821+
if (value == null ||
822+
value is PdfNull ||
823+
value is PdfReference && ((PdfReference)value).Value is PdfNullObject)
822824
{
823825
if (options != VCF.None)
824826
{

0 commit comments

Comments
 (0)