You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize if it's just be being dumb, but to me it looks like adding and reading ink annotations is not working at all.
Both FPDFAnnotGetInkListPath and FPDFAnnotAddInkStroke should take a pointer to an array of FS_POINTF_ as the argument, but in the generated PDFiumCode.cs code the parameter is defined as global::PDFiumCore.FS_POINTF_ points and not a pointer. I manually modified the points parameter to IntPtr and after building the package both reading and adding ink annotation works.
I changed FPDFAnnotAddInkStroke from
public static int FPDFAnnotAddInkStroke(global::PDFiumCore.FpdfAnnotationT annot, global::PDFiumCore.FS_POINTF_ points, ulong point_count)
{
var __arg0 = annot is null ? __IntPtr.Zero : annot.__Instance;
var ____arg1 = points.__Instance;
var __arg1 = new __IntPtr(&____arg1);
var __ret = __Internal.FPDFAnnotAddInkStroke(__arg0, __arg1, point_count);
return __ret;
}
to
public static int FPDFAnnotAddInkStroke(global::PDFiumCore.FpdfAnnotationT annot, IntPtr points, ulong point_count)
{
var __arg0 = annot is null ? __IntPtr.Zero : annot.__Instance;
var __arg1 = points;
var __ret = __Internal.FPDFAnnotAddInkStroke(__arg0, __arg1, point_count);
return __ret;
}
and FPDFAnnotGetInkListPath from
public static uint FPDFAnnotGetInkListPath(global::PDFiumCore.FpdfAnnotationT annot, uint path_index, global::PDFiumCore.FS_POINTF_ buffer, uint length)
{
var __arg0 = annot is null ? __IntPtr.Zero : annot.__Instance;
var ____arg2 = buffer.__Instance;
var __arg2 = new __IntPtr(&____arg2);
var __ret = __Internal.FPDFAnnotGetInkListPath(__arg0, path_index, __arg2, length);
return __ret;
}
to
public static uint FPDFAnnotGetInkListPath(global::PDFiumCore.FpdfAnnotationT annot, uint path_index, IntPtr buffer, uint length)
{
var __arg0 = annot is null ? __IntPtr.Zero : annot.__Instance;
var __arg2 = buffer;
var __ret = __Internal.FPDFAnnotGetInkListPath(__arg0, path_index, __arg2, length);
return __ret;
}
I can then read and write ink paths from my client code
I apologize if it's just be being dumb, but to me it looks like adding and reading ink annotations is not working at all.
Both
FPDFAnnotGetInkListPath
andFPDFAnnotAddInkStroke
should take a pointer to an array of FS_POINTF_ as the argument, but in the generated PDFiumCode.cs code the parameter is defined asglobal::PDFiumCore.FS_POINTF_ points
and not a pointer. I manually modified the points parameter toIntPtr
and after building the package both reading and adding ink annotation works.I changed FPDFAnnotAddInkStroke from
to
and FPDFAnnotGetInkListPath from
to
I can then read and write ink paths from my client code
Please advice on how to best add these patches to the generator so I can create a pull request.
The text was updated successfully, but these errors were encountered: