Quote Originally Posted by fafalone View Post
One thing of interest, all the VB6 samples didn't have save functionality. I wasn't positive on how to implement it at first; it uses a very VB/tB unfriendly method:
Code:
typedef struct FPDF_FILEWRITE_ {

  int version;

  int (*WriteBlock)(struct FPDF_FILEWRITE_* pThis,
                    const void* pData,
                    unsigned long size);
} FPDF_FILEWRITE;

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SaveAsCopy(FPDF_DOCUMENT document,
                                                    FPDF_FILEWRITE* pFileWrite,
                                                    FPDF_DWORD flags);
Functions in UDTs defined like that isn't something you usually see. pdfium makes you write your own write function.
Would have to disagree on this.
Any C-Sourcecode i've seen had those.
In a nutshell: It's C's "try" to "offer" something like Class-Methods we're used to from vb6, with one difference:
It allows you to write your own Procedure/Function, and as you pointed out: pdfium EXPECTS you to do that, which in the end "translates" to a callback, since you're just passing a pointer to the function