📄 pdfcatalog.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using AnotherPDFLib.PdfGraphics;
namespace AnotherPDFLib
{
/// <summary>
/// The root of a document's object hierarchy is the catalog dictionary,
/// located by means of the Root entry in the trailer of the PDF file.
/// </summary>
public partial class PdfCatalog : PdfDictionary
{
public PdfCatalog() : base("Catalog")
{
}
/// <summary>
/// The page tree node that is the
/// root of the document's page tree.
/// </summary>
public PdfPageTree Pages
{
get
{
return this["Pages"] as PdfPageTree;
}
set
{
this["Pages"] = value;
}
}
/// <summary>
/// The version of the PDF specification to which the document conforms
/// if later than the version specified in the file's header.
/// This entry enables a PDF producer application to update the version using an incremental update.
/// (The value of this entry is a name object,for example, /1.4)
/// </summary>
public string Version
{
get
{
PdfName version = this["Version"] as PdfName;
if (version != null)
{
return version.Value;
}
return String.Empty;
}
set
{
this["Version"] = new PdfName(value);
}
}
/// <summary>
/// the page layout to be used when the document is opened
/// </summary>
public PageLayout PageLayout
{
get
{
PdfName pagelayout = this["PageLayout"] as PdfName;
if (pagelayout != null)
{
return (PageLayout)Enum.Parse(typeof(PageLayout), pagelayout.Name);
}
return default(PageLayout);
}
set
{
this["PageLayout"] = new PdfName(value.ToString());
}
}
/// <summary>
/// specifying how the document should be displayed when opened
/// </summary>
public PageMode PageMode
{
get
{
PdfName pagemode = this["PageMode"] as PdfName;
if (pagemode != null)
{
return (PageMode)Enum.Parse(typeof(PageMode), pagemode.Name);
}
return default(PageMode);
}
set
{
this["PageMode"] = new PdfName(value.ToString());
}
}
/// <summary>
/// The document's outline hierarchy
/// </summary>
public PdfOutline Outlines
{
get
{
return this["Outlines"] as PdfOutline;
}
set
{
this["Outlines"] = value;
}
}
/// <summary>
/// The way the document is to be displayed on the screen.
/// If this entry is absent, applications should use their own
/// current user preference settings.
/// </summary>
public ViewerPreferences ViewerPreferences
{
get
{
return this["ViewerPreferences"] as ViewerPreferences;
}
set
{
this["ViewerPreferences"] = value;
}
}
/// <summary>
/// A number tree defining the page labeling for the document.
/// The keys in this tree are page indices;
/// the corresponding values are page label dictionaries.
/// Each page index denotes the first page in a
/// labeling range to which the specified page label dictionary applies.
/// The tree must include a value for page index 0.
/// </summary>
public PdfPageLabels PageLabels
{
get
{
return this["PageLabels"] as PdfPageLabels;
}
set
{
this["PageLabels"] = value;
}
}
/// <summary>
/// The document's interactive form (AcroForm) dictionary.
/// </summary>
public PdfAcroForm AcroForm
{
get
{
return this["AcroForm"] as PdfAcroForm;
}
set
{
this["AcroForm"] = value;
}
}
/// <summary>
/// A metadata stream containing metadata for the document.
/// </summary>
public MetadataStream Metadata
{
get
{
return this["Metadata"] as MetadataStream;
}
set
{
this["Metadata"] = value;
}
}
/// <summary>
/// The document's name dictionary.
/// </summary>
public PdfDictionary Names
{
get
{
return this["Names"] as PdfDictionary;
}
set
{
this["Names"] = value;
}
}
/// <summary>
/// A dictionary of names and corresponding destinations.
/// </summary>
public PdfDictionary Dests
{
get
{
return this["Dests"] as PdfDictionary;
}
set
{
this["Dests"] = value;
}
}
/// <summary>
/// An array of thread dictionaries representing the document's article threads.
/// </summary>
public PdfArray Threads
{
get
{
return this["Threads"] as PdfArray;
}
set
{
this["Threads"] = value;
}
}
/// <summary>
/// A value specifying a destination to be displayed or an
/// action to be performed when the document is opened. The value is either
/// an array defining a destination or
/// an action dictionary representing an action. If
/// this entry is absent, the document should be opened to the top of the
/// first page at the default magnification factor.
/// </summary>
public PdfAction OpenAction
{
get
{
return this["OpenAction"] as PdfAction;
}
set
{
this["OpenAction"] = value;
}
}
/// <summary>
/// An additional-actions dictionary defining the actions
/// to be taken in response to various trigger events affecting the document
/// as a whole.
/// </summary>
public PdfDictionary AdditionalActions
{
get
{
return this["AA"] as PdfDictionary;
}
set
{
this["AA"] = value;
}
}
/// <summary>
/// A URI dictionary containing document-level information
/// for URI (uniform resource identifier) actions.
/// </summary>
public PdfDictionary URI
{
get
{
return this["URI"] as PdfDictionary;
}
set
{
this["URI"] = value;
}
}
/// <summary>
/// The document's optional content properties dictionary.
/// </summary>
public OptionalContentProperties OCProperties
{
get
{
OptionalContentProperties ocproperties = this["OCProperties"] as OptionalContentProperties;
if (ocproperties == null)
{
ocproperties = new OptionalContentProperties();
this["OCProperties"] = ocproperties;
}
return ocproperties;
}
set
{
this["OCProperties"] = value;
}
}
/// <summary>
/// A permissions dictionary that specifies user access
/// permissions for the document.
/// </summary>
public PdfDictionary Permissions
{
get
{
return this["Perms"] as PdfDictionary;
}
set
{
this["Perms"] = value;
}
}
/// <summary>
/// A dictionary containing attestations regarding the
/// content of a PDF document, as it relates to the legality of digital signatures.
/// </summary>
public PdfDictionary Legal
{
get
{
return this["Legal"] as PdfDictionary;
}
set
{
this["Legal"] = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -