Code: Select all
HRESULT PXCp_TransformPage (PDFDocument pDocument, DWORD PageNumber, LPCPXC_Matrix matrix, DWORD flags);
Code: Select all
public struct PXC_Matrix
{
public double a; // | a b 0 |
public double b; // | c d 0 |
public double c; // | e f 1 |
public double d; //
public double e; // dx
public double f; // dy
};
Code: Select all
[DllImport("xcpro40")]
public static extern int PXCp_TransformPage(int pDocument, int iPageNumber, ref PXC_Matrix pMatrix, int iFlags);
Code: Select all
var TransformMatrix = new PdfXchangePro.PXC_Matrix() { a = 0.0, b = 0.0, c = 0.0, d = 0.0, e = 2.0, f = 3.0 };
if (_documentId != 0)
{
int res = PdfXchangePro.PXCp_TransformPage(_documentId, 0, ref TransformMatrix, 0x0001);
}
What is wrong? The memory for the matrix object is reserved with the new() operator. I see no reason for the exception to be thrown except of the calling parameters in C++ and C# which don't match each other (LPCPXC_Matrix matrix vs. ref PXC_Matrix pMatrix).
Thanx