Copy link to clipboard
Copied
Hi
i will searching Text object Containers for all the pages in the PDF Doc.
The following code Demonstrates the above functionality.
if (AVAppGetActiveDoc())
{
for (int i = iSPage; i <iEPage; i++)
{
PDPage pdpage = PDDocAcquirePage(pdDoc, i);
PDEContent pdeContent;
CString rcsTag;
pdeContent = PDPageAcquirePDEContent(pdpage, gExtensionID);
PDEElement pdeElement;
ASInt32 NumEle = PDEContentGetNumElems(pdeContent);
for (NumEle = PDEContentGetNumElems(pdeContent) - 1; NumEle >= 0; NumEle--)
{
pdeElement = PDEContentGetElem(pdeContent, NumEle);
if (PDEObjectGetType((PDEObject)pdeElement) == kPDEContainer)
{
ASAtom asaActualTag = PDEContainerGetMCTag((PDEContainer)pdeElement);
LPCSTR csActualTagvalve = ASAtomGetString(asaActualTag);
CString csActualTag = (CString)csActualTagvalve;
if (csActualTag.Find(L"ACUTAHeader") != -1 || csActualTag.Find(L"ACUTAFooter") != -1)
{
HeaderPresent = true;
}
}
}
PDPageReleasePDEContent(pdpage, gExtensionID);
PDPageRelease(pdpage);
}
}
After Searching completes, in Task manager Acrobat takes 1.5 GB memory.
for each iteration in the Loop, memory not released even one Time.
Please give some Solution about how to release memory for each iteration.
Thanks.
Have something to add?