PDFix SDK  7.2.0
Loading...
Searching...
No Matches
Pdfix Struct Referenceabstract

Pdfix class. More...

#include <pdfix.h>

Public Member Functions

virtual void Destroy ()=0
 Destroys Pdfix resources. More...
 
virtual PsAuthorizationGetAuthorization ()=0
 Gets the current PsAuthorization object. More...
 
virtual PsStandardAuthorizationGetStandardAuthorization ()=0
 Gets the PsStandardAuthorization object. More...
 
virtual PsAccountAuthorizationGetAccountAuthorization ()=0
 Gets the PsAccountAuthorization object. More...
 
virtual int GetErrorType () const =0
 
virtual const char * GetError ()=0
 
virtual void SetError (int type, const char *error)=0
 Sets the latest error message to the library. More...
 
virtual const char * GetProductName () const =0
 Returns the name of the product. More...
 
virtual const char * GetProductUrl () const =0
 Returns the url of the product. More...
 
virtual int GetVersionMajor () const =0
 
virtual int GetVersionMinor () const =0
 
virtual int GetVersionPatch () const =0
 
virtual PdfDocCreateDoc ()=0
 
virtual PdfDocOpenDoc (const wchar_t *path, const wchar_t *password)=0
 
virtual PdfDocOpenDocFromStream (PsStream *stream, const wchar_t *password)=0
 
virtual PdfDigSigCreateDigSig ()=0
 
virtual PdfCustomDigSigCreateCustomDigSig ()=0
 
virtual PdfStandardSecurityHandlerCreateStandardSecurityHandler (const wchar_t *user_password, const wchar_t *owner_password, const PdfStandardSecurityParams *params)=0
 Creates a new PdfStandardSecurityHandler object. More...
 
virtual PdfCustomSecurityHandlerCreateCustomSecurityHandler (const wchar_t *name, void *client_data)=0
 Creates a new PdfCustomSecurityHandler object. More...
 
virtual bool RegisterSecurityHandler (PdfSecurityCreateHandlerProc proc, const wchar_t *name, void *client_data)=0
 Registers factory method that will create security handler when the document is initialized. More...
 
virtual PdfAnnotHandlerRegisterAnnotHandler (const wchar_t *type)=0
 Register annotation handler. More...
 
virtual PdfActionHandlerRegisterActionHandler (const wchar_t *type)=0
 Register action handler. More...
 
virtual PsRegexCreateRegex ()=0
 
virtual PsFileStreamCreateFileStream (const wchar_t *path, PsFileMode mode)=0
 
virtual PsMemoryStreamCreateMemStream ()=0
 
virtual PsCustomStreamCreateCustomStream (PsStreamReadProc read_proc, void *client_data)=0
 
virtual bool RegisterEvent (PdfEventType type, PdfEventProc proc, void *data)=0
 Registers a user-supplied procedure to call when the specified event occurs. More...
 
virtual bool UnregisterEvent (PdfEventType type, PdfEventProc proc, void *data)=0
 
virtual bool ReadImageInfo (PsStream *image_stream, PdfImageFormat format, PsImageInfo *info)=0
 Reads basic image info from image data stream. More...
 
virtual PsImageCreateImage (int width, int height, PsImageDIBFormat format)=0
 
virtual PsRenderDeviceContextCreateRenderDeviceContext (void *device, PsRenderDeviceType type)=0
 Creates a new PsRenderDeviceContext object. More...
 
virtual bool RegisterPlugin (PdfixPlugin *plugin, const wchar_t *name)=0
 
virtual PdfixPluginGetPluginByName (const wchar_t *name)=0
 
virtual PsEventGetEvent ()=0
 
virtual PsSysFontFindSysFont (const wchar_t *font_family, PdfFontFlags font_flags, PdfFontCodepage codepage)=0
 
virtual bool LoadSettingsFromStream (PsStream *settings, PsDataFormat format)=0
 Loads settings from a data file. More...
 

Detailed Description

Pdfix class.

Pdfix loads and unloads library. It initialized all necessary resources and also takes care about releasing it.

Member Function Documentation

◆ CreateCustomDigSig()

virtual PdfCustomDigSig * Pdfix::CreateCustomDigSig ( )
pure virtual

Creates a new PdfCustomDigSig object. Call PdfDigSig::Destroy method to release resources.

Returns
Initialized PdfCustomDigSig object.
See also
PdfDigSig::Destroy

◆ CreateCustomSecurityHandler()

virtual PdfCustomSecurityHandler * Pdfix::CreateCustomSecurityHandler ( const wchar_t *  name,
void *  client_data 
)
pure virtual

Creates a new PdfCustomSecurityHandler object.

Parameters
namename of the security handler filter
client_datauser supplied data that will be passed to every callback set to the custom security handler
Returns
Initialized PdfSecurityHandler object.
See also
PdfDoc::SetSecurityHandler
Pdfix::RegisterSecurityHandler
PdfSecurityHandler::Destroy

◆ CreateCustomStream()

virtual PsCustomStream * Pdfix::CreateCustomStream ( PsStreamReadProc  read_proc,
void *  client_data 
)
pure virtual

Creates a new read-only PsStream with arbitrary data-producing procedure. Call PsStream::Destroy to release all stream resources.

Parameters
read_procData producing procedure
proc_stmPointer to user object which is provided to provided PsStreamProc
Returns
Initialized PsStream object.
See also
PsStream::Destroy

◆ CreateDigSig()

virtual PdfDigSig * Pdfix::CreateDigSig ( )
pure virtual

Creates a new PdfDigSig object. Call PdfDigSig::Destroy method to release resources.

Returns
Initialized PdfDigSig object.
See also
PdfDigSig::Destroy

◆ CreateDoc()

virtual PdfDoc * Pdfix::CreateDoc ( )
pure virtual

Creates a new document. The only object in the document will be a Catalog. After the document is created, at least one page must be added using PdfDoc::CreatePage or PdfDoc::InsertPages. NOTE: You must call PdfDoc::Close once for every successful create.

Returns
The newly created document or null.
See also
PdfDoc::Close

◆ CreateFileStream()

virtual PsFileStream * Pdfix::CreateFileStream ( const wchar_t *  path,
PsFileMode  mode 
)
pure virtual

Creates a new read-only or write PsStream from PsFile. Call PsStream::Destroy to release all stream resources.

Parameters
pathPath to the file that PsStream needs to be created from.
modeFile open mode.
Returns
Initialized PsStream object.
See also
PsStream::Destroy

◆ CreateImage()

virtual PsImage * Pdfix::CreateImage ( int  width,
int  height,
PsImageDIBFormat  format 
)
pure virtual

Creates a new PsImage object. Call PsImage::Destroy to release image resources.

Parameters
widthRequested image width.
heightRequested image heught.
formatRequested image DIB format.
Returns
Initialized PsImage object.
See also
PsImage::Destroy

◆ CreateMemStream()

virtual PsMemoryStream * Pdfix::CreateMemStream ( )
pure virtual

Creates a new mempry operating PsStream. Call PsStream::Destroy to release all stream resources.

Returns
Initialized PsStream object.
See also
PsStream::Destroy

◆ CreateRegex()

virtual PsRegex * Pdfix::CreateRegex ( )
pure virtual

Creates a new PsRegex object. Call PsRegex::Destroy to release all regex resources.

Returns
Initialized PsRegex object.
See also
PsRegex::Destroy

◆ CreateRenderDeviceContext()

virtual PsRenderDeviceContext * Pdfix::CreateRenderDeviceContext ( void *  device,
PsRenderDeviceType  type 
)
pure virtual

Creates a new PsRenderDeviceContext object.

Parameters
devicePointer to the platform specific device context.
typeType of the device context.
Returns
Initialized PsRenderDeviceContext object.

◆ CreateStandardSecurityHandler()

virtual PdfStandardSecurityHandler * Pdfix::CreateStandardSecurityHandler ( const wchar_t *  user_password,
const wchar_t *  owner_password,
const PdfStandardSecurityParams params 
)
pure virtual

Creates a new PdfStandardSecurityHandler object.

Parameters
user_passworduser password that will be used to open secured the document
owner_passwordowner password that will be used to access owner rights of the document
paramspointer to the PdfStandardSecurityParams structure
Returns
Initialized PdfSecurityHandler object.
See also
PdfDoc::SetSecurityHandler
PdfSecurityHandler::Destroy

◆ Destroy()

virtual void Pdfix::Destroy ( )
pure virtual

Destroys Pdfix resources.

See also
Pdfix::CreatePdfix

◆ FindSysFont()

virtual PsSysFont * Pdfix::FindSysFont ( const wchar_t *  font_family,
PdfFontFlags  font_flags,
PdfFontCodepage  codepage 
)
pure virtual

Finds a sytem font installed on the current host system by name, font style and codepage. If the specified font is not installed on the current system or is in specified font search directory, it tries to find similar font.

Parameters
font_familyFont family of the font we are looking for.
font_flagsStyle of the font we are looking for.
codepageUse kFontDefANSICodepage for default.
Returns
Pointer to the loaded PsSysFont. nullptr in case a specified font couldn't be found.

◆ GetAccountAuthorization()

virtual PsAccountAuthorization * Pdfix::GetAccountAuthorization ( )
pure virtual

Gets the PsAccountAuthorization object.

Returns
the PsAuthorization object.

◆ GetAuthorization()

virtual PsAuthorization * Pdfix::GetAuthorization ( )
pure virtual

Gets the current PsAuthorization object.

Returns
the PsAuthorization object.

◆ GetError()

virtual const char * Pdfix::GetError ( )
pure virtual

Returns the latest error message from the library. The error message is set each time, when any library method fails.

Returns
The last error, empty string otherwise.

◆ GetErrorType()

virtual int Pdfix::GetErrorType ( ) const
pure virtual

Returns the latest error type from the library. The error type is set each time, when any library method fails.

Returns
The last error type.

◆ GetEvent()

virtual PsEvent * Pdfix::GetEvent ( )
pure virtual

Get the object of current event. Method to retrieve the event object related with the notification.

Returns
Initialized PsEvent object

◆ GetPluginByName()

virtual PdfixPlugin * Pdfix::GetPluginByName ( const wchar_t *  name)
pure virtual

Get plugin by name. Method to retrieve the plugin by name.

Parameters
namePlugin registration name
See also
Pdfix::GetPluginByName

◆ GetProductName()

virtual const char * Pdfix::GetProductName ( ) const
pure virtual

Returns the name of the product.

Returns
The product name

◆ GetProductUrl()

virtual const char * Pdfix::GetProductUrl ( ) const
pure virtual

Returns the url of the product.

Returns
The product URL

◆ GetStandardAuthorization()

virtual PsStandardAuthorization * Pdfix::GetStandardAuthorization ( )
pure virtual

Gets the PsStandardAuthorization object.

Returns
the PsStandardAuthorization object.

◆ GetVersionMajor()

virtual int Pdfix::GetVersionMajor ( ) const
pure virtual

Returns the major version. This is the first integer in a version number and is increased whenever significant changes are made.

Returns
The major version number.

◆ GetVersionMinor()

virtual int Pdfix::GetVersionMinor ( ) const
pure virtual

Returns the minor version. This is the second integer in a compound version number. This is normally set to 0 after each major release and increased whenever smaller features or significant bug fixes have been added.

Returns
The minor version number.

◆ GetVersionPatch()

virtual int Pdfix::GetVersionPatch ( ) const
pure virtual

Returns the patch version. The (optional) third integer is the patch number, sometimes also called the revision number. Changes in patch number should imply no change to the actual API interface, only changes to the behavior of the API.

Returns
The patch version number.

◆ LoadSettingsFromStream()

virtual bool Pdfix::LoadSettingsFromStream ( PsStream settings,
PsDataFormat  format 
)
pure virtual

Loads settings from a data file.

Parameters
settingsThe data file stream to load
formatFormat of the source stream. Only JSON format is supported.
Returns
true if succeeded, false otherwise.

◆ OpenDoc()

virtual PdfDoc * Pdfix::OpenDoc ( const wchar_t *  path,
const wchar_t *  password 
)
pure virtual

Opens the specified document. If the document is already open, returns a reference to the already opened PdfDoc. NOTE: You must call PdfDoc::Close once for every successful open.

Parameters
pathPath to the file.
passwordFile password. Might be null.
Returns
The newly created document or null.
See also
PdfDoc::Close

◆ OpenDocFromStream()

virtual PdfDoc * Pdfix::OpenDocFromStream ( PsStream stream,
const wchar_t *  password 
)
pure virtual

Opens the specified document from memory. If the document is already open, returns a reference to the already opened PdfDoc. You must call PdfDoc::Close once for every successful open.

Parameters
streamPsStream object.
passwordFile password. Might be null.
Returns
The newly created document or null.
See also
PdfDoc::Close

◆ ReadImageInfo()

virtual bool Pdfix::ReadImageInfo ( PsStream image_stream,
PdfImageFormat  format,
PsImageInfo info 
)
pure virtual

Reads basic image info from image data stream.

Parameters
image_streamImage data.
formatImage format.
info(Filled by the method) A pointer to a PsImageInfo structure
Returns
true if succesfull, false otherwise

◆ RegisterActionHandler()

virtual PdfActionHandler * Pdfix::RegisterActionHandler ( const wchar_t *  type)
pure virtual

Register action handler.

Parameters
typeThe type of actions that will be handled.
Returns
The action handler.

◆ RegisterAnnotHandler()

virtual PdfAnnotHandler * Pdfix::RegisterAnnotHandler ( const wchar_t *  type)
pure virtual

Register annotation handler.

Parameters
typeThe Subtype of annotations that will be handled.
Returns
The annotation handler.

◆ RegisterEvent()

virtual bool Pdfix::RegisterEvent ( PdfEventType  type,
PdfEventProc  proc,
void *  data 
)
pure virtual

Registers a user-supplied procedure to call when the specified event occurs.

Parameters
typeThe event type.
procA user-supplied callback to call when the event occurs.
dataA pointer to user-supplied data to pass to proc each time it is called.
Returns
true if event was registered, false otherwise. Sample RegisterEvent

◆ RegisterPlugin()

virtual bool Pdfix::RegisterPlugin ( PdfixPlugin plugin,
const wchar_t *  name 
)
pure virtual

Register plugin by name. Method to register plugin by name to allow other plugins to access it's functionality

Parameters
pluginThe PdfixPlugin object.
namePlugin registration name.
See also
Pdfix::GetPluginByName \reeturn truee if the plugin registration was successfull, false othrewise

◆ RegisterSecurityHandler()

virtual bool Pdfix::RegisterSecurityHandler ( PdfSecurityCreateHandlerProc  proc,
const wchar_t *  name,
void *  client_data 
)
pure virtual

Registers factory method that will create security handler when the document is initialized.

Parameters
procfactory method to create the security handler when the document is initialized
namename of the security handler filter
datauser supplied data thath will stored with the create procedure and passed to it when it will be called
Returns
Initialized PdfSecurityHandler object.
See also
Pdfix::CreateCustomSecurityHandler

◆ SetError()

virtual void Pdfix::SetError ( int  type,
const char *  error 
)
pure virtual

Sets the latest error message to the library.

Parameters
typeThe last error type.
errorThe last error.

◆ UnregisterEvent()

virtual bool Pdfix::UnregisterEvent ( PdfEventType  type,
PdfEventProc  proc,
void *  data 
)
pure virtual

Unregisters a user-supplied procedure to call when the specified event occurs. To un-register, you must use same type, proc and data that were used when the event was registered using Pdfix::RegisterEvent.

Parameters
typeThe registered event type.
procA registered user-supplied callback.
dataA pointer to registered user-supplied data.
Returns
true if event was registered, false otherwise.