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

PDEContent Does Not Contain Any Text.

Community Beginner ,
May 02, 2024 May 02, 2024

Hi,

I have a very simple pdf with one line of text. If I use the PDWordFinder the text can be iterated word for word. However, if I try to use PDEContent then it is, so far, impossible to iterate through.

The code below shows the problem, the PDEContent has one element which is not text, rather PDEObjectGetType() returns 12. Not sure what is going on - am using VS 2019 to create a 64-bit plug-in.

 

	AVDoc avDoc = AVAppGetActiveDoc();
	AVPageView pageView = AVDocGetPageView(avDoc);
	PDPageNumber	pageNum = AVPageViewGetPageNum(pageView);

	/* Bridge method to PD doc*/
	PDDoc pdDoc = AVDocGetPDDoc(avDoc);

	/* Acquire current page */
	PDPage		pdPage = PDDocAcquirePage(pdDoc, pageNum);
	PDEContent	pdeContent = PDPageAcquirePDEContent(pdPage, gExtensionID);
	ASInt32 eleNum = PDEContentGetNumElems(pdeContent);//returns 1
	PDEElement	pdeElement = PDEContentGetElem(pdeContent, 0);
	ASEnum8 test= PDEObjectGetType((PDEObject)pdeElement);//returns 12
	if (PDEObjectGetType((PDEObject)pdeElement) == kPDEText)//does not enter
	{
	}

 

TOPICS
Acrobat SDK and JavaScript
502
Translate
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

correct answers 1 Correct answer

Community Beginner , May 03, 2024 May 03, 2024

Cannot see how to edit the OP.

The element I'm getting is a Container <H2> according to the contents pane in Acrobat. Therefore extracted the contents and am now getting a PDEText. Unfortunately, there are 32 runs which at present return seemingly nonsense bytes. But that's a different problem, and this one is solved. (could neither figure out how to change title to insert 'Solved')

 

	PDEContent pdeContentTest = PDEContainerGetContent((PDEContainer)pdeElement);
	ASInt32 eleNum2 = PDEContentGetNumE
...
Translate
Community Beginner ,
May 03, 2024 May 03, 2024

Cannot see how to edit the OP.

The element I'm getting is a Container <H2> according to the contents pane in Acrobat. Therefore extracted the contents and am now getting a PDEText. Unfortunately, there are 32 runs which at present return seemingly nonsense bytes. But that's a different problem, and this one is solved. (could neither figure out how to change title to insert 'Solved')

 

	PDEContent pdeContentTest = PDEContainerGetContent((PDEContainer)pdeElement);
	ASInt32 eleNum2 = PDEContentGetNumElems(pdeContentTest);//returns 1
	PDEElement	pdeElement2 = PDEContentGetElem(pdeContentTest, 0);
	ASEnum8 test3 = PDEObjectGetType((PDEObject)pdeElement2);//returns kPDEText(1)

 

Translate
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
Community Beginner ,
May 03, 2024 May 03, 2024
LATEST
	ASInt32 eleNum2 = PDEContentGetNumElems(pdeContentTest);//returns 32

Kindly and respectfully, I would like to ask this community, how can we be ok with allowing an awfully, horrendous, substance such as the LNP-wrapped modmRNA genetic material to be injected in billions of arms????

Resistance is not futile.

Translate
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