I'm trying to render PDF document on Android within Mono for Android application. I'm using MuPdf library wiritten in C and have problem with invoking one C function. What I get:
System.EntryPointNotFoundException: fz_pixmap_samples
C function:
unsigned char *fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix)
{
if (!pix)
return NULL;
return pix->samples;
}
My C# wrapper:
public class APV
{
[DllImport("libmupdf.so", EntryPoint = "fz_pixmap_samples", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr fz_pixmap_samples(IntPtr ctx, IntPtr pix);
public static IntPtr GetSamples(IntPtr ctx, IntPtr pix)
{
return fz_pixmap_samples(ctx, pix);
}
}
the way I'm calling GetSamples:
APV.GetSamples(context, pix);
Function fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix) should return me pointer to bitmap data. I'm assuming mapping unsigned char * to IntPtr is not correct? Could anyone help?