The SetLicenseKey method should be called after creating an object of type CDIntfEx.Document to activate the advanced methods that require the object activation code to work properly.
System.Boolean SetLicenseKey(System.String Company, System.String LicKey)
BOOL SetLicenseKeyA(LPCSTR szCompany, LPCSTR szLicKey)
BOOL SetLicenseKeyW(LPCWSTR szCompany, LPCWSTR szLicKey)
Company, szCompany
Name of the company or public user having licensed the product.
LicKey, szLicKey
License key provided by Amyuni Technologies when downloading or purchasing a product. It should be an Ansi string for SetLicenseKeyA or a Unicode string for SetLicenseKeyW .
The return value is True if the license key is valid, False otherwise. ActiveX version sets the license key for the current document object only, while the DLL version sets it once for the program duration.
Member of CDIntfEx.Document.
Private Sub Sample()
' Constants for Activation codes
Const strLicenseTo As String = "DOCX Converter Developer Evaluation"
Const strActivationCode As String = "07EFCDAB010001002EE718DAABD90353AA8141F60B6762C695F4D5BA97F516CBE3EB407DC717EC1D28DE39A61F1ACE26924C99AFB190"
' Declare a new cdintfex document if it does not exist in the form.
Dim pdfDoc As New CDIntfEx.Document
' Open the document
pdfDoc.Open("c:\temp\test.pdf")
' The SetLicenseKey method should be called after creating an object of type
' CDIntfEx.Document to activate the advanced methods that require the object
' activation code to work properly
pdfDoc.SetLicenseKey(strLicenseTo, strActivationCode)
' Export to XPS, but the license needs to have that option
pdfDoc.ExportToDocX("c:\temp\result.docx")
' Destroy pdfDoc object
pdfDoc = Nothing
End Sub
private void Sample()
{
// Constants for Activation codes
const string strLicenseTo = "DOCX Converter Developer Evaluation";
const string strActivationCode = "07EFCDAB010001002EE718DAABD90353AA8141F60B6762C695F4D5BA97F516CBE3EB407DC717EC1D28DE39A61F1ACE26924C99AFB190";
// Declare a new cdintfex document if it does not exist in the form.
CDIntfEx.Document pdfDoc = new CDIntfEx.Document();
// Open the document
pdfDoc.Open("c:\\temp\\test.pdf");
// The SetLicenseKey method should be called after creating an object of type
// CDIntfEx.Document to activate the advanced methods that require the object
// activation code to work properly
pdfDoc.SetLicenseKey(strLicenseTo, strActivationCode);
// Export to XPS, but the license needs to have that option
pdfDoc.ExportToDocX("c:\\temp\\result.docx");
// Destroy pdfDoc object
pdfDoc = null;
}
// PDF Converter Cpp.cpp : Defines the entry point for the console application.
//
#include <Windows.h>
#include <string>
#include <iostream>
#include "CdIntf.h"
#pragma comment(lib, "CDIntf.lib")
using namespace std;
int main()
{
// Constants for Activation codes
#define strLicenseTo (LPCSTR)"DOCX Converter Developer Evaluation"
#define strActivationCode(LPCSTR)"07EFCDAB010001002EE718DAABD90353AA8141F60B6762C695F4D5BA97F516CBE3EB407DC717EC1D28DE39A61F1ACE26924C99AFB190"
// Declare a new cdintfex document if it does not exist in the form.
EXTDOCHANDLE pdfDoc;
// Open the document
LPBYTE passWord = NULL;
DocOpenA(&pdfDoc,(LPCSTR)"c:\\temp\\test.pdf", passWord);
// The SetLicenseKey method should be called after creating an object of type
// CDIntfEx.Document to activate the advanced methods that require the object
// activation code to work properly
SetLicenseKeyA(strLicenseTo, strActivationCode);
// Export to XPS, but the license needs to have that option
DocConvertToDOCXA(pdfDoc, "c:\\temp\\Appended.docx", "c:\\temp\\docxsettings.xml",1);
// Destroy pdfDoc object
pdfDoc = NULL;
return 0;
}
package Example;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class ExportToDocX {
public static void main(String[] args)
{
// Constants for Activation codes
String strLicenseTo = "DOCX Converter Developer Evaluation";
String strActivationCode = "07EFCDAB010001002EE718DAABD90353AA8141F60B6762C695F4D5BA97F516CBE3EB407DC717EC1D28DE39A61F1ACE26924C99AFB190";
// Declare a new cdintfex document if it does not exist in the form.
ActiveXComponent pdfDoc = new ActiveXComponent("CDIntfEx.Document.6.5");
// Open the document
Dispatch.call(pdfDoc, "Open", "c:\\temp\\test.pdf");
// The SetLicenseKey method should be called after creating an object of type
// CDIntfEx.Document to activate the advanced methods that require the object
// activation code to work properly
Dispatch.call(pdfDoc, "SetLicenseKey", strLicenseTo, strActivationCode);
// Export to XPS, but the license needs to have that option
Dispatch.call(pdfDoc, "ExportToDocX", "c:\\temp\\result.docx");
// Destroy pdfDoc object
pdfDoc = null;
}
}
# Constants for Activation codes
$strLicenseTo = "DOCX Converter Developer Evaluation"
$strActivationCode = "07EFCDAB010001002EE718DAABD90353AA8141F60B6762C695F4D5BA97F516CBE3EB407DC717EC1D28DE39A61F1ACE26924C99AFB190"
#Declare a new cdintfex document if it does not exist in the form.
$pdfDoc = New-Object -ComObject CDIntfEx.Document.6.5
#Open the document
[System.__ComObject].InvokeMember('Open' ,[System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,"c:\temp\test.pdf")
#The SetLicenseKey method should be called after creating an object of type
#CDIntfEx.Document to activate the advanced methods that require the object
#activation code to work properly
[System.__ComObject].InvokeMember('SetLicenseKey' ,[System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc, @($strLicenseTo, $strActivationCode))
#Export to XPS, but the license needs to have that option
[System.__ComObject].InvokeMember('ExportToDocX' ,[System.Reflection.BindingFlags]::InvokeMethod,$null,$pdfDoc,
@("c:\temp\result.docx"))
#Destroy pdfDoc object
$pdfDoc = $null
Const acXPSExportOptionsNone = 0
' Constants for Activation codes
Const strLicenseTo = "DOCX Converter Developer Evaluation"
Const strActivationCode = "07EFCDAB010001002EE718DAABD90353AA8141F60B6762C695F4D5BA97F516CBE3EB407DC717EC1D28DE39A61F1ACE26924C99AFB190"
' Declare a new cdintfex document if it does not exist in the form.
Dim pdfDoc
Set pdfDoc = CreateObject("CDIntfEx.Document.6.5")
' Open the document
pdfDoc.Open "c:\temp\test.pdf"
' The SetLicenseKey method should be called after creating an object of type
' CDIntfEx.Document to activate the advanced methods that require the object
' activation code to work properly
pdfDoc.SetLicenseKey strLicenseTo, strActivationCode
' Export to XPS, but the license needs to have that option
pdfDoc.ExportToDocX "c:\temp\result.docx"
' Destroy pdfDoc object
Set pdfDoc = Nothing