Aurelon Open API 8.1.1
Loading...
Searching...
No Matches
AOI_Document Class Reference

PDF Document. More...

Public Member Functions

 AOI_Document (AOI_Instance *)
 
void Open (const aur::ACPL::FileSpec &path, const char *ownerPassword=NULL, const char *userPassword=NULL)
 
void CloseFile (bool keepVM, bool createDefaults)
 
ExceptionCode SaveAsPDF (const aur::ACPL::FileSpec &path)
 
uint32_t GetPageCount () const
 
AOI_PageGetPage (uint32_t) const
 
bool TraverseNext (AOI_Object *&) const
 
AOI_ColorSpacePtr GetDocumentColorSpace () const
 
AOI_ColorSpacePtr GetLabColorSpace () const
 
AOI_ColorSpacePtr GetDeviceGrayColorSpace () const
 
AOI_ColorSpacePtr GetDeviceRGBColorSpace () const
 
AOI_ColorSpacePtr GetDeviceCMYKColorSpace () const
 
bool BlackAndWhiteDoc () const
 
bool FontExists (bool onlyUsed) const
 
SpotColorName * GetSpotColorList ()
 
AOI_ObjectHitTest (AOI_Point p, int16_t snapDistance, bool &stroke, AOI_Color *outColor=NULL)
 

Detailed Description

PDF Document.

Definition at line 34 of file AOI_Document.h.

Constructor & Destructor Documentation

◆ AOI_Document()

AOI_Document::AOI_Document ( AOI_Instance * instance)

Constructs a new empty AOI_Document document. This document can be used to open a file using the Open method or for the method ConvertPStoPDF.

Parameters
instanceAOI_Instance object used by this thread.
See also
AOI_Instance, Open and ConvertPStoPDF

Definition at line 142 of file AOI_Document.cpp.

Member Function Documentation

◆ BlackAndWhiteDoc()

bool AOI_Document::BlackAndWhiteDoc ( ) const

Checks if the document contains only black & white, gray or DeviceN( black ) colorspaces and thus no color.

Returns
True when only black & white, false when color is found

Definition at line 464 of file AOI_Document.cpp.

◆ CloseFile()

void AOI_Document::CloseFile ( bool keepVM,
bool createDefaults )

Closes the document.

Definition at line 663 of file AOI_Document.cpp.

◆ FontExists()

bool AOI_Document::FontExists ( bool onlyUsed) const

Checks if the document contains fonts.

Returns
True when document contains fonts, false when it doesn't

Definition at line 508 of file AOI_Document.cpp.

◆ GetDeviceCMYKColorSpace()

AOI_ColorSpacePtr AOI_Document::GetDeviceCMYKColorSpace ( ) const

Returns the only instance of the DeviceCMYK colorspace. This colorspace can exist only once in the scope of a document and must be retrieved using this method.

Returns
Pointer to the instance of the colorspace.
See also
GetLabColorSpace, GetDeviceGrayColorSpace, GetDeviceRGBColorSpace

Definition at line 389 of file AOI_Document.cpp.

◆ GetDeviceGrayColorSpace()

AOI_ColorSpacePtr AOI_Document::GetDeviceGrayColorSpace ( ) const

Returns the only instance of the DeviceGray colorspace. This colorspace can exist only once in the scope of a document and must be retrieved using this method.

Returns
Pointer to the instance of the colorspace.
See also
GetLabColorSpace, GetDeviceRGBColorSpace, GetDeviceCMYKColorSpace

Definition at line 363 of file AOI_Document.cpp.

◆ GetDeviceRGBColorSpace()

AOI_ColorSpacePtr AOI_Document::GetDeviceRGBColorSpace ( ) const

Returns the only instance of the DeviceRGB colorspace. This colorspace can exist only once in the scope of a document and must be retrieved using this method.

Returns
Pointer to the instance of the colorspace.
See also
GetLabColorSpace, GetDeviceGrayColorSpace, GetDeviceCMYKColorSpace

Definition at line 376 of file AOI_Document.cpp.

◆ GetDocumentColorSpace()

AOI_ColorSpacePtr AOI_Document::GetDocumentColorSpace ( ) const

Returns the colorspace of the document. This call may result in a NULL pointer when no document colorspace is defined. Document colorspaces are commonly defined when a PDF/X output intent is set, in such document this call returns the document ICC profile colorspace.

Returns
Document colorspace object. NULL when no document colorspace is defined.

Definition at line 337 of file AOI_Document.cpp.

◆ GetLabColorSpace()

AOI_ColorSpacePtr AOI_Document::GetLabColorSpace ( ) const

Returns the only instance of the CIELab colorspace. This colorspace can exist only once in the scope of a document and must be retrieved using this method.

Returns
Pointer to the instance of the colorspace.
See also
GetLabColorSpace, GetDeviceGrayColorSpace, GetDeviceRGBColorSpace, GetDeviceCMYKColorSpace

Definition at line 350 of file AOI_Document.cpp.

◆ GetPage()

AOI_PagePtr AOI_Document::GetPage ( uint32_t pageNr) const

Returns a page object that holds the page with the given page number. A call to this method might cause some delay because the first time the page is accessed is the first time the page is parsed from PDF. The second time access is much faster.

Parameters
pageNrPage number to access. 0 based.
Returns
Pointer to the page object.
See also
GetPageCount

Definition at line 304 of file AOI_Document.cpp.

◆ GetPageCount()

uint32_t AOI_Document::GetPageCount ( ) const

Returns the number of pages in the document.

Returns
Number of pages.

Definition at line 289 of file AOI_Document.cpp.

◆ GetSpotColorList()

SpotColorName * AOI_Document::GetSpotColorList ( )

Builds the list of spot colors with the last entry pointing to NULL. The pointers in the list are valid until the next operation in this document.

The spot colors listed are only the ones available in the pages that where visited.

Returns
Pointer to a list of C strings with spot color names. Or NULL when no spot colors are found.

Definition at line 577 of file AOI_Document.cpp.

◆ HitTest()

AOI_Object * AOI_Document::HitTest ( AOI_Point p,
int16_t snapDistance,
bool & stroke,
AOI_Color * outHitColor = NULL )

Determines the top object that is at the given location. From the object the color is returned. If the object is an image a pixel is sampled and if the object contains a shading the shading is sampled.

The resulting color is without transparency and blending effects applied.

This method relies on an AOI_Renderer to be setup and connected to the document. As this routine is used for hit testing mouse clicks for example the screen view renderer should be used.

Parameters
pAOI_Point defining the location to check relative to the page coordinates.
snapDistanceAmount of pixels that will snap to an object. The pixels are related to the current renderer setup.
strokeReturns if the objects its stroke or fill is hit. True when the stroke is hit.
outHitColorPointer to the color structure to receive the color of the object at the hit location. If NULL is provided then no color is returned.
Returns
Pointer to the found object. NULL is return when no object is at the location.

Definition at line 631 of file AOI_Document.cpp.

◆ Open()

void AOI_Document::Open ( const aur::ACPL::FileSpec & path,
const char * ownerPassword = NULL,
const char * userPassword = NULL )

Opens a document. The document can be any of the file types the license allows. PDF is always allowed.

Parameters
pathUnicode encoded path to the document to open.
ownerPasswordOptional owner password to decrypt and modify the PDF file.
userPasswordOptional user password to decrypt and view the PDF file.

Definition at line 196 of file AOI_Document.cpp.

◆ SaveAsPDF()

ExceptionCode AOI_Document::SaveAsPDF ( const aur::ACPL::FileSpec & path)

Save the document in PDF 1.4 format to the given location. The file will be created. An existing file will be overwritten.

Requires PDF option in the license.

Parameters
pathPath to the output PDF to be created. If not existing it will be created. The underlying directory must exist.
Returns
NoError when succesfull or the error during saving.

Definition at line 553 of file AOI_Document.cpp.

◆ TraverseNext()

bool AOI_Document::TraverseNext ( AOI_Object *& object) const

Retrieves the next object in the current page. The current page is set using GetPage. The first call must supply a object pointer that point to NULL. This will make the method return the first object in the tree. For subsequent calls pass the object pointer retrieved from the previous call.

Parameters
objectAt input pointer to the previous object and NULL for the first call. At ouput the next object in the tree and NULL if the end is reached.
Returns
True if a next object is found, false when at the end of the tree.
See also
GetPage

Definition at line 321 of file AOI_Document.cpp.


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