The ExportToDocX and DocConvertToDOCX methods will export the printed file into the Microsoft Word DOCX format.
System.Boolean ExportToDocX(System.String FileName)
int DocConvertToDOCX(EXTDOCHANDLE edhDocument, LPCSTR FileName, LPBYTE docxSettingsXMLData, DWORD count)
FileName
Full path of resulting Word Docx file.
edhDocument
Handle Returned by DocOpen.
docxSettingsXMLData
Reserved for internal use. Default NULL.
count
Reserved for internal use. Default 0.
The return value is True if the document was converted, False otherwise.
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