I'm using the PDF-Tools SDK and I encounter an issue with the XCPro40 library (4.0.311.0) in a WPF project (C#/XAML) in Visual Studio 2012.
Using the "ExtractTextToOtherPDFDocument" sample of the PXCp_ET_AnalyzePageContent documentation page, the PXCp_ET_GetElement method always returns the code -2113404927 ("Invalid argument").
I first call PXCp_ET_Prepare, then PXCp_ET_AnalyzePageContent, then the PXCp_ET_GetElementCount (which returns a positive number of elements) and then PXCp_ET_GetElement:
Code: Select all
XCPro40.PXP_TextElement element;
var result = XCPro40.PXCp_ET_GetElement(_pdfId, i, out element, 1);
Code: Select all
[DllImport("xcpro40")]
public static extern int PXCp_ET_GetElement(int pDocument, int index, out PXP_TextElement pElement, int flags);
Code: Select all
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct PXP_TextElement
{
public int cbSize;
public int mask;
public short[] Characters;
public double[] Offsets;
public int Count;
public int FontIndex;
public double FontSize;
public PXC_Matrix Matrix;
public double CharSpace;
public double WordSpace;
public double Th;
public double Leading;
public double Rise;
public int FillColor;
public int StrokeColor;
public PXC_TextRenderingMode RenderingMode;
};
Am I missing something?
EDIT: I've just found that PXCp_ET_AnalyzePageContent returns the warning code 1108289444 ("End of data while parsing") for all the pdf files I've tried, maybe it's not a good thing.
Regards,
Max