Mako 8.1.0 API
Loading...
Searching...
No Matches
JawsMako::IDocument Class Referenceabstract

A document from an IDocumentAssembly, allowing for high level document and page management, and providing on-demand lazy loading of page markup. More...

#include <jawsmako.h>

Inheritance diagram for JawsMako::IDocument:

Public Member Functions

virtual uint32 getNumPages ()=0
 Return the number of pages in the document, if known.
 
virtual IPagePtr getPage (uint32 index=0)=0
 Get the IPage from the document at the given index.
 
virtual bool pageExists (uint32 index)=0
 Determine if a page with the given index exists in the document.
 
virtual void insertPage (const IPagePtr &page, uint32 index=0, const IDocumentPtr &sourceDocument=IDocumentPtr())=0
 Insert a page into the document at the given index.
 
virtual void appendPage (const IPagePtr &page, const IDocumentPtr &sourceDocument=IDocumentPtr())=0
 Append a page to the document. If the source document that the page came from is provided:
 
virtual void removePage (uint32 index)=0
 Remove the page at the given index.
 
virtual void removePage (const IPagePtr &page)=0
 Remove the given page from the document. If the page is not present, an exception will result.
 
virtual void findTarget (DOMid targetId, uint32 &pageNum)=0
 Find the page containing the target with the given DOMid in the document, providing the index of the page within the document. Throws an IError if the target could not be found.
 
virtual IAnnotationPtr findAnnotation (const IAnnotationReferencePtr &reference)=0
 Find the annotation with the given annotation reference within the document. Throws an IError if the target could not be found.
 
virtual IAnnotationPtr findAnnotation (const IAnnotationReferencePtr &reference, uint32 &pageNum)=0
 Find the annotation with the given annotation reference within the document, providing the index of the page that contains the annotation. Throws an IError if the target could not be found.
 
virtual IDOMJobTkPtr getJobTicket () const =0
 Get the document job ticket, if present.
 
virtual void setJobTicket (const IDOMJobTkPtr &jobTicket)=0
 Set the document job ticket.
 
virtual COutputIntentVect getOutputIntents () const =0
 Get the output intents, if present. A PDF may have more than one output intent; for standards such as PDF/X-4, only the first is relevant.
 
virtual IOptionalContentPtr getOptionalContent () const =0
 Get the optional content if present.
 
virtual void setOptionalContent (const IOptionalContentPtr &optionalContent)=0
 Set the optional content for the document.
 
virtual IStructurePtr getStructure () const =0
 Get the structure information if present.
 
virtual void setStructure (const IStructurePtr &structure)=0
 Set the structure content for the document.
 
virtual IDOMOutlinePtr getOutline () const =0
 Get the document outline, if present.
 
virtual void setOutline (const IDOMOutlinePtr &outline)=0
 Set the document outline, if present.
 
virtual IFormPtr getForm () const =0
 Get the document interactive form, if present.
 
virtual void setForm (const IFormPtr &form)=0
 Set the document interactive form.
 
virtual CFileSpecAsEmbeddedDataVect getEmbeddedStreams ()=0
 Get any embedded streams or attachments attached to the document. This is currently a PDF-specific feature.
 
virtual void addEmbeddedStream (const IFileSpecAsEmbeddedDataPtr &embeddedData)=0
 Add an embedded file stream to the document. This is currently a PDF-specific feature.
 
virtual CNamedDestinationVect getNamedDestinations ()=0
 Get any named destinations present in the document.
 
virtual void addNamedDestination (const INamedDestinationPtr &namedDestination)=0
 Add a named destination to the document.
 
virtual void setNamedDestinations (const CNamedDestinationVect &namedDestinations)=0
 Replace the named destinations in the document with the given vector.
 
virtual IThreadsPtr getThreads () const =0
 Get the document threads, if present.
 
virtual IDocumentPtr clone ()=0
 Clone an IDocument. Will also clone all the pages in the document.
 
virtual IPDFObjectPtr lookupFarReference (const IPDFFarReferencePtr &farReference, IPDFObjectStorePtr &store)=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. If not found at the document level, the documents' pages will be searched. Objects which are controlled by formal Mako APIs may not be reachable, and may be overridden at output.
 
virtual IPDFObjectStorePtr getObjectStore ()=0
 Obtain access to the document level object store. Objects which are controlled by formal Mako APIs may not be reachable, and may be overridden at output.
 
virtual IPDFObjectPtr readPdfObject (const IPDFReferencePtr &reference)=0
 Raw access to the PDF object database from an original PDF file. For informational purposes only; the objects returned from this interface must not be edited.
 
virtual IPDFDictionaryPtr readPdfTrailerDictionary ()=0
 Raw access to the PDF trailer dictionary. For informational purposes only; the object returned from this interface must not be edited.
 
- 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.
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.
 

Static Public Member Functions

static JAWSMAKO_API IDocumentPtr create (const IJawsMakoPtr &jawsMako, const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr())
 Create an empty document.
 

Additional Inherited Members

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

Detailed Description

A document from an IDocumentAssembly, allowing for high level document and page management, and providing on-demand lazy loading of page markup.

Member Function Documentation

◆ addEmbeddedStream()

virtual void JawsMako::IDocument::addEmbeddedStream ( const IFileSpecAsEmbeddedDataPtr & embeddedData)
pure virtual

Add an embedded file stream to the document. This is currently a PDF-specific feature.

Parameters
embeddedDataThe embedded file stream to be added.

◆ addNamedDestination()

virtual void JawsMako::IDocument::addNamedDestination ( const INamedDestinationPtr & namedDestination)
pure virtual

Add a named destination to the document.

Note
This will override any named destination with the same name that may be present.
Parameters
namedDestinationThe named destination to be added.

◆ appendPage()

virtual void JawsMako::IDocument::appendPage ( const IPagePtr & page,
const IDocumentPtr & sourceDocument = IDocumentPtr() )
pure virtual

Append a page to the document. If the source document that the page came from is provided:

  • The target document's outline (bookmarks) will be updated with any outline entries present on the inserted page.
  • The interactive forms will be updated with any widget annotations present on the page. Note that if the names of any widgets being added clash with existing widgets or fields they will be forcibly renamed.
  • Font merging is improved as fonts are available in the source document
Parameters
pageSmart pointer to the page to be inserted.
sourceDocument(optional) The source document that the page came from

◆ clone()

virtual IDocumentPtr JawsMako::IDocument::clone ( )
pure virtual

Clone an IDocument. Will also clone all the pages in the document.

Returns
IDocumentPtr The clone.

◆ create()

static JAWSMAKO_API IDocumentPtr JawsMako::IDocument::create ( const IJawsMakoPtr & jawsMako,
const IProgressMonitorPtr & progressMonitor = IProgressMonitorPtr() )
static

Create an empty document.

Parameters
jawsMakoThe JawsMako instance.
progressMonitorA smart pointer to an IProgressMonitor object or NULL if no object was passed.
Returns
IDocumentPtr the new page.

◆ findAnnotation() [1/2]

virtual IAnnotationPtr JawsMako::IDocument::findAnnotation ( const IAnnotationReferencePtr & reference)
pure virtual

Find the annotation with the given annotation reference within the document. Throws an IError if the target could not be found.

Parameters
referenceThe annotation reference sought
Returns
IAnnotationPtr The annotation that was found.

◆ findAnnotation() [2/2]

virtual IAnnotationPtr JawsMako::IDocument::findAnnotation ( const IAnnotationReferencePtr & reference,
uint32 & pageNum )
pure virtual

Find the annotation with the given annotation reference within the document, providing the index of the page that contains the annotation. Throws an IError if the target could not be found.

Parameters
[in]referenceThe annotation reference sought
[out]pageNumA zero-based page number where the object was found
Returns
IAnnotationPtr The annotation that was found, or NULL if no such annotation exists.

◆ findTarget()

virtual void JawsMako::IDocument::findTarget ( DOMid targetId,
uint32 & pageNum )
pure virtual

Find the page containing the target with the given DOMid in the document, providing the index of the page within the document. Throws an IError if the target could not be found.

Parameters
[in]targetIdThe DOMid of the object sought
[out]pageNumA zero-based page number where the object was found

◆ getEmbeddedStreams()

virtual CFileSpecAsEmbeddedDataVect JawsMako::IDocument::getEmbeddedStreams ( )
pure virtual

Get any embedded streams or attachments attached to the document. This is currently a PDF-specific feature.

Returns
CFileSpecAsEmbeddedDataVect A vector of embedded file streams.

◆ getForm()

virtual IFormPtr JawsMako::IDocument::getForm ( ) const
pure virtual

Get the document interactive form, if present.

Returns
IFormPtr The document form, or NULL if not present.

◆ getJobTicket()

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

Get the document job ticket, if present.

Returns
IDOMJobTkPtr the job ticket, or NULL if not present

◆ getNamedDestinations()

virtual CNamedDestinationVect JawsMako::IDocument::getNamedDestinations ( )
pure virtual

Get any named destinations present in the document.

Returns
CNamedDestinationVect A vector of named destinations.

◆ getNumPages()

virtual uint32 JawsMako::IDocument::getNumPages ( )
pure virtual

Return the number of pages in the document, if known.

Note
For streaming inputs such as PCL/5, this will cause the input to block until the document has been consumed and the number of pages known.
Returns
uint32 The number of pages in the document.

◆ getObjectStore()

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

Obtain access to the document 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.

◆ getOptionalContent()

virtual IOptionalContentPtr JawsMako::IDocument::getOptionalContent ( ) const
pure virtual

Get the optional content if present.

Returns
IOptionalContentPtr The optional content, or NULL if not present.

◆ getOutline()

virtual IDOMOutlinePtr JawsMako::IDocument::getOutline ( ) const
pure virtual

Get the document outline, if present.

Returns
IDOMOutlinePtr the document outline, or NULL if not present.

◆ getOutputIntents()

virtual COutputIntentVect JawsMako::IDocument::getOutputIntents ( ) const
pure virtual

Get the output intents, if present. A PDF may have more than one output intent; for standards such as PDF/X-4, only the first is relevant.

Returns
COutputIntentVect A vector of output intents.

◆ getPage()

virtual IPagePtr JawsMako::IDocument::getPage ( uint32 index = 0)
pure virtual

Get the IPage from the document at the given index.

Parameters
indexThe index of the required page, 0 being the first page.
Returns
IPagePtr The requested page.

◆ getStructure()

virtual IStructurePtr JawsMako::IDocument::getStructure ( ) const
pure virtual

Get the structure information if present.

Returns
IStructurePtr The document structure, or NULL if not present.

◆ getThreads()

virtual IThreadsPtr JawsMako::IDocument::getThreads ( ) const
pure virtual

Get the document threads, if present.

Returns
IThreadsPtr The document threads, if present.

◆ insertPage()

virtual void JawsMako::IDocument::insertPage ( const IPagePtr & page,
uint32 index = 0,
const IDocumentPtr & sourceDocument = IDocumentPtr() )
pure virtual

Insert a page into the document at the given index.

Note
The page will not be cloned, and so any changes to the added page will affect all users of the page. The interactive forms will be updated with any widget annotations present on the page. Note that if the names of any widgets being added clash with existing widgets or fields they will be forcibly renamed. Provide a sourceDocument if possible for improved form merging.
Parameters
pagesmart pointer to the page to be inserted.
indexThe position in the document to insert the page, 0 being the first position.
sourceDocument(optional) The source document that the page came from. If provided, the target document's outline will be updated with any outline entries present on the inserted page.

◆ lookupFarReference()

virtual IPDFObjectPtr JawsMako::IDocument::lookupFarReference ( const IPDFFarReferencePtr & farReference,
IPDFObjectStorePtr & store )
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. If not found at the document level, the documents' pages will be searched. 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.
Returns
IPDFObject The resolved object, or NULL if the resolved object was not found.

◆ pageExists()

virtual bool JawsMako::IDocument::pageExists ( uint32 index)
pure virtual

Determine if a page with the given index exists in the document.

Parameters
indexThe index of the page to check, 0 being the first page.
Returns
bool True if the document has a page with the given index.

◆ readPdfObject()

virtual IPDFObjectPtr JawsMako::IDocument::readPdfObject ( const IPDFReferencePtr & reference)
pure virtual

Raw access to the PDF object database from an original PDF file. For informational purposes only; the objects returned from this interface must not be edited.

Parameters
referenceThe indirect reference to be retrieved, or NULL to read the document's Catalog dictionary.
Returns
IPDFObjectPtr The read object, or NULL if there is no such object.

◆ readPdfTrailerDictionary()

virtual IPDFDictionaryPtr JawsMako::IDocument::readPdfTrailerDictionary ( )
pure virtual

Raw access to the PDF trailer dictionary. For informational purposes only; the object returned from this interface must not be edited.

Returns
IPDFDictionaryPtr The trailer dictionary, or null if no trailer dictionary is available.

◆ removePage() [1/2]

virtual void JawsMako::IDocument::removePage ( const IPagePtr & page)
pure virtual

Remove the given page from the document. If the page is not present, an exception will result.

Parameters
pageSmart pointer to the page to be removed.

◆ removePage() [2/2]

virtual void JawsMako::IDocument::removePage ( uint32 index)
pure virtual

Remove the page at the given index.

Parameters
indexThe index of the page to be removed (0 being the first page)

◆ setForm()

virtual void JawsMako::IDocument::setForm ( const IFormPtr & form)
pure virtual

Set the document interactive form.

Parameters
formThe form to be set. May be NULL.

◆ setJobTicket()

virtual void JawsMako::IDocument::setJobTicket ( const IDOMJobTkPtr & jobTicket)
pure virtual

Set the document job ticket.

Parameters
jobTicketThe job ticket.

◆ setNamedDestinations()

virtual void JawsMako::IDocument::setNamedDestinations ( const CNamedDestinationVect & namedDestinations)
pure virtual

Replace the named destinations in the document with the given vector.

Note
If there are multiple destinations with the same name, the results are undefined.
Parameters
namedDestinationsThe vector of named destinations

◆ setOptionalContent()

virtual void JawsMako::IDocument::setOptionalContent ( const IOptionalContentPtr & optionalContent)
pure virtual

Set the optional content for the document.

Parameters
optionalContentThe optional content to set, or NULL to remove.

◆ setOutline()

virtual void JawsMako::IDocument::setOutline ( const IDOMOutlinePtr & outline)
pure virtual

Set the document outline, if present.

Parameters
outlineThe desired document outline, or NULL to remove.

◆ setStructure()

virtual void JawsMako::IDocument::setStructure ( const IStructurePtr & structure)
pure virtual

Set the structure content for the document.

Parameters
structureThe document structure to set, or NULL to remove.

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