Skip to main content
Participant
May 2, 2024
Answered

PDEContent Does Not Contain Any Text.

  • May 2, 2024
  • 1 reply
  • 688 views

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
	{
	}

 

This topic has been closed for replies.
Correct answer Whack370904526ijt

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)

 

1 reply

Whack370904526ijtAuthorCorrect answer
Participant
May 3, 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)

 

Participant
May 3, 2024
	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.