mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
include raw dictionary token in the document information class #38
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Tokens;
|
||||
using Util.JetBrains.Annotations;
|
||||
|
||||
/// <summary>
|
||||
@@ -9,10 +11,15 @@
|
||||
public class DocumentInformation
|
||||
{
|
||||
internal static DocumentInformation Default { get; }
|
||||
= new DocumentInformation(null, null, null, null, null, null);
|
||||
= new DocumentInformation(null, null, null, null, null, null, null);
|
||||
|
||||
private readonly string representation;
|
||||
|
||||
/// <summary>
|
||||
/// The underlying document information PDF dictionary from the document.
|
||||
/// </summary>
|
||||
public DictionaryToken DocumentInformationDictionary { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The title of this document if applicable.
|
||||
/// </summary>
|
||||
@@ -49,8 +56,9 @@
|
||||
[CanBeNull]
|
||||
public string Producer { get; }
|
||||
|
||||
internal DocumentInformation(string title, string author, string subject, string keywords, string creator, string producer)
|
||||
internal DocumentInformation(DictionaryToken documentInformationDictionary, string title, string author, string subject, string keywords, string creator, string producer)
|
||||
{
|
||||
DocumentInformationDictionary = documentInformationDictionary ?? new DictionaryToken(new Dictionary<NameToken, IToken>());
|
||||
Title = title;
|
||||
Author = author;
|
||||
Subject = subject;
|
||||
@@ -67,7 +75,7 @@
|
||||
AppendPart("Creator", creator, builder);
|
||||
AppendPart("Producer", producer, builder);
|
||||
|
||||
representation = builder.ToString() ?? string.Empty;
|
||||
representation = builder.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -24,7 +24,7 @@
|
||||
var creator = GetEntryOrDefault(infoParsed, NameToken.Creator);
|
||||
var producer = GetEntryOrDefault(infoParsed, NameToken.Producer);
|
||||
|
||||
return new DocumentInformation(title, author, subject,
|
||||
return new DocumentInformation(infoParsed, title, author, subject,
|
||||
keywords, creator, producer);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user