Class PDFobj
An object of a PDF that was read with PDF.Read, which holds the tokens of its dictionary and its stream. See Example_34, Example_48 and Example_50.
public class PDFobj
- Inheritance
-
PDFobj
- Inherited Members
Methods
AddContent(byte[], List<PDFobj>)
Adds a content stream to this page.
public void AddContent(byte[] content, List<PDFobj> objects)
Parameters
AddPrefixContent(byte[], List<PDFobj>)
Adds new content object before the existing content objects. The original code was provided by Stefan Ostermann author of ScribMaster and HandWrite Pro. Additional code to handle PDFs with indirect array of stream objects was written by EDragoev.
public void AddPrefixContent(byte[] content, List<PDFobj> objects)
Parameters
AddResource(Font, List<PDFobj>)
Adds a font to the resources of this page.
public void AddResource(Font font, List<PDFobj> objects)
Parameters
AddResource(Image, List<PDFobj>)
Adds an image to the resources of this page.
public void AddResource(Image image, List<PDFobj> objects)
Parameters
AddResource(int, List<PDFobj>)
Adds a core font to the resources of this page and returns the font.
public Font AddResource(int coreFont, List<PDFobj> objects)
Parameters
Returns
GetContentObject(List<PDFobj>)
Returns the content object of this page, or null if it has no contents. The content of a page can be split into several streams, listed in an array that is either in the page dictionary or an object of its own. Together they are one content stream, so they are returned joined in a new object, which is not in the objects list.
public PDFobj GetContentObject(List<PDFobj> objects)
Parameters
Returns
GetData()
Returns the decompressed stream data, or null when there is none. A stream that is not a cross-reference or an object stream is decoded the first time its data is asked for, and the data is kept in the object: the first call changes the object, so two threads do not call it at once on the same object. The streams of one PDF that Read returns share a budget of 256 MiB of decoded data, MAX_DECODED_TOTAL: a stream past what is left of it, or one that cannot be decoded, has no data.
public byte[] GetData()
Returns
- byte[]
GetDict()
Returns the tokens of the object dictionary.
public List<string> GetDict()
Returns
GetNumber()
Returns the object number.
public int GetNumber()
Returns
GetPageSize()
Returns the width and height of the page, which its /MediaBox gives as the two corners of a rectangle, in either order. A page with no /MediaBox of its own, one that is not four numbers, or an empty one is letter size, as MuPDF and pdf.js draw it. PDF.GetPageObjects gives a page the box it inherits from the page tree, which a page of another program's PDF often does not carry itself, and the numbers of a box that is an object of its own or refers to them.
public PageSize GetPageSize()
Returns
GetResourcesObject(List<PDFobj>)
Returns the resources object of this page.
public PDFobj GetResourcesObject(List<PDFobj> objects)
Parameters
Returns
GetValue(string)
Returns the parameter value given the specified key. The key is an entry of the dictionary of the object, and not of a dictionary inside it: the /Type of a /Group before the /Type of a page is not the type of the page.
public string GetValue(string key)
Parameters
keystringthe specified key.
Returns
- string
the value, or "" when the object has no such key.
SetGraphicsState(GraphicsState, List<PDFobj>)
Adds the graphics state to the resources of this page.
public PDFobj SetGraphicsState(GraphicsState gs, List<PDFobj> objects)
Parameters
gsGraphicsStateobjectsList<PDFobj>