Pajdeg  0.2.2
Pajdeg
Files | Data Structures | Typedefs | Functions

A PDF page. More...

Files

file  PDPage.h
 

Data Structures

struct  PDPage
 

Typedefs

typedef struct PDPagePDPageRef
 

Functions

PDPageRef PDPageCreateForPageWithNumber (PDParserRef parser, PDInteger pageNumber)
 
PDPageRef PDPageCreateWithObject (PDParserRef parser, PDObjectRef object)
 
PDPageRef PDPageInsertIntoPipe (PDPageRef page, PDPipeRef pipe, PDInteger pageNumber)
 
PDInteger PDPageGetContentsObjectCount (PDPageRef page)
 
PDObjectRef PDPageGetContentsObjectAtIndex (PDPageRef page, PDInteger index)
 
PDRect PDPageGetMediaBox (PDPageRef page)
 
PDArrayRef PDPageGetAnnotRefs (PDPageRef page)
 
PDFontRef PDPageGetFont (PDPageRef page, PDStringRef fontName)
 

Detailed Description

A PDF page.

A representation of a page inside a PDF document. It is associated with an object and has a reference to the PDParser instance for the owning document.


Data Structure Documentation

struct PDPage

Page internal structure

Data Fields

PDObjectRef ob
 the /Page object
 
PDParserRef parser
 the parser associated with the owning PDF document
 
PDInteger contentCount
 

of content objects in the page


 
PDArrayRef contentRefs
 array of content references for the page
 
PDObjectRefcontentObs
 array of content objects for the page, or NULL if unfetched
 
PDFontDictionaryRef fontDict
 The font dictionary for the page; lazily constructed on first call to PDPageGetFont().
 

Typedef Documentation

typedef struct PDPage* PDPageRef

A PDF page.

Function Documentation

PDPageRef PDPageCreateForPageWithNumber ( PDParserRef  parser,
PDInteger  pageNumber 
)

Create a new page instance for the given parser and page number.

Note
Page numbers start at 1, not 0.
Parameters
parserParser reference
pageNumberThe page number of the page to fetch
Returns
New PDPage object
PDPageRef PDPageCreateWithObject ( PDParserRef  parser,
PDObjectRef  object 
)

Create a new page instance for the given parser and object.

Note
The object must belong to the parser, and may not be from a foreign instance of Pajdeg.
The object does not necessarily have to be a proper page at the time of creation, but it should (ideally) be one eventually.
Parameters
parserThe parser owning object
objectThe /Page object
Returns
A new page instance for the associated object
PDArrayRef PDPageGetAnnotRefs ( PDPageRef  page)

Fetch the annotations for this page, as an array of PDReferences and/or PDObjects. The entries are normally references, but if annotations were replaced or added as PDObjects, they will be returned as is.

Parameters
pageThe page object
Returns
An array of annotation references and objects.
PDObjectRef PDPageGetContentsObjectAtIndex ( PDPageRef  page,
PDInteger  index 
)

Fetch (if unfetched) and return the index'th PDObject associated with the page's /Contents key. A lot of pages only have a single contents object, but they are allowed to have an array of them, in which case the resulting page is rendered as if the array of streams were concatenated.

Parameters
pagePage whose contents object is requested
indexThe index (starting at 0) of the contents object to fetch
Returns
The contents object for the given index, for the page
PDInteger PDPageGetContentsObjectCount ( PDPageRef  page)

Determine the number of content objects this page has.

Parameters
pagePage to be checked
Returns
Number of content objects
PDFontRef PDPageGetFont ( PDPageRef  page,
PDStringRef  fontName 
)

Get the font object with the given font name for the page.

Parameters
pagePage whose resource dictionary defines the font dictionary in which the font with the given name is defined
fontNameThe name of the font (a /Name string)
Returns
PDFont object or NULL if no font with the given name was found
PDRect PDPageGetMediaBox ( PDPageRef  page)

Fetch the media box for the given page.

Parameters
pageThe page object
Note
PDRects differ from e.g. CGRects in that they are composed of the two points making up the rectangle, as opposed to making up an origin pair and a size pair.
Returns
A PDRect representing the media box.
PDPageRef PDPageInsertIntoPipe ( PDPageRef  page,
PDPipeRef  pipe,
PDInteger  pageNumber 
)

Copy this page and all associated objects into the PDF document associated with the pipe, inserting it at pageNumber.

With two separate simultaneous Pajdeg instances A and B with pages A1 A2 A3 and B1 B2 B3, the following operation

1 PDPageRef pageA2 = PDPageCreateForPageWithNumber(parserA, 2);
2 PDPageRef pageB2 = PDPageInsertIntoPipe(pageA2, pipeB, 2);

will result in the output of B consisting of pages B1 A2 B2 B3, in that order.

Parameters
pageThe page object that should be copied
pipeThe pipe into which the page object should be inserted
pageNumberThe resulting page number of the inserted page
Returns
Reference to the inserted page, autoreleased