fpdf_signature_r.h
Go to the documentation of this file.
1 
25 #ifndef _FSPDF_SIGNATURE_R_H_
26 #define _FSPDF_SIGNATURE_R_H_
27 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 /*******************************************************************************/
78 /* Base Definitions for Signature */
79 /* */
80 /* Handle definitions, macro definitions */
81 /*******************************************************************************/
82 #ifndef _FSPDF_DEF_HANDLE_SIGNATURE_
83 #define _FSPDF_DEF_HANDLE_SIGNATURE_
84 
86 FSCRT_DEFINEHANDLE(FSPDF_SIGNATURE);
87 
88 #endif /* _FSPDF_DEF_HANDLE_SIGNATURE_ */
89 
90 #ifndef _FSPDF_DEF_MACRO_SIGNATURE_STATE_
91 #define _FSPDF_DEF_MACRO_SIGNATURE_STATE_
92 
98 #define FSPDF_SIGNATURE_STATE_UNKNOWN 0
99 
100 #define FSPDF_SIGNATURE_STATE_UNSIGNED 1
101 
102 #define FSPDF_SIGNATURE_STATE_VALID 2
103 
104 #define FSPDF_SIGNATURE_STATE_INVALID 3
105 
107 #endif /* _FSPDF_DEF_MACRO_SIGNATURE_STATE_ */
108 
109 #ifndef _FSPDF_DEF_MACRO_SIGNATURE_APPEARANCE_
110 #define _FSPDF_DEF_MACRO_SIGNATURE_APPEARANCE_
111 
117 #define FSPDF_SIGNATURE_APPEARANCE_FOXITFLAG 0x0001
118 
119 #define FSPDF_SIGNATURE_APPEARANCE_LABEL 0x0002
120 
121 #define FSPDF_SIGNATURE_APPEARANCE_REASON 0x0004
122 
123 #define FSPDF_SIGNATURE_APPEARANCE_DATE 0x0008
124 
125 #define FSPDF_SIGNATURE_APPEARANCE_DN 0x0010
126 
127 #define FSPDF_SIGNATURE_APPEARANCE_LOCATION 0x0020
128 
129 #define FSPDF_SIGNATURE_APPEARANCE_NAME 0x0040
130 
131 #define FSPDF_SIGNATURE_APPEARANCE_IMAGE 0x0080
132 
133 #define FSPDF_SIGNATURE_APPEARANCE_TEXT 0x0100
134 
136 #endif /* _FSPDF_DEF_MACRO_SIGNATURE_APPEARANCE_ */
137 
138 #ifndef _FSPDF_DEF_MACRO_SIGNATURE_ICONFITMODE_
139 #define _FSPDF_DEF_MACRO_SIGNATURE_ICONFITMODE_
140 
150 #define FSPDF_SIGNATURE_ICONFITMODE_NORMAL 0
151 
156 #define FSPDF_SIGNATURE_ICONFITMODE_FITFIELD 1
157 
159 #endif /* _FSPDF_DEF_MACRO_SIGNATURE_ICONFITMODE_ */
160 
161 #ifndef _FSPDF_DEF_HANDLER_SIGNATURE_
162 #define _FSPDF_DEF_HANDLER_SIGNATURE_
163 
170 typedef struct _FSPDF_SIGNATUREHANDLER
171 {
178 
195  FS_RESULT (*StartCalcDigest)(FS_LPVOID clientData, FSPDF_SIGNATURE sig, FSCRT_FILE file, const FS_DWORD* byteRangeArray, FS_DWORD sizeofArray, FS_LPVOID* context);
196 
210  FS_RESULT (*ContinueCalcDigest)(FS_LPVOID clientData, FS_LPVOID context, FSCRT_PAUSEHANDLER* pause);
211 
224  FS_RESULT (*FinishCalcDigest)(FS_LPVOID clientData, FS_LPVOID context, FSCRT_BSTR* digest);
225 
242  FS_RESULT (*Sign)(FS_LPVOID clientData, FS_LPVOID context, FSPDF_SIGNATURE sig, const FSCRT_BSTR* digest, FSCRT_BSTR* signedData);
243 
260  FS_RESULT (*Verify)(FS_LPVOID clientData, FS_LPVOID context, FSPDF_SIGNATURE sig, const FSCRT_BSTR* digest, const FSCRT_BSTR* signedData);
261 
263 
264 #endif /* _FSPDF_DEF_HANDLER_SIGNATURE_ */
265 
266 #ifndef _FSPDF_DEF_HANDLER_SIGNATUREICONPROVIDER_
267 #define _FSPDF_DEF_HANDLER_SIGNATUREICONPROVIDER_
268 
275 typedef struct _FSPDF_SIGNATUREICONPROVIDER
276 {
283 
301  FS_RESULT (*GetIcon)(FS_LPVOID clientData, FSPDF_SIGNATURE sig, FS_INT32 nState, FSCRT_BITMAP* bitmap);
302 
321  FS_RESULT (*GetIconFitMode)(FS_LPVOID clientData, FSPDF_SIGNATURE sig, FS_INT32 nState, FS_INT32* fitMode);
322 
340  FS_RESULT (*NeedRotate)(FS_LPVOID clientData, FSPDF_SIGNATURE sig, FS_INT32 nState, FS_BOOL* needRotate);
341 
343 
344 #endif /* _FSPDF_DEF_HANDLER_SIGNATUREICONPROVIDER_ */
345 
346 /*******************************************************************************/
347 /* Signature handler */
348 /*******************************************************************************/
375 FS_RESULT FSPDF_Signature_RegisterHandler(const FSCRT_BSTR* filter, const FSCRT_BSTR* subFilter, FSPDF_SIGNATUREHANDLER* sigHandler);
376 
400 
401 /*******************************************************************************/
402 /* PDF signature */
403 /*******************************************************************************/
429 FS_RESULT FSPDF_Doc_CountSignatures(FSCRT_DOCUMENT doc, FS_INT32* count);
430 
458 FS_RESULT FSPDF_Doc_GetSignature(FSCRT_DOCUMENT doc, FS_INT32 index, FSPDF_SIGNATURE* sig);
459 
489 FS_RESULT FSPDF_Signature_GetAtPos(FSCRT_PAGE page, FS_FLOAT x, FS_FLOAT y, FS_FLOAT tolerance, FSPDF_SIGNATURE* sig);
490 
491 /*******************************************************************************/
492 /* Access signature properties */
493 /*******************************************************************************/
514 FS_RESULT FSPDF_Signature_GetDoc(FSPDF_SIGNATURE sig, FSCRT_DOCUMENT* doc);
515 
536 FS_RESULT FSPDF_Signature_GetPageIndex(FSPDF_SIGNATURE sig, FS_INT32* pageIndex);
537 
561 FS_RESULT FSPDF_Signature_GetFlags(FSPDF_SIGNATURE sig, FS_DWORD* flags);
562 
588 FS_RESULT FSPDF_Signature_GetFilter(FSPDF_SIGNATURE sig, FSCRT_BSTR* filter);
589 
616 FS_RESULT FSPDF_Signature_GetSubFilter(FSPDF_SIGNATURE sig, FSCRT_BSTR* subFilter);
617 
640 FS_RESULT FSPDF_Signature_GetSigner(FSPDF_SIGNATURE sig, FSCRT_BSTR* signer);
641 
665 
690 FS_RESULT FSPDF_Signature_GetLocation(FSPDF_SIGNATURE sig, FSCRT_BSTR* location);
691 
714 FS_RESULT FSPDF_Signature_GetReason(FSPDF_SIGNATURE sig, FSCRT_BSTR* reason);
715 
740 FS_RESULT FSPDF_Signature_GetContactInfo(FSPDF_SIGNATURE sig, FSCRT_BSTR* contactInfo);
741 
765 
788 FS_RESULT FSPDF_Signature_GetText(FSPDF_SIGNATURE sig, FSCRT_BSTR* text);
789 
813 FS_RESULT FSPDF_Signature_GetBitmap(FSPDF_SIGNATURE sig, FSCRT_BITMAP* bitmap);
814 
836 FS_RESULT FSPDF_Signature_GetAppearanceFlags(FSPDF_SIGNATURE sig, FS_DWORD* apFlags);
837 
862 FS_RESULT FSPDF_Signature_CountCerts(FSPDF_SIGNATURE sig, FS_INT32* certCount);
863 
891 FS_RESULT FSPDF_Signature_GetCert(FSPDF_SIGNATURE sig, FS_INT32 index, FSCRT_BSTR* signedCert);
892 
893 /*******************************************************************************/
894 /* Verify Signature */
895 /*******************************************************************************/
928 FS_RESULT FSPDF_Signature_StartVerify(FSPDF_SIGNATURE sig, FSCRT_PROGRESS* verifyProgress);
929 
951 FS_RESULT FSPDF_Signature_GetState(FSPDF_SIGNATURE sig, FS_INT32* state);
952 
974 FS_RESULT FSPDF_Signature_IsSigned(FSPDF_SIGNATURE sig, FS_BOOL* isSigned);
975 
976 /*******************************************************************************/
977 /* Render Signature */
978 /*******************************************************************************/
1006 FS_RESULT FSPDF_RenderContext_DrawSignature(FSPDF_RENDERCONTEXT pdfRenderContext, FSCRT_RENDERER renderer, FSPDF_SIGNATURE sig);
1007 
1042 FS_RESULT FSPDF_RenderContext_StartPageSignatures(FSPDF_RENDERCONTEXT pdfRenderContext, FSCRT_RENDERER renderer,
1043  FSCRT_PAGE page, FSCRT_PROGRESS* renderProgress);
1044 
1045 
1046 
1047 #ifdef __cplusplus
1048 };
1049 #endif
1050  /* group FPDFSIGNATURE */
1052 
1053 #endif /* _FSPDF_SIGNATURE_R_H_ */
1054 
FS_RESULT FSPDF_Doc_CountSignatures(FSCRT_DOCUMENT doc, FS_INT32 *count)
Get signature count in a PDF document.
float FS_FLOAT
32-bit floating-point number, single precision.
Definition: fs_base_r.h:148
FS_RESULT FSPDF_Signature_GetState(FSPDF_SIGNATURE sig, FS_INT32 *state)
Get current state of a signature.
FS_RESULT FSPDF_Doc_GetSignature(FSCRT_DOCUMENT doc, FS_INT32 index, FSPDF_SIGNATURE *sig)
Get a signature object.
FS_RESULT FSPDF_Signature_GetDoc(FSPDF_SIGNATURE sig, FSCRT_DOCUMENT *doc)
Retrieve the PDF document object related to a specific signature.
FS_RESULT FSPDF_Signature_GetSubFilter(FSPDF_SIGNATURE sig, FSCRT_BSTR *subFilter)
Get sub filter of a signature.
unsigned int FS_DWORD
32-bit unsigned integer.
Definition: fs_base_r.h:142
Structure for Signature Icon Provider Handler.
Definition: fpdf_signature_r.h:275
FS_RESULT FSPDF_Signature_GetSigner(FSPDF_SIGNATURE sig, FSCRT_BSTR *signer)
Get signer name of a signature.
FS_RESULT FSPDF_RenderContext_StartPageSignatures(FSPDF_RENDERCONTEXT pdfRenderContext, FSCRT_RENDERER renderer, FSCRT_PAGE page, FSCRT_PROGRESS *renderProgress)
Render all signatures of a page on render context.
Structure for pause control in progressive process.
Definition: fs_base_r.h:3077
FS_RESULT FSPDF_Signature_SetIconProvider(FSPDF_SIGNATUREICONPROVIDER *iconProvider)
Set signature icon provider to Foxit PDF SDK.
FS_LPVOID clientData
User-defined data.
Definition: fpdf_signature_r.h:177
FS_RESULT FSPDF_Signature_GetBitmap(FSPDF_SIGNATURE sig, FSCRT_BITMAP *bitmap)
Get the icon bitmap in signature visual display.
FS_LPVOID clientData
User-defined data.
Definition: fpdf_signature_r.h:282
FS_RESULT FSPDF_RenderContext_DrawSignature(FSPDF_RENDERCONTEXT pdfRenderContext, FSCRT_RENDERER renderer, FSPDF_SIGNATURE sig)
Render a signature on a render context.
FS_RESULT FSPDF_Signature_GetAppearanceFlags(FSPDF_SIGNATURE sig, FS_DWORD *apFlags)
Get signature appearance flags.
int FS_INT32
32-bit signed integer.
Definition: fs_base_r.h:175
FS_RESULT FSPDF_Signature_CountCerts(FSPDF_SIGNATURE sig, FS_INT32 *certCount)
Count of certificates in the dictionary's certificate chain.
Structure for date and time.
Definition: fs_base_r.h:2018
FS_RESULT FSPDF_Signature_GetFilter(FSPDF_SIGNATURE sig, FSCRT_BSTR *filter)
Get the name of the preferred signature handler.
FS_RESULT FSPDF_Signature_GetCert(FSPDF_SIGNATURE sig, FS_INT32 index, FSCRT_BSTR *signedCert)
Get a signature certificate name from certificate chain.
FS_RESULT FSPDF_Signature_StartVerify(FSPDF_SIGNATURE sig, FSCRT_PROGRESS *verifyProgress)
Verify a signature progressively by using a signature signing handler specified by its Filter and Sub...
FS_RESULT FSPDF_Signature_IsSigned(FSPDF_SIGNATURE sig, FS_BOOL *isSigned)
Determine whether a signature is signed or not.
int FS_BOOL
Boolean type (This should be TRUE or FALSE).
Definition: fs_base_r.h:133
FS_RESULT FSPDF_Signature_GetText(FSPDF_SIGNATURE sig, FSCRT_BSTR *text)
Get the text content out of signature appearance.
FS_RESULT FSPDF_Signature_GetFlags(FSPDF_SIGNATURE sig, FS_DWORD *flags)
Get annotation flags of a signature.
FS_RESULT FSPDF_Signature_RegisterHandler(const FSCRT_BSTR *filter, const FSCRT_BSTR *subFilter, FSPDF_SIGNATUREHANDLER *sigHandler)
A third-party handler registers their handler to Foxit PDF SDK, along with its filter and sub filter...
void * FS_LPVOID
A pointer to any types.
Definition: fs_base_r.h:127
FS_RESULT FSPDF_Signature_GetPageIndex(FSPDF_SIGNATURE sig, FS_INT32 *pageIndex)
Get the index of a PDF page containing the specified signature.
FS_RESULT FSPDF_Signature_GetDateTime(FSPDF_SIGNATURE sig, FSCRT_DATETIMEZONE *dt)
Get signing time of a signature(M entry in the dictionary).
FS_RESULT FSPDF_Signature_GetContactInfo(FSPDF_SIGNATURE sig, FSCRT_BSTR *contactInfo)
Get contact information of a signature.
FS_RESULT FSPDF_Signature_GetLocation(FSPDF_SIGNATURE sig, FSCRT_BSTR *location)
Get location information of signature owner(Location entry in the dictionary).
Structure for byte string.
Definition: fs_base_r.h:611
Structure for Signature Handler.
Definition: fpdf_signature_r.h:170
FS_RESULT FSPDF_Signature_GetAtPos(FSCRT_PAGE page, FS_FLOAT x, FS_FLOAT y, FS_FLOAT tolerance, FSPDF_SIGNATURE *sig)
Get a signature object by a specific position in PDF page.
FS_RESULT FSPDF_Signature_GetDistinguishedName(FSPDF_SIGNATURE sig, FSCRT_BSTR *dn)
Get distinguished name of the signature owner.
int FS_RESULT
Result code for functions in Foxit PDF SDK.
Definition: fs_base_r.h:160
FS_RESULT FSPDF_Signature_GetReason(FSPDF_SIGNATURE sig, FSCRT_BSTR *reason)
Get signing reason of a signature.

Foxit Corporation