This is a DLL only method that should be used to Close an open document, thus releasing associated resources.
int DocClose(EXTDOCHANDLE edhDocument)
edhDocument
Handle Returned by DocOpen.
The return value is zero if the DocClose method succeed. If the DocClose method fails, a negative value will returned.
The DocClose Method must be used to close and destroy the Document object opened by DocOpen Method. Otherwise, it creates memory leaks.
Member of CDIntfEx.Document.
// 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 "Amyuni PDF Converter Evaluation"
#define strActivationCode "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"
// Declare a new cdintfex document if it does not exist in the form.
EXTDOCHANDLE pdfDoc;
// Open the document
LPBYTE passWord = nullptr;
DocOpenA(&pdfDoc, "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);
// CLose Document
DocClose(pdfDoc);
// Destroy pdfDoc object
DocClose(pdfDoc);
pdfDoc = nullptr;
return 0;
}