📄 pdfdocumentinfo.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using AnotherPDFLib.PdfGraphics;
namespace AnotherPDFLib
{
/// <summary>
/// Document Information Dictionary
/// </summary>
public partial class PdfDocumentInfo : PdfDictionary
{
/// <summary>
/// The document's title.
/// </summary>
public string Title
{
get
{
PdfString title = this["Title"] as PdfString;
if (title != null)
{
return title.Value;
}
return String.Empty;
}
set
{
this["Title"] = new PdfString(value);
}
}
/// <summary>
/// The name of the person who created the document.
/// </summary>
public string Author
{
get
{
PdfString author = this["Author"] as PdfString;
if (author != null)
{
return author.Value;
}
return String.Empty;
}
set
{
this["Author"] = new PdfString(value);
}
}
/// <summary>
/// The subject of the document.
/// </summary>
public string Subject
{
get
{
PdfString subject = this["Subject"] as PdfString;
if (subject != null)
{
return subject.Value;
}
return String.Empty;
}
set
{
this["Subject"] = new PdfString(value);
}
}
/// <summary>
/// Keywords associated with the document.
/// </summary>
public string Keywords
{
get
{
PdfString keywords = this["Keywords"] as PdfString;
if (keywords != null)
{
return keywords.Value;
}
return String.Empty;
}
set
{
this["Keywords"] = new PdfString(value);
}
}
/// <summary>
/// If the document was converted to PDF from another format,
/// the name of the application(for example, Adobe FrameMaker) that created the original document
/// from which it was converted.
/// </summary>
public string Creator
{
get
{
PdfString creator = this["Creator"] as PdfString;
if (creator != null)
{
return creator.Value;
}
return String.Empty;
}
set
{
this["Creator"] = new PdfString(value);
}
}
/// <summary>
/// If the document was converted to PDF from another format,
/// the name of the application (for example, Acrobat Distiller) that converted it to PDF.
/// </summary>
public string Producer
{
get
{
PdfString producer = this["Producer"] as PdfString;
if (producer != null)
{
return producer.Value;
}
return String.Empty;
}
set
{
this["Producer"] = new PdfString(value);
}
}
/// <summary>
/// The date and time the document was created, in human-readable form.
/// </summary>
public DateTime CreationDate
{
get
{
PdfDateTime creationdate = this["CreationDate"] as PdfDateTime;
if (creationdate != null)
{
return creationdate.Value;
}
return DateTime.MinValue;
}
set
{
this["CreationDate"] = new PdfDateTime(value);
}
}
/// <summary>
/// The date and time the document was most recently modified, in human-readable form.
/// Required if PieceInfo is present in the document catalog; otherwise optional;
/// </summary>
public DateTime ModifiedDate
{
get
{
PdfDateTime modifieddate = this["ModDate"] as PdfDateTime;
if (modifieddate != null)
{
return modifieddate.Value;
}
return DateTime.MinValue;
}
set
{
this["ModDate"] = new PdfDateTime(value);
}
}
/// <summary>
/// whether the document has been modified to include trapping information
/// <remarks>
/// HasValue:
/// <list type="definition">
/// <item>
/// <term>True</term>
/// <description>The document has been fully trapped; no further trapping is needed.</description>
/// </item>
/// <item>
/// <term>False</term>
/// <description>The document has not yet been trapped; any desired trapping must still be done.</description>
/// </item>
/// <item>
/// <term>Unknown</term>
/// <description>Either it is unknown whether the document has been trapped or it has been partly but not yet fully trapped;
/// some additional trapping may still be needed.</description>
/// </item>
/// </list>
/// Default value: Unknown.
/// The value of this entry may be set automatically by the software creating the
/// document's trapping information, or it may be known only to a human operator
/// and entered manually.
/// </remarks>
/// </summary>
public HasValue Trapped
{
get
{
PdfName trapped = this["Trapped"] as PdfName;
if (trapped != null)
{
return (HasValue)Enum.Parse(typeof(HasValue), trapped.Name);
}
return default(HasValue);
}
set
{
this["Trapped"] = new PdfName(value.ToString());
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -