litePDF C++ interface  2.0.5
Classes | Typedefs | Enumerations
litePDF Namespace Reference

Classes

class  TLitePDFException
 
class  TLitePDF
 

Typedefs

typedef void(__stdcall * MLitePDFErrorEvent )(unsigned int code, const char *msg, void *user_data)
 
typedef unsigned int(__stdcall * TLitePDFEvalFontFlagCB )(char *inout_faceName, unsigned int faceNameBufferSize, void *user_data)
 
typedef void(__stdcall * TLitePDFAppendSignatureDataFunc )(const char *bytes, unsigned int bytes_len, void *user_data)
 
typedef void(__stdcall * TLitePDFFinishSignatureFunc )(char *signature, unsigned int *signature_len, void *user_data)
 

Enumerations

enum  TLitePDFUnit {
  LitePDFUnit_Unknown = 0, LitePDFUnit_mm = 1, LitePDFUnit_10th_mm = 2, LitePDFUnit_100th_mm = 3,
  LitePDFUnit_1000th_mm = 4, LitePDFUnit_inch = 5, LitePDFUnit_10th_inch = 6, LitePDFUnit_100th_inch = 7,
  LitePDFUnit_1000th_inch = 8
}
 
enum  TLitePDFFontFlags {
  LitePDFFontFlag_Default = 0, LitePDFFontFlag_DoNotEmbed = 1, LitePDFFontFlag_EmbedComplete = 2, LitePDFFontFlag_EmbedSubset = 3,
  LitePDFFontFlag_Substitute = 4
}
 
enum  TLitePDFDrawFlags {
  LitePDFDrawFlag_None = 0, LitePDFDrawFlag_EmbedFontsNone = (1 << 4), LitePDFDrawFlag_EmbedFontsComplete = (1 << 0), LitePDFDrawFlag_EmbedFontsSubset = (1 << 1),
  LitePDFDrawFlag_SubstituteFonts = (1 << 2), LitePDFDrawFlag_CompressImagesWithJPEG = (1 << 3), LitePDFDrawFlag_ResetGraphicsState = (1 << 5)
}
 
enum  TLitePDFEncryptPermission {
  LitePDFEncryptPermission_None = 0x0, LitePDFEncryptPermission_Print = 0x00000004, LitePDFEncryptPermission_Edit = 0x00000008, LitePDFEncryptPermission_Copy = 0x00000010,
  LitePDFEncryptPermission_EditNotes = 0x00000020, LitePDFEncryptPermission_FillAndSign = 0x00000100, LitePDFEncryptPermission_Accessible = 0x00000200, LitePDFEncryptPermission_DocAssembly = 0x00000400,
  LitePDFEncryptPermission_HighPrint = 0x00000800, LitePDFEncryptPermission_All
}
 
enum  TLitePDFEncryptAlgorithm {
  LitePDFEncryptAlgorithm_None = 0, LitePDFEncryptAlgorithm_RC4V1 = 1, LitePDFEncryptAlgorithm_RC4V2 = 2, LitePDFEncryptAlgorithm_AESV2 = 4,
  LitePDFEncryptAlgorithm_AESV3 = 8
}
 
enum  TLitePDFAnnotationFlags {
  LitePDFAnnotationFlag_None = 0x0000, LitePDFAnnotationFlag_Invisible = 0x0001, LitePDFAnnotationFlag_Hidden = 0x0002, LitePDFAnnotationFlag_Print = 0x0004,
  LitePDFAnnotationFlag_NoZoom = 0x0008, LitePDFAnnotationFlag_NoRotate = 0x0010, LitePDFAnnotationFlag_NoView = 0x0020, LitePDFAnnotationFlag_Readonly = 0x0040,
  LitePDFAnnotationFlag_Locked = 0x0080, LitePDFAnnotationFlag_ToggleNoView = 0x0100, LitePDFAnnotationFlag_LockedContents = 0x0200
}
 
enum  TLitePDFAppearance { LitePDFAppearance_Normal = 0, LitePDFAppearance_Rollover = 1, LitePDFAppearance_Down = 2 }
 
enum  TLitePDFBookmarkFlags { LitePDFBookmarkFlag_None = 0x0000, LitePDFBookmarkFlag_Italic = 0x0001, LitePDFBookmarkFlag_Bold = 0x0002 }
 
enum  TLitePDFCertificationPermission { LitePDFCertificationPermission_NoPerms = 1, LitePDFCertificationPermission_FormFill = 2, LitePDFCertificationPermission_Annotations = 3 }
 
enum  TLitePDFSignatureHash { LitePDFSignatureHash_SHA1 = 1, LitePDFSignatureHash_SHA256 = 2, LitePDFSignatureHash_SHA384 = 3, LitePDFSignatureHash_SHA512 = 4 }
 

Typedef Documentation

typedef void(__stdcall * litePDF::MLitePDFErrorEvent)(unsigned int code, const char *msg, void *user_data)
typedef void(__stdcall * litePDF::TLitePDFAppendSignatureDataFunc)(const char *bytes, unsigned int bytes_len, void *user_data)

The function is used within TLitePDF::SaveToFileWithSignManual and TLitePDF::SaveToDataWithSignManual. It is called called when more data should be added to hash computation.

typedef unsigned int(__stdcall * litePDF::TLitePDFEvalFontFlagCB)(char *inout_faceName, unsigned int faceNameBufferSize, void *user_data)

A callback to evaluate what to do with the specified font. The function can be also used to rename the font, without changing the font flag. The size of the inout_faceName buffer is faceNameBufferSize and when renaming it, the written value should not be longer than faceNameBufferSize, including the nul-terminating character.

The returned value for one font name should be consistent. It's not possible to for example once request complete font embedding and the other time to request no embedding at all.

Parameters
inout_faceName[in/out] The font face name to evaluate the flag for.
faceNameBufferSizeSize of the inout_faceName buffer.
user_dataUser data provided in TLitePDF::SetEvalFontFlagCallback.
Returns
One of TLitePDFFontFlags.
typedef void(__stdcall * litePDF::TLitePDFFinishSignatureFunc)(char *signature, unsigned int *signature_len, void *user_data)

The function is used within TLitePDF::SaveToFileWithSignManual and TLitePDF::SaveToDataWithSignManual. It is called when all the data are processed, and the signature value is required. The signature_len contains size of the signature buffer. The callback is responsible to populate signature and signature_len with correct values. Set signature_len to zero on any error. Note the callback is called only once.

Enumeration Type Documentation

Enumerator
LitePDFAnnotationFlag_None 

Default annotation flags

LitePDFAnnotationFlag_Invisible 

Do not show nonstandard annotation if there is no annotation handler available

LitePDFAnnotationFlag_Hidden 

Do not allow show, print or interact with the annotation

LitePDFAnnotationFlag_Print 

Print the annotation

LitePDFAnnotationFlag_NoZoom 

Do not scale the annotation's appearance to match the magnification of the page

LitePDFAnnotationFlag_NoRotate 

Do not rotate the annotation's appearance to match the rotation of the page

LitePDFAnnotationFlag_NoView 

Do not display the annotation on the screen or allow it to interact with the user

LitePDFAnnotationFlag_Readonly 

Do not allow the annotation to interact with the user

LitePDFAnnotationFlag_Locked 

Do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user

LitePDFAnnotationFlag_ToggleNoView 

Invert the interpretation of the NoView flag for certain events

LitePDFAnnotationFlag_LockedContents 

Do not allow the contents of the annotation to be modified by the user

Enumerator
LitePDFAppearance_Normal 

Normal appearance

LitePDFAppearance_Rollover 

Rollover appearance; the default is the normal appearance

LitePDFAppearance_Down 

Down appearance; the default is the normal appearance

Enumerator
LitePDFBookmarkFlag_None 

Default bookmark flags

LitePDFBookmarkFlag_Italic 

Show bookmark title as an italic text

LitePDFBookmarkFlag_Bold 

Show bookmark title as a bold text

Enumerator
LitePDFCertificationPermission_NoPerms 

No changes to the document are permitted; any change to the document invalidates the signature.

LitePDFCertificationPermission_FormFill 

Permitted changes are filling in forms, instantiating page templates, and signing; other changes invalidate the signature.

LitePDFCertificationPermission_Annotations 

Permitted changes are the same as for LitePDFCertificationPermission_FormFill, as well as annotation creation, deletion, and modification; other changes invalidate the signature.

Enumerator
LitePDFDrawFlag_None 

None draw flags

LitePDFDrawFlag_EmbedFontsNone 

Do not embed any fonts into resulting PDF.

Note
: Fonts' subset is embeded by default, if none of the LitePDFDrawFlag_EmbedFontsNone, LitePDFDrawFlag_EmbedFontsComplete, LitePDFDrawFlag_EmbedFontsSubset, flags is defined; the LitePDFDrawFlag_EmbedFontsNone is to override default font embedding. The reason for this default embedding is due to PDF readers not showing correct fonts when they are not part of the PDF file.
See Also
LitePDFDrawFlag_EmbedFontsComplete, LitePDFDrawFlag_EmbedFontsSubset
LitePDFDrawFlag_EmbedFontsComplete 

Embed complete fonts into resulting PDF;

See Also
LitePDFDrawFlag_EmbedFontsSubset, LitePDFDrawFlag_EmbedFontsNone
LitePDFDrawFlag_EmbedFontsSubset 

Embed only subset of the fonts, aka used letters; this flag is used before LitePDFDrawFlag_EmbedFontsComplete;

See Also
LitePDFDrawFlag_EmbedFontsNone
LitePDFDrawFlag_SubstituteFonts 

Substitute fonts with base PDF fonts, if possible

LitePDFDrawFlag_CompressImagesWithJPEG 

Compress images with JPEG compression, to get smaller PDF document; this is used only for RGB images

LitePDFDrawFlag_ResetGraphicsState 

Try to reset graphics state before appending new content to the page. This covers leftover saved states and the transformation matrix

Enumerator
LitePDFEncryptAlgorithm_None 

No encryption algorithm; it can be used only when unsetting prepared encryption

LitePDFEncryptAlgorithm_RC4V1 

RC4 Version 1 encryption using a 40bit key

LitePDFEncryptAlgorithm_RC4V2 

RC4 Version 2 encryption using a 128bit key

LitePDFEncryptAlgorithm_AESV2 

AES encryption with a 128 bit key (PDF1.6)

LitePDFEncryptAlgorithm_AESV3 

AES encryption with a 256 bit key (PDF1.7 extension 3)

Enumerator
LitePDFEncryptPermission_None 

Nothing from the rest is allowed

LitePDFEncryptPermission_Print 

Allow printing the document

LitePDFEncryptPermission_Edit 

Allow modifying the document besides annotations, form fields or changing pages

LitePDFEncryptPermission_Copy 

Allow text and graphic extraction

LitePDFEncryptPermission_EditNotes 

Add or modify text annotations or form fields (if ePdfPermissions_Edit is set also allow to create interactive form fields including signature)

LitePDFEncryptPermission_FillAndSign 

Fill in existing form or signature fields

LitePDFEncryptPermission_Accessible 

Extract text and graphics to support user with disabilities

LitePDFEncryptPermission_DocAssembly 

Assemble the document: insert, create, rotate delete pages or add bookmarks

LitePDFEncryptPermission_HighPrint 

Print a high resolution version of the document

LitePDFEncryptPermission_All 

Shortcut for all permissions

Enumerator
LitePDFFontFlag_Default 

Use the settings as specified by the draw operation

LitePDFFontFlag_DoNotEmbed 

Do not embed the font

LitePDFFontFlag_EmbedComplete 

Embed complete font

LitePDFFontFlag_EmbedSubset 

Embed the font with used characters only

LitePDFFontFlag_Substitute 

Substitute the font with one of the base fonts, if possible

Enumerator
LitePDFSignatureHash_SHA1 

Use SHA1 hash algorithm

LitePDFSignatureHash_SHA256 

Use SHA256 hash algorithm

LitePDFSignatureHash_SHA384 

Use SHA384 hash algorithm

LitePDFSignatureHash_SHA512 

Use SHA512 hash algorithm

Enumerator
LitePDFUnit_Unknown 

Unknown unit; usually used to indicate an error

LitePDFUnit_mm 

Millimeters unit

LitePDFUnit_10th_mm 

1/10th of a millimeter unit; 5 mm is value 50

LitePDFUnit_100th_mm 

1/100th of a millimeter unit; 5 mm is value 500

LitePDFUnit_1000th_mm 

1/1000th of a millimeter unit; 5 mm is value 5000

LitePDFUnit_inch 

Inch unit

LitePDFUnit_10th_inch 

1/10th of an inch unit; 5" is value 50

LitePDFUnit_100th_inch 

1/100th of an inch unit; 5" is value 500

LitePDFUnit_1000th_inch 

1/1000th of an inch unit; 5" is value 5000