Text_GetText() - Missing Method?

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
JesseH
User
Posts: 18
Joined: Fri Jul 22, 2016 8:47 pm
Location: TN

Text_GetText() - Missing Method?

Post by JesseH »

Hi. I'm trying to use the method documented here:
https://sdkhelp.pdf-xchange.com/vie ... xt_GetText

I'm using C# and Visual Studio doesn't recognize it as a method. The code I'm currently working needs to analyze the text from hundreds of documents and be able to identify errors in the content (based on a ruleset read from xml), and doing so requires being able to access the text based on the location on the page.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Text_GetText() - Missing Method?

Post by Sasha - Tracker Dev Team »

Hello Jesse,

Strange, I've tried doing this - everything worked fine:

Code: Select all

PDFXEdit.IPXC_Content content = pdfCtl.Doc.CoreDoc.Pages[0].GetContent(PDFXEdit.PXC_ContentAccessMode.CAccessMode_Readonly);
string str;
for (uint i = 0; i < content.Items.Count; i++)
{
	PDFXEdit.IPXC_ContentItem ci = content.Items[i];
	//For example we will take all of the text items
	if (ci.Type == PDFXEdit.PXC_CIType.CIT_Text)
	{
		str = ci.Text_GetText();
	}
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
JesseH
User
Posts: 18
Joined: Fri Jul 22, 2016 8:47 pm
Location: TN

Re: Text_GetText() - Missing Method?

Post by JesseH »

Change the variable names, add some logging, and you pretty much have the same code I'm working with. The method doesn't appear in the object browser.

I'm using CoreAPI SDK, does this method require Editor SDK?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Text_GetText() - Missing Method?

Post by Sasha - Tracker Dev Team »

Hello JesseH,

Nope, this should be the Core API method. I will double check that and will write you back.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
JesseH
User
Posts: 18
Joined: Fri Jul 22, 2016 8:47 pm
Location: TN

Re: Text_GetText() - Missing Method?

Post by JesseH »

In the meantime, I've written a workaround that seems to work:

Code: Select all

static public string GetContentText(IPXC_ContentItem pSrcContent)
        {
            StringBuilder sRet = new StringBuilder(); ;
            Array oByteBuffer;

            pSrcContent.Text_GetDataSA(out oByteBuffer);
            var oByteList = oByteBuffer.OfType<byte>().ToList();

            for (int i = 0; i < oByteList.Count(); i++)
            {
                sRet.Append((char)oByteList[i]);
            }

            return sRet.ToString();
        }
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Text_GetText() - Missing Method?

Post by Sasha - Tracker Dev Team »

Hello JesseH,

I've investigated the issue - this and some other methods, that will be available from the next release, were already uploaded into our wiki.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
JesseH
User
Posts: 18
Joined: Fri Jul 22, 2016 8:47 pm
Location: TN

Re: Text_GetText() - Missing Method?

Post by JesseH »

Ok. Thanks for looking into it.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Text_GetText() - Missing Method?

Post by Sasha - Tracker Dev Team »

:wink:
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply