Resource Base
Table of contents

Result Methods

Method Description
DDN_FreeDetectedQuadResultArray Releases memory allocated for DetectedQuadResultArray.
DDN_FreeNormalizedImageResult Releases memory allocated for NormalizedImageResult.
DDN_FreeString Releases memory allocated for a string.
NormalizedImageResult_SaveToFile Save the normalized image result to a file.

DDN_FreeDetectedQuadResultArray

Releases memory allocated for DetectedQuadResultArray.

void DDN_FreeDetectedQuadResultArray(DetectedQuadResultArray** results)

Parameters

[in] results An array of all detected quad results that needs to be released.

Code Snippet

DetectedQuadResultArray* detectedQuadResultArray = NULL;
void* ddn = DDN_CreateInstance();
DDN_DetectQuadFromFile(ddn, "YOUR-SOURCE-FILE-PATH", "", &detectedQuadResultArray);
//...do something with the detectedQuadResultArray
if (detectedQuadResultArray != NULL)
    DDN_FreeDetectedQuadResultArray(&detectedQuadResultArray);
DDN_DestroyInstance(ddn);

DDN_FreeNormalizedImageResult

Releases memory allocated for NormalizedImageResult.

void DDN_FreeNormalizedImageResult(NormalizedImageResult** result)

Parameters

[in] result The normalized image result that needs to be released.

Code Snippet

NormalizedImageResult* normalizedResult = NULL;
void* ddn = DDN_CreateInstance();
DDN_NormalizeFile(ddn, "YOUR-SOURCE-FILE-PATH", "", NULL, &normalizedResult);
//...do something with the normalizedResult
if (normalizedResult != NULL)
    DDN_FreeNormalizedImageResult(&normalizedResult);
DDN_DestroyInstance(ddn);

DDN_FreeString

Releases memory allocated for a string.

void DDN_FreeString(char** content)

Parameters

[in] content The string that needs to be released.

Code Snippet

void* ddn = DDN_CreateInstance();
char* content = NULL;
DDN_OutputRuntimeSettingsToString(ddn, "", &content);
//...do something with the content
if (content != NULL)
    DDN_FreeString(&content);
DDN_DestroyInstance(ddn);

NormalizedImageResult_SaveToFile

Save the normalized image result to a file.

int NormalizedImageResult_SaveToFile(const NormalizedImageResult* normalizedImageResult, const char* filePath)

Parameters

[in] normalizedImageResult The NormalizedImageResult that needs to be saved.

[in] filePath The path of the output image with the extension specifying the image format. It supports BMP, PNG, JPEG and PDF file types. If the target file exists, the image will be appended to the last page of the PDF file while the BMP, PNG and JPEG file will be replaced.

Return Value

Returns error code (returns 0 if the function operates successfully).

You can call DC_GetErrorString to get detailed error message.

Code Snippet

NormalizedImageResult* normalizedResult = NULL;
void* ddn = DDN_CreateInstance();
DDN_NormalizeFile(ddn, "YOUR-SOURCE-FILE-PATH", "", NULL, &normalizedResult);
if (normalizedResult != NULL)
{
    NormalizedImageResult_SaveToFile(normalizedResult, "YOUR-TARGET-FILE-PATH");
    DDN_FreeNormalizedImageResult(&normalizedResult);
}
DDN_DestroyInstance(ddn);

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version(2.2.10)
  • Version 2.x
    • Version 2.2.0
    • Version 2.0.20
    • Version 2.0.10
    • Version 2.0.0
  • Version 1.x
    • Version 1.0.20
    • Version 1.0.10
    • Version 1.0.0
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support