• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Memory issue while performing Text Container Searching and Stamping text into 10000 Pages PDF Docume

New Here ,
Aug 08, 2024 Aug 08, 2024

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.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

34

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation