Mako 7.3.0 API
JawsMako::IPage Class Referenceabstract

A page from an IDocument, allowing high level page management, and providing on-demand access to page contents. More...

#include <jawsmako.h>

Inheritance diagram for JawsMako::IPage:

Public Member Functions

virtual double getWidth ()=0
 Get the page (media) width of the page. This does not require the page contents to be loaded.
 
virtual double getHeight ()=0
 Get the page (media) height of the page.
 
virtual FRect getCropBox ()=0
 Get the CropBox for this page. The returned rect is relative to the top left of the page.
 
virtual FRect getBleedBox ()=0
 Get the BleedBox for this page. The returned rect is relative to the top left of the page.
 
virtual FRect getTrimBox ()=0
 Get the TrimBox for this page. The returned rect is relative to the top left of the page.
 
virtual FRect getContentBox ()=0
 Get the ContentBox (also know as the ArtBox) for this page. The returned rect is relative to the top left of the page.
 
virtual int32 getRotate ()=0
 Get the view rotation for the page, in degrees clockwise.
 
virtual void setRotate (int32 rotate)=0
 Set the view rotation for the page, in degrees clockwise. Must be a multiple of 90 degrees.
 
virtual IDOMFixedPagePtr getContent ()=0
 Return a smart pointer to the IDOMFixedPage, loading it from the source document if necessary. More...
 
virtual IPageRasterPtr getPageRaster ()=0
 Return a smart pointer to the IPageRaster, loading it from the source document if necessary. You can only get either the IDOMFixedPage or the IPageRaster equivalent of the page. This is optional, not all sources support generating a page raster. More...
 
virtual IDOMFixedPagePtr edit ()=0
 Mark the page as edited, returning the editable IDOMFixedPage. Do this before attempting to edit the page contents. The markup DOM will be set to incomplete and may be edited in arbitrary ways. This also prevents the fixed page from being purged in low memory conditions. Note: This member may return a different instance than returned by previous invocations of getContent(), however once this routine has been called, subsequent calls to getContent() will return the same instance as that returned here.
 
virtual void revert ()=0
 Revert any edits to a page and mark the page as non-edited if possible. More...
 
virtual bool isLoaded ()=0
 Has the page been loaded? That is, has the DOM been fetched?
 
virtual bool isEdited ()=0
 Has the page been edited? That is, has the DOM been fetched?
 
virtual void setMetadataChanged () const =0
 Let the page know that the content metadata has changed. For example if either of the MediaBox, CropBox, TrimBox or ArtBox has changed.
 
virtual void setContent (const IDOMFixedPagePtr &content)=0
 Replace the content with the given fixed page.
 
virtual void release ()=0
 Release the reference to the page content, if possible. If a page is not edited, and the original source is available, the IPage's reference to the page content will be released. This is useful to release the memory associated with the page content if a page is not to be accessed again. The content may be safely requested again using getContent(). More...
 
virtual CAnnotationVect getAnnotations ()=0
 Get the annotations for the page, as a vector.
 
virtual void addAnnotation (const IAnnotationPtr &annotation)=0
 Add the given annotation.
 
virtual IAnnotationPtr findAnnotation (const IAnnotationReferencePtr &reference)=0
 Find the annotation with the given annotation reference within the page. Throws an IError if the target could not be found.
 
virtual void removeAnnotation (uint32 index)=0
 Remove the annotation at the given index. More...
 
virtual void removeAnnotation (const IAnnotationPtr &annotation)=0
 Remove the given annotation from the page. If the page is not present, an exception will be thrown.
 
virtual void removeAnnotations ()=0
 Remove all the annotations from the page.
 
virtual void getTextRuns (CTextRunVect &runs)=0
 Get the page's text runs. Text present in Tiling brushes will not be returned.
 
virtual IDOMCatalogPtr getCatalog () const =0
 Get the IDOMCatalog associated with this page.
 
virtual DOMid getPageId ()=0
 Get the Id of the page.
 
virtual COutputIntentVect getOutputIntents ()=0
 Get the output intents, if present.
 
virtual IDOMJobTkPtr getJobTicket () const =0
 Get the page job ticket, if present. More...
 
virtual void setJobTicket (const IDOMJobTkPtr &jobTicket)=0
 Set the page job ticket.
 
virtual IPagePtr clone ()=0
 Clone an IPage. For edited pages, this will clone the DOM tree. More...
 
virtual IPDFObjectPtr lookupFarReference (const IPDFFarReferencePtr &farReference, IPDFObjectStorePtr &store, const IDocumentPtr &document=IDocumentPtr())=0
 Attempt to find and resolve an indirect far reference to a PDF object. If found, the object store that contained it will be provided. Objects which are controlled by formal Mako APIs may not be reachable, and may be overridden at output. More...
 
virtual IPDFObjectStorePtr getObjectStore ()=0
 Obtain access to the page level object store. Objects which are controlled by formal Mako APIs may not be reachable, and may be overridden at output. More...
 
virtual FBox getMediaBox () const =0
 Obtain the PDF media box for this page. More...
 
virtual void setMediaBox (const FBox &mediaBox)=0
 Set the PDF media box for this page. More...
 
virtual IPageLabelPtr getPageLabel ()=0
 Get the page label. More...
 
virtual void setPageLabel (const IPageLabelPtr &pageLabel)=0
 Set the page label. More...
 
virtual float getUserUnit (bool fixed=false)=0
 Get the PDF UserUnit. More...
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to. More...
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to. More...
 

Static Public Member Functions

static JAWSMAKO_API IPagePtr create (const IJawsMakoPtr &jawsMako)
 Create an empty page. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

A page from an IDocument, allowing high level page management, and providing on-demand access to page contents.

Member Function Documentation

◆ clone()

virtual IPagePtr JawsMako::IPage::clone ( )
pure virtual

Clone an IPage. For edited pages, this will clone the DOM tree.

Returns
IPagePtr the fixed page.

◆ create()

static JAWSMAKO_API IPagePtr JawsMako::IPage::create ( const IJawsMakoPtr &  jawsMako)
static

Create an empty page.

Returns
IPagePtr the new page.

◆ getContent()

virtual IDOMFixedPagePtr JawsMako::IPage::getContent ( )
pure virtual

Return a smart pointer to the IDOMFixedPage, loading it from the source document if necessary.

Returns
IDOMFixedPagePtr the fixed page.

◆ getJobTicket()

virtual IDOMJobTkPtr JawsMako::IPage::getJobTicket ( ) const
pure virtual

Get the page job ticket, if present.

Returns
IDOMJobTkPtr the job ticket, or NULL if not present

◆ getMediaBox()

virtual FBox JawsMako::IPage::getMediaBox ( ) const
pure virtual

Obtain the PDF media box for this page.

The PDF Media box is reflected in the width and height of the page (see IPage::getWidth() and IPage::getHeight() as well as the IDOMFixedPage APIs IDOMFixedPage::getWidth() and IDOMFixedPage::getHeight()). However, PDF Media Boxes also allow the document to specify the origin of the page which IPage and the IDOMFixedPage do not provide.

Here, the PDF media box can be queried. Unlike the other box APIs above, the returned box uses the PDF coordinate system, where x increases to the right, y increases up, and 72 units represents one inch. Note also that Mako transparently handles UserUnit internally, and so the returned box has the UserUnit already incorporated.

Returns
FBox The MediaBox.

◆ getObjectStore()

virtual IPDFObjectStorePtr JawsMako::IPage::getObjectStore ( )
pure virtual

Obtain access to the page level object store. Objects which are controlled by formal Mako APIs may not be reachable, and may be overridden at output.

Returns
IPDFObjectStorePtr The object store for the document.

◆ getPageLabel()

virtual IPageLabelPtr JawsMako::IPage::getPageLabel ( )
pure virtual

Get the page label.

Returns
IPageLabelPtr The page label, or NULL.

◆ getPageRaster()

virtual IPageRasterPtr JawsMako::IPage::getPageRaster ( )
pure virtual

Return a smart pointer to the IPageRaster, loading it from the source document if necessary. You can only get either the IDOMFixedPage or the IPageRaster equivalent of the page. This is optional, not all sources support generating a page raster.

Returns
IPageRasterPtr the page raster.

◆ getUserUnit()

virtual float JawsMako::IPage::getUserUnit ( bool  fixed = false)
pure virtual

Get the PDF UserUnit.

Convenience function to get the UserUnit value that would be written if the page was output to PDF. The UserUnit value represents the size of default user space units, in multiples of 1/72 inch.

PDF versions beginning with 1.6 allow a UserUnit to be defined in the page dictionary which may be used to support larger page dimensions. In PDF versions earlier than PDF 1.6, the size of the default user space unit is fixed at 1/72 inch (UserUnit 1.0).

Parameters
fixedBoolean value indicating whether the size of the default user space must be fixed (PDF versions earlier than 1.6). When set to true, an IError of code EDL_ERR_PAGE_TOO_LARGE will be thrown if the UserUnit is calculated to be greater than 1.0. The default value is false.
Returns
float The UserUnit value.

◆ lookupFarReference()

virtual IPDFObjectPtr JawsMako::IPage::lookupFarReference ( const IPDFFarReferencePtr &  farReference,
IPDFObjectStorePtr &  store,
const IDocumentPtr &  document = IDocumentPtr() 
)
pure virtual

Attempt to find and resolve an indirect far reference to a PDF object. If found, the object store that contained it will be provided. Objects which are controlled by formal Mako APIs may not be reachable, and may be overridden at output.

Parameters
farReferenceThe far reference to resolve.
storeA reference to receive the store where the object was located.
documentIf provided, this document will be searched for the far reference if the object is not stored alongside this page.
Returns
IPDFObject The resolved object, or NULL if the resolved object was not found.

◆ release()

virtual void JawsMako::IPage::release ( )
pure virtual

Release the reference to the page content, if possible. If a page is not edited, and the original source is available, the IPage's reference to the page content will be released. This is useful to release the memory associated with the page content if a page is not to be accessed again. The content may be safely requested again using getContent().

If the page content cannot be released, nothing will happen.

◆ removeAnnotation()

virtual void JawsMako::IPage::removeAnnotation ( uint32  index)
pure virtual

Remove the annotation at the given index.

Parameters
indexThe index of the annotation to be removed (0 being the first document).

◆ revert()

virtual void JawsMako::IPage::revert ( )
pure virtual

Revert any edits to a page and mark the page as non-edited if possible.

This may not be used if the page was created as a new page, as there is nothing to revert to. In this case an IError exception will be thrown.

◆ setMediaBox()

virtual void JawsMako::IPage::setMediaBox ( const FBox mediaBox)
pure virtual

Set the PDF media box for this page.

The PDF Media box is reflected in the width and height of the page (see IPage::getWidth() and IPage::getHeight() as well as the IDOMFixedPage APIs IDOMFixedPage::getWidth() and IDOMFixedPage::getHeight()). However, PDF Media Boxes also allow the document to specify the origin of the page which IPage and the IDOMFixedPage do not provide.

Here, the PDF media box can be replaced allowing the origin of the page to be changed.

The provided box must be using the PDF coordinate system where x increases to the right, y increases upward, and 72 units represents one inch. Note that Mako internally handles UserUnit automatically, and so the coordinates are in final viewing PDF units, and not the PDF default units.

When the new media box is set, any edited DOM will be modified to reflect the change by offsetting the content, and any annotation rectangles will be updated to suit.

Parameters
mediaBoxThe desired MediaBox.

◆ setPageLabel()

virtual void JawsMako::IPage::setPageLabel ( const IPageLabelPtr &  pageLabel)
pure virtual

Set the page label.

Parameters
pageLabelThe page label. Setting a value of NULL specifies that the page label is a continuation from the previous page in the document's labelling range, as described in the PDF reference.

The documentation for this class was generated from the following file: