PDFix SDK  6.12.0
Pdfix Struct Referenceabstract

Pdfix class. More...

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 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 *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 *data)=0
 Registers factory method that will create security handler when the document is initialized. 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 PsImageCreateImage (int width, int height, PsImageDIBFormat format)=0
 
virtual bool RegisterPlugin (PdfixPlugin *plugin, const wchar_t *name)=0
 
virtual PdfixPluginGetPluginByName (const wchar_t *name)=0
 
virtual PsEventGetEvent ()=0
 
virtual PsCommandCreateCommand (const wchar_t *name)=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

◆ CreateCommand()

virtual PsCommand* Pdfix::CreateCommand ( const wchar_t *  name)
pure virtual

Creates a new command of the specified type. Call PsCommand::Destroy to destroy the specified command and its associated resources.

Parameters
nameThe new command's type name.
Returns
Initialized PsCommand object.
See also
PsCommand::Destroy

◆ 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

◆ CreateStandardSecurityHandler()

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

Creates a new PdfStandardSecurityHandler object.

Parameters
passwordpassword that will be used to protect 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 sytem by name, font style and codepage. If the specified font is not installed on the current system, 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

◆ 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

◆ 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 *  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.