PXC_Inst ActiveX Object

From PDF XChange PDF SDK
Jump to: navigation, search
m (Serg moved page PXC_Inst ActiveX Object to PXC_Inst ActiveX Object: Wrong symbol)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
 
 
[[Category:Editor]]
 
[[Category:Editor]]
{{#customTitle:PXС_Inst ActiveX Object}}
+
{{#customTitle:PXC_Inst ActiveX Object}}
{{#parentPage:PXV:PXV_CoClasses|PXС_Inst|interface}}
+
{{#parentPage:PXV:CoClasses|PXC_Inst|interface}}
{{ToReview}}
+
  
 
== Overview ==
 
== Overview ==
  
The main ActiveX Object of '''PDF-XChange Core API SDK''' that provides part of general functionality to work with PDF and gives access to an additional extensions of SDK.
+
The main ActiveX Object of the '''PDF-XChange Core API SDK''' that provides much of the general functionality available to work with a PDF file and offers access to additional extensions of the SDK.
  
The '''GUID''' of object is:
+
The object '''GUID''' is:
  
 
::<tt>'''{D37FFAC6-B7ED-441E-B933-19B4E57FCB60}'''</tt>
 
::<tt>'''{D37FFAC6-B7ED-441E-B933-19B4E57FCB60}'''</tt>
  
The '''interface''' of control is:
+
The '''interface''' of the control is:
  
 
::[[PXV:IPXC_Inst|IPXC_Inst]]
 
::[[PXV:IPXC_Inst|IPXC_Inst]]
Line 19: Line 17:
 
== How to Instantiate ==
 
== How to Instantiate ==
  
You may instantiate the object in standard way by using the '''CoCreateInstance''' function or by any other method that is appropriate for instantiating of regular ActiveX-objects in your programming language.
+
You usual way to instantiate the object is to use the '''CoCreateInstance''' function, however there maybe a more appropriate means instantiate an ActiveX-object in your preferred programming language and if so, this may be used.
  
 
For example, in C#:
 
For example, in C#:
Line 39: Line 37:
 
</pre>
 
</pre>
  
Also, exists other special way to get pointer to [[PXV:IPXC_Inst|IPXC_Inst]] interface. For example, in C++:
+
There exists another special way to get a pointer to the [[PXV:IPXC_Inst|IPXC_Inst]] interface. For example, using C++:
 
<pre class="brush:cpp;gutter:false">
 
<pre class="brush:cpp;gutter:false">
 
typedef HRESULT (__cdecl *t_pPXC_GetInstance)(IPXC_Inst** ppInst);
 
typedef HRESULT (__cdecl *t_pPXC_GetInstance)(IPXC_Inst** ppInst);
Line 55: Line 53:
 
</pre>
 
</pre>
  
- with this special method you will be able to use SDK ''without'' regular installation as COM-server on client machine.
+
- with this method you will be able to use the SDK ''without'' regular installation as COM-server on a client machine.
  
'''NOTE:''' in context of '''PDF-XChange Editor SDK''' this object has different GUID:  
+
'''NOTE:''' in the context of the '''PDF-XChange Editor SDK''' this object has a different GUID which is:  
 
::<tt>'''{77E64401-E3E8-4049-A630-0434E69586AA}'''</tt>
 
::<tt>'''{77E64401-E3E8-4049-A630-0434E69586AA}'''</tt>
and there you have only two ways to get access to it:
+
and we provide two specific methods to access this library:
  
* '''A.''' By using '''CoCreateInstance'''. For example, in C#:
+
* '''A.''' by using the '''CoCreateInstance'''. For example, in C#:
 
<pre class="brush:cpp;gutter:false">
 
<pre class="brush:cpp;gutter:false">
 
AxPDFXEdit.AxPXC_Inst pdfCoreInst = AxPDFXEdit.AxPXC_Inst();
 
AxPDFXEdit.AxPXC_Inst pdfCoreInst = AxPDFXEdit.AxPXC_Inst();
 
</pre>
 
</pre>
  
* '''B.''' By getting pointer to [[PXV:IPXC_Inst|IPXC_Inst]] interface as extension. For example, in C++:
+
Or
 +
 
 +
* '''B.''' by retrieving a pointer to the [[PXV:IPXC_Inst|IPXC_Inst]] interface as an extension. For example, in C#:
 
<pre class="brush:cpp;gutter:false">
 
<pre class="brush:cpp;gutter:false">
AxPDFXEdit.AxPXV_Inst pdfInst;
+
AxPDFXEdit.IPXV_Inst pdfInst;
 
...
 
...
AxPDFXEdit.AxPXC_Inst pdfCoreInst = (AxPDFXEdit.AxPXC_Inst)pdfInst.GetExtension("PXC");
+
AxPDFXEdit.IPXC_Inst pdfCoreInst = (AxPDFXEdit.IPXC_Inst)pdfInst.GetExtension("PXC");
 +
</pre>
 +
The same in C++:
 +
<pre class="brush:cpp;gutter:false">
 +
CComPtr<IPXV_Inst> spPDFInst;
 +
...
 +
CComPtr<IUnknown> spUnk;
 +
spPDFInst->GetExtension(CComBSTR(L"PXC"), &spUnk);
 +
CComQIPtr<IPXC_Inst> spPDFCoreInst = spUnk;
 
</pre>
 
</pre>
  
 
== How to Use ==
 
== How to Use ==
Firstly you need call [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] function before any use of the SDK. But, if you've created a [[PXV:PXV_Control|PXV_Control]] object before, you may not call this function, because it has already been done through the creating of PXV_Control-object. Another important point: when you finishing work with the SDK, you should call [[PXV:IPXV_Inst_Shutdown|IPXV_Inst::Shutdown]] method to release all used resources, to stop correctly all working threads, etc. But, if [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] method had not been called directly and only simple PXV_Control was used, then you may not call it. Also, in conclusion, the [[PXV:IPXV_Inst_Shutdown|IPXV_Inst::Shutdown]] method should be called the same number of times as [[PXV:IPXV_Inst_Init|IPXV_Inst::Init]] was called.
+
 
 +
If the '''PDF-XChange Core API SDK''' is used, this must be initialized by a call to the [[PXV:IPXC_Inst_Init|IPXC_Inst::Init]] method and should be finalized by a call to the [[PXV:IPXC_Inst_Finalize|IPXC_Inst::Finalize]] method.
 +
These methods will have no effect within the '''PDF-XChange Editor SDK'''.

Latest revision as of 11:33, 27 January 2016

Overview

The main ActiveX Object of the PDF-XChange Core API SDK that provides much of the general functionality available to work with a PDF file and offers access to additional extensions of the SDK.

The object GUID is:

{D37FFAC6-B7ED-441E-B933-19B4E57FCB60}

The interface of the control is:

IPXC_Inst

How to Instantiate

You usual way to instantiate the object is to use the CoCreateInstance function, however there maybe a more appropriate means instantiate an ActiveX-object in your preferred programming language and if so, this may be used.

For example, in C#:

AxPDFXCoreAPI.AxPXC_Inst pdfInst = new AxPDFXCoreAPI.AxPXC_Inst();

In VB6:

Dim pdfInst As PDFXCoreAPI.PXC_Inst
...    
Set pdfInst = New PDFXCoreAPI.PXC_Inst

In C++:

CComPtr<IPXC_Inst> spPDFInst;
HRESULT hr = CoCreateInstance(__uuidof(PXC_Inst), nullptr, CLSCTX_INPROC_SERVER, __uuidof(IPXC_Inst), (void**)&spPDFInst);

There exists another special way to get a pointer to the IPXC_Inst interface. For example, using C++:

typedef HRESULT (__cdecl *t_pPXC_GetInstance)(IPXC_Inst** ppInst);

#if defined _M_IX86
#define SDK_LIB_NAME	L"PDFXCoreAPI.x86.DLL"
#else
#define SDK_LIB_NAME	L"PDFXCoreAPI.x64.DLL"
#endif

CComPtr<IPXC_Inst> spPDFInst;
HMODULE hSDKLib = LoadLibrary(SDK_LIB_NAME);
t_pPXC_GetInstance pfn = (t_pPXC_GetInstance)GetProcAddress(hSDKLib, "PXC_GetInstance");
HRESULT hr = pfn(&spPDFInst);

- with this method you will be able to use the SDK without regular installation as COM-server on a client machine.

NOTE: in the context of the PDF-XChange Editor SDK this object has a different GUID which is:

{77E64401-E3E8-4049-A630-0434E69586AA}

and we provide two specific methods to access this library:

  • A. by using the CoCreateInstance. For example, in C#:
AxPDFXEdit.AxPXC_Inst pdfCoreInst = AxPDFXEdit.AxPXC_Inst();

Or

  • B. by retrieving a pointer to the IPXC_Inst interface as an extension. For example, in C#:
AxPDFXEdit.IPXV_Inst pdfInst;
...
AxPDFXEdit.IPXC_Inst pdfCoreInst = (AxPDFXEdit.IPXC_Inst)pdfInst.GetExtension("PXC");

The same in C++:

CComPtr<IPXV_Inst> spPDFInst;
...
CComPtr<IUnknown> spUnk;
spPDFInst->GetExtension(CComBSTR(L"PXC"), &spUnk);
CComQIPtr<IPXC_Inst> spPDFCoreInst = spUnk;

How to Use

If the PDF-XChange Core API SDK is used, this must be initialized by a call to the IPXC_Inst::Init method and should be finalized by a call to the IPXC_Inst::Finalize method. These methods will have no effect within the PDF-XChange Editor SDK.