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.
Text_GetText() - Missing Method?
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.
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.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text_GetText() - Missing Method?
Hello Jesse,
Strange, I've tried doing this - everything worked fine:
Cheers,
Alex
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();
}
}
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Text_GetText() - Missing Method?
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?
I'm using CoreAPI SDK, does this method require Editor SDK?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text_GetText() - Missing Method?
Hello JesseH,
Nope, this should be the Core API method. I will double check that and will write you back.
Cheers,
Alex
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
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Text_GetText() - Missing Method?
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();
}
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text_GetText() - Missing Method?
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
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
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Text_GetText() - Missing Method?
Ok. Thanks for looking into it.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text_GetText() - Missing Method?
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ