⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pdfxrefstream.cs

📁 PDF文档生成解析使用的库,可以用来改写自己的文档格式
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using AnotherPDFLib.PdfGraphics;

namespace AnotherPDFLib
{
	/// <summary>
	/// Cross-reference stream
	/// </summary>
	public partial class PdfXRefStream : PdfStream
	{
		public PdfXRefStream() : base("XRef")
		{
		}

		/// <summary>
		/// The catalog dictionary for the PDF document contained in the file.
		/// </summary>
		public PdfCatalog Root
		{
			get
			{
				return this["Root"] as PdfCatalog;
			}
			set
			{
				this["Root"] = value;
			}
		}

		/// <summary>
		/// The total number of entries in the file's cross-reference table,
		/// as defined by the combination of the original section and all update sections.
		/// Equivalently, this value is 1 greater than the highest object number used in the file.
		/// </summary>
		public int Size
		{
			get
			{
				PdfInteger size = this["Size"] as PdfInteger;
				if (size != null)
				{
					return size.Value;
				}
				return 0;
			}
			set
			{
				this["Size"] = new PdfInteger(value);
			}
		}

		/// <summary>
		/// An array of two strings constituting a file identifier for the file.
		/// Although this entry is optional,
		/// its absence might prevent the file from functioning in some workflows
		/// that depend on files being uniquely identified.
		/// </summary>
		public FileIdentifier FileID
		{
			get
			{
				return this["ID"] as FileIdentifier;
			}
			set
			{
				this["ID"] = value;
			}
		}

		public PdfDictionary Encrypt
		{
			get
			{
				return this["Encrypt"] as PdfDictionary;
			}
			set
			{
				this["Encrypt"] = value;
			}
		}

		/// <summary>
		/// The byte offset from the beginning of the file to the beginning of the
		/// previous cross-reference section.
		/// (Present only if the file has more than one cross-reference section)
		/// </summary>
		public int PreviousXref
		{
			get
			{
				PdfInteger previousxref = this["Prev"] as PdfInteger;
				if (previousxref != null)
				{
					return previousxref.Value;
				}
				return 0;
			}
			set
			{
				this["Prev"] = new PdfInteger(value);
			}
		}

		/// <summary>
		/// Gets or set document's information dictionary.
		/// </summary>
		public PdfDocumentInfo DocumentInfo
		{
			get
			{
				return this["Info"] as PdfDocumentInfo;
			}
			set
			{
				this["Info"] = value;
			}
		}

		/// <summary>
		/// An array containing a pair of integers for each subsection in this section.
		/// The first integer is the first object number in the subsection; the second integer
		/// is the number of entries in the subsection
		/// The array is sorted in ascending order by object number. Subsections cannot overlap;
		/// an object number may have at most one entry in a section.
		/// Default value: [0 Size].
		/// </summary>
		public PdfArray Index
		{
			get
			{
				return this["Index"] as PdfArray;
			}
			set
			{
				this["Index"] = value;
			}
		}

		/// <summary>
		/// An array of integers representing the size of the fields in a single crossreference
		/// entry.
		/// For PDF
		/// 1.5, W always contains three integers; the value of each integer is the number of
		/// bytes (in the decoded stream) of the corresponding field.
		/// A value of zero for an element in the W array indicates that the corresponding field
		/// is not present in the stream, and the default value is used, if there is one. If the first
		/// element is zero, the type field is not present, and it defaults to type 1.
		/// The sum of the items is the total length of each entry; it can be used with the Index
		/// array to determine the starting position of each subsection.
		/// </summary>
		public PdfArray FieldWidths
		{
			get
			{
				return this["W"] as PdfArray;
			}
			set
			{
				this["W"] = value;
			}
		}

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -