C++ API Interface (litePDF.h)

    1 /*
    2  * (c) 2013-2017 http://www.litePDF.cz
    3  *
    4  * This software is provided by the litePDF project ``as is'' and any
    5  * expressed or implied warranties, including, but not limited to, the
    6  * implied warranties of merchantability and fitness for a particular
    7  * purpose are disclaimed. In no event shall the litePDF project or
    8  * its contributors be liable for any direct, indirect, incidental,
    9  * special, exemplary, or consequential damages (including, but
   10  * not limited to, procurement of substitute goods or services;
   11  * loss of use, data, or profits; or business interruption)
   12  * however caused and on any theory of liability, whether in contract,
   13  * strict liability, or tort (including negligence or otherwise)
   14  * arising in any way out of the use of this software, even if advised
   15  * of the possibility of such damage.
   16  * 
   17  * Permission is granted to anyone to use this software for any purpose,
   18  * including commercial applications, and to alter it and redistribute it
   19  * freely. The origin of this software must not be misrepresented; you must
   20  * not claim that you wrote the original software. If you use this software
   21  * in a product, an acknowledgment in the product documentation would be
   22  * appreciated but is not required.
   23  */
   24 
   25 //---------------------------------------------------------------------------
   26 #ifndef litePDFH
   27 #define litePDFH
   28 //---------------------------------------------------------------------------
   29 
   30 #include <windows.h>
   31 #include <string>
   32 
   33 /** @mainpage litePDF
   34 litePDF is a library (DLL), which allows creating new and editing of existing PDF documents with simple API.
   35 Page content is drawn with standard GDI functions through a device context (HDC or TCanvas, in case of Delphi or C++ Builder).<br>
   36 <br>
   37 Main features of litePDF:
   38 <ul>
   39 <li>create new PDF documents in memory only, or with direct write to a disk</li>
   40 <li>load of existing PDF documents</li>
   41 <li>modify or delete of existing pages</li>
   42 <li>copy pages from other documents</li>
   43 <li>incremental update of PDF documents</li>
   44 <li>encryption of PDF documents</li>
   45 <li>digitally sign PDF documents</li>
   46 <li>draw with GDI functions both directly to a page, and to a resource/template (XObject)</li>
   47 <li>draw of created resources into a page</li>
   48 <li>font embedding, complete or subset</li>
   49 <li>font substitution</li>
   50 <li>JPEG compression for images</li>
   51 <li>attach files into PDF documents</li>
   52 <li>low-level PDF operations</li>
   53 </ul>
   54 <br>
   55 litePDF uses an Open Source project <a href="http://podofo.sf.net">PoDoFo</a> for manipulation of PDF documents,
   56 and offers direct PdfDocument pointer to the PoDoFo interface, thus the library users can do anything what the PoDoFo
   57 offers.
   58 */
   59 
   60 /** @file litePDF.h
   61     @brief C++ interface
   62 
   63     This document describes a C++ interface for litePDF.dll API.
   64  */
   65 
   66 namespace litePDF {
   67 
   68 /** @page units Units
   69 Since litePDF 1.2.0.0 the functions which used millimeters as their measure
   70 units can use also inches, or fractions of the millimeters and inches
   71 (see @ref TLitePDFUnit). The reason for the fraction is to not use
   72 architectural dependent types in the API, where the @a double type is.
   73 The unit value is rounded down to unsigned integers in the API. The default
   74 unit is set to millimeters (@ref LitePDFUnit_mm) for backward compatibility.<br>
   75 <br>
   76 Call @ref TLitePDF::GetUnit to determine which unit is currently used. To
   77 change the unit to be used call @ref TLitePDF::SetUnit. For example, to
   78 create a page of size 8.5 inches x 11.0 inches, set the unit
   79 to @ref LitePDFUnit_10th_inch and then call the @ref TLitePDF::AddPage
   80 with the width 85 and height 110 (10-times larger, because the current
   81 unit is 1/10th of an inch).<br>
   82 <br>
   83 To make the calculations easier, the @ref TLitePDF::MMToUnit and
   84 @ref TLitePDF::InchToUnit functions were added, which recalculate
   85 the passed-in value in millimeters, respectively inches, to the currently
   86 set unit, while the rounding to integer values is left for the caller.
   87 There are also the inverse functions, @ref TLitePDF::UnitToMM and
   88 @ref TLitePDF::UnitToInch.<br>
   89 <br>
   90 All functions use the unit set for the current context, except of
   91 the @ref TLitePDF::DrawResource, which has an explicit argument for the unit
   92 value. That's for simplicity, to not need to change the units before
   93 the function is called and then set it back after the call. Similar helper
   94 functions @ref TLitePDF::MMToUnitEx and @ref TLitePDF::InchToUnitEx
   95 are available.<br>
   96 <br>
   97 @note The rounding down from @a double to @a unsigned @a int can suffer
   98 of the @a double precision error, thus it's a good idea to add a little
   99 fraction to the returned values from the conversion helper functions
  100 before the rounding. The @a unitvalues example adds 0.1 to the returned
  101 value from the @ref TLitePDF::MMToUnit to ensure the value will be rounded
  102 "up" in case the @a double precision error makes the value slightly smaller
  103 than it is supposed to be (considered double precision error is around 1e-9).
  104 */
  105 
  106 extern const char *LitePDFAuthorizationKey; /**< assign your litePDF authorization key to this variable */
  107 
  108 #define LitePDF_API_Major 1 /**< LitePDF API version Major part; @see LitePDF_API_Minor */
  109 #define LitePDF_API_Minor 3 /**< LitePDF API version Minor part; @see LitePDF_API_Major */
  110 
  111 typedef void (__stdcall *MLitePDFErrorEvent)(unsigned int code, const char *msg, void *user_data);
  112 
  113 typedef void (__stdcall *TLitePDFAppendSignatureDataFunc)(const char *bytes, unsigned int bytes_len, void *user_data);
  114 /**<
  115    The function is used within @ref TLitePDF::SaveToFileWithSignManual and @ref TLitePDF::SaveToDataWithSignManual.
  116    It is called called when more data should be added to hash computation.
  117 */
  118 
  119 typedef void (__stdcall *TLitePDFFinishSignatureFunc)(char *signature, unsigned int *signature_len, void *user_data);
  120 /**<
  121    The function is used within @ref TLitePDF::SaveToFileWithSignManual and @ref TLitePDF::SaveToDataWithSignManual.
  122    It is called when all the data are processed, and the signature value is required.
  123    The @a signature_len contains size of the @a signature buffer. The callback is
  124    responsible to populate @a signature and @a signature_len with correct values.
  125    Set @a signature_len to zero on any error. Note the callback is called only once.
  126 */
  127 
  128 class TLitePDFException
  129 {
  130  private:
  131    DWORD code;
  132    char *msg;
  133  public:
  134    TLitePDFException(DWORD pCode, const char *pMsg);
  135    TLitePDFException(const TLitePDFException &src);
  136    virtual ~TLitePDFException();
  137 
  138    DWORD getCode(void) const;
  139    /**<
  140       @return Error code.
  141    */
  142 
  143    const char *getMessage(void) const;
  144    /**<
  145       @return Error message.
  146    */
  147 };
  148 //---------------------------------------------------------------------------
  149 
  150 typedef enum {
  151    LitePDFUnit_Unknown     = 0, /**< Unknown unit; usually used to indicate an error */
  152    LitePDFUnit_mm          = 1, /**< Millimeters unit */
  153    LitePDFUnit_10th_mm     = 2, /**< 1/10th of a millimeter unit; 5 mm is value 50 */
  154    LitePDFUnit_100th_mm    = 3, /**< 1/100th of a millimeter unit; 5 mm is value 500 */
  155    LitePDFUnit_1000th_mm   = 4, /**< 1/1000th of a millimeter unit; 5 mm is value 5000 */
  156    LitePDFUnit_inch        = 5, /**< Inch unit */
  157    LitePDFUnit_10th_inch   = 6, /**< 1/10th of an inch unit; 5" is value 50 */
  158    LitePDFUnit_100th_inch  = 7, /**< 1/100th of an inch unit; 5" is value 500 */
  159    LitePDFUnit_1000th_inch = 8  /**< 1/1000th of an inch unit; 5" is value 5000 */
  160 } TLitePDFUnit;
  161 
  162 //---------------------------------------------------------------------------
  163 
  164 typedef enum {
  165    LitePDFDrawFlag_None                   = 0,        /**< None draw flags */
  166    LitePDFDrawFlag_EmbedFontsNone         = (1 << 4), /**< Do not embed any fonts into resulting PDF.
  167    @note: Fonts' subset is embeded by default, if none of the @ref LitePDFDrawFlag_EmbedFontsNone, @ref LitePDFDrawFlag_EmbedFontsComplete, @ref LitePDFDrawFlag_EmbedFontsSubset,
  168       flags is defined; the @ref LitePDFDrawFlag_EmbedFontsNone is to override default font embedding. The reason for this default embedding is
  169       due to PDF readers not showing correct fonts when they are not part of the PDF file.
  170       @see LitePDFDrawFlag_EmbedFontsComplete, LitePDFDrawFlag_EmbedFontsSubset */
  171    LitePDFDrawFlag_EmbedFontsComplete     = (1 << 0), /**< Embed complete fonts into resulting PDF; @see LitePDFDrawFlag_EmbedFontsSubset, LitePDFDrawFlag_EmbedFontsNone */
  172    LitePDFDrawFlag_EmbedFontsSubset       = (1 << 1), /**< Embed only subset of the fonts, aka used letters; this flag is used before @ref LitePDFDrawFlag_EmbedFontsComplete; @see LitePDFDrawFlag_EmbedFontsNone */
  173    LitePDFDrawFlag_SubstituteFonts        = (1 << 2), /**< Substitute fonts with base PDF fonts, if possible */
  174    LitePDFDrawFlag_CompressImagesWithJPEG = (1 << 3)  /**< Compress images with JPEG compression, to get smaller PDF document; this is used only for RGB images */
  175 } TLitePDFDrawFlags;
  176 
  177 //---------------------------------------------------------------------------
  178 
  179 typedef enum {
  180    LitePDFEncryptPermission_None        = 0x0,          /**< Nothing from the rest is allowed */
  181    LitePDFEncryptPermission_Print       = 0x00000004,   /**< Allow printing the document */
  182    LitePDFEncryptPermission_Edit        = 0x00000008,   /**< Allow modifying the document besides annotations, form fields or changing pages */
  183    LitePDFEncryptPermission_Copy        = 0x00000010,   /**< Allow text and graphic extraction */
  184    LitePDFEncryptPermission_EditNotes   = 0x00000020,   /**< Add or modify text annotations or form fields (if ePdfPermissions_Edit is set also allow to create interactive form fields including signature) */
  185    LitePDFEncryptPermission_FillAndSign = 0x00000100,   /**< Fill in existing form or signature fields */
  186    LitePDFEncryptPermission_Accessible  = 0x00000200,   /**< Extract text and graphics to support user with disabilities */
  187    LitePDFEncryptPermission_DocAssembly = 0x00000400,   /**< Assemble the document: insert, create, rotate delete pages or add bookmarks */
  188    LitePDFEncryptPermission_HighPrint   = 0x00000800,   /**< Print a high resolution version of the document */
  189    LitePDFEncryptPermission_All         = LitePDFEncryptPermission_Print |
  190                                           LitePDFEncryptPermission_Edit |
  191                                           LitePDFEncryptPermission_Copy |
  192                                           LitePDFEncryptPermission_EditNotes |
  193                                           LitePDFEncryptPermission_FillAndSign |
  194                                           LitePDFEncryptPermission_Accessible |
  195                                           LitePDFEncryptPermission_HighPrint /**< Shortcut for all permissions */
  196 
  197 } TLitePDFEncryptPermission;
  198 
  199 //---------------------------------------------------------------------------
  200 
  201 typedef enum {
  202    LitePDFEncryptAlgorithm_None  = 0, /**< No encryption algorithm; it can be used only when unsetting prepared encryption */
  203    LitePDFEncryptAlgorithm_RC4V1 = 1, /**< RC4 Version 1 encryption using a 40bit key */
  204    LitePDFEncryptAlgorithm_RC4V2 = 2, /**< RC4 Version 2 encryption using a 128bit key */
  205    LitePDFEncryptAlgorithm_AESV2 = 4, /**< AES encryption with a 128 bit key (PDF1.6) */
  206    LitePDFEncryptAlgorithm_AESV3 = 8  /**< AES encryption with a 256 bit key (PDF1.7 extension 3) */
  207 } TLitePDFEncryptAlgorithm;
  208 
  209 //---------------------------------------------------------------------------
  210 
  211 #define LitePDFDocumentInfo_Author           "Author"       /**< an Author of the document */
  212 #define LitePDFDocumentInfo_Creator          "Creator"      /**< a Creator of the document */
  213 #define LitePDFDocumentInfo_Keywords         "Keywords"     /**< the Keywords of the document */
  214 #define LitePDFDocumentInfo_Subject          "Subject"      /**< a Subject of the document */
  215 #define LitePDFDocumentInfo_Title            "Title"        /**< a Title of the document */
  216 #define LitePDFDocumentInfo_Producer         "Producer"     /**< a Producer of the document; this key is read-only */
  217 #define LitePDFDocumentInfo_Trapped          "Trapped"      /**< a trapping state of the document */
  218 #define LitePDFDocumentInfo_CreationDate     "CreationDate" /**< a date of the creation of the document */
  219 #define LitePDFDocumentInfo_ModificationDate "ModDate"      /**< a date of the last modification of the document */
  220 
  221 //---------------------------------------------------------------------------
  222 
  223 typedef enum {
  224    LitePDFAnnotationFlag_None           = 0x0000, /**< Default annotation flags */
  225    LitePDFAnnotationFlag_Invisible      = 0x0001, /**< Do not show nonstandard annotation if there is no annotation handler available */
  226    LitePDFAnnotationFlag_Hidden         = 0x0002, /**< Do not allow show, print or interact with the annotation */
  227    LitePDFAnnotationFlag_Print          = 0x0004, /**< Print the annotation */
  228    LitePDFAnnotationFlag_NoZoom         = 0x0008, /**< Do not scale the annotation's appearance to match the magnification of the page */
  229    LitePDFAnnotationFlag_NoRotate       = 0x0010, /**< Do not rotate the annotation's appearance to match the rotation of the page */
  230    LitePDFAnnotationFlag_NoView         = 0x0020, /**< Do not display the annotation on the screen or allow it to interact with the user */
  231    LitePDFAnnotationFlag_Readonly       = 0x0040, /**< Do not allow the annotation to interact with the user */
  232    LitePDFAnnotationFlag_Locked         = 0x0080, /**< Do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user */
  233    LitePDFAnnotationFlag_ToggleNoView   = 0x0100, /**< Invert the interpretation of the NoView flag for certain events */
  234    LitePDFAnnotationFlag_LockedContents = 0x0200  /**< Do not allow the contents of the annotation to be modified by the user */
  235 } TLitePDFAnnotationFlags;
  236 
  237 //---------------------------------------------------------------------------
  238 
  239 typedef enum {
  240    LitePDFAppearance_Normal =   0, /**< Normal appearance */
  241    LitePDFAppearance_Rollover = 1, /**< Rollover appearance; the default is the normal appearance */
  242    LitePDFAppearance_Down =     2  /**< Down appearance; the default is the normal appearance */
  243 } TLitePDFAppearance;
  244 
  245 //---------------------------------------------------------------------------
  246 
  247 typedef enum {
  248    LitePDFBookmarkFlag_None           = 0x0000, /**< Default bookmark flags */
  249    LitePDFBookmarkFlag_Italic         = 0x0001, /**< Show bookmark title as an italic text */
  250    LitePDFBookmarkFlag_Bold           = 0x0002  /**< Show bookmark title as a bold text */
  251 } TLitePDFBookmarkFlags;
  252 
  253 //---------------------------------------------------------------------------
  254 
  255 class TLitePDF
  256 {
  257  private:
  258    HMODULE lib;
  259    void *context;
  260    MLitePDFErrorEvent onError;
  261    void *onErrorUserData;
  262    DWORD lastErrorCode;
  263    char *lastErrorMessage;
  264 
  265    FARPROC GetProc(const char *pProcIdent);
  266    bool checkAPIVersion(unsigned int major,
  267                         unsigned int minor);
  268    /*< returns whether DLL's version is the correct API version, as expected by this class */
  269 
  270    void ensureLibraryLoaded(const char *_func);
  271    void unloadLibrary(void);
  272    void freeLastError(void);
  273    void setLastError(DWORD code,
  274                      const char *msg);
  275 
  276    static void __stdcall litePDFError (unsigned int code,
  277                                        const char *msg,
  278                                        void *user_data);
  279  public:
  280    TLitePDF();
  281    /**<
  282       Creates a new TLiteDPF object.
  283 
  284       Make sure there's set proper @ref LitePDFAuthorizationKey before the constructor
  285       is called, thus the library will be opened with a correct authentication
  286       key. If this is invalid, then each created page contains a litePDF notice.
  287 
  288       @note The library is not thread safe, thus if there is any need for the thread
  289          safety, then the caller is responsible to provide it on its own.
  290    */
  291 
  292    virtual ~TLitePDF();
  293 
  294    void setOnError(MLitePDFErrorEvent pOnError,
  295                    void *pOnErrorUserData);
  296    /**<
  297       Sets a custom callback for errors notified by the litePDF library. It's not
  298       necessary to be set. The errors are those returned during any function calls,
  299       but also during drawing, for example when some draw operation is not supported.
  300       Most of the object calls usually throw a @ref TLitePDFException on errors.
  301 
  302       @param pOnError A callback to call.
  303       @param pOnErrorUserData user data for the callback.
  304 
  305       @see getLastErrorCode, getLastErrorMessage
  306    */
  307 
  308    DWORD getLastErrorCode(void) const;
  309    /**<
  310       Returns the last error code, which was notified by the litePDF library, if any.
  311       Most of the object calls usually throw a @ref TLitePDFException on errors.
  312 
  313       @return The last error code, or 0, if there was none.
  314 
  315       @see setOnError, getLastErrorMessage
  316    */
  317 
  318    const char *getLastErrorMessage(void) const;
  319    /**<
  320       Returns the last error message, which was notified by the litePDF library, if any.
  321       Most of the object calls usually throw a @ref TLitePDFException on errors.
  322 
  323       @return The last error message, or NULL, if there was none.
  324 
  325       @see setOnError, getLastErrorCode
  326    */
  327 
  328    void SetUnit(TLitePDFUnit unitValue);
  329    /**<
  330       Sets a unit to use in functions which expect non-pixel size and position values.
  331       It can be one of TLitePDFUnit values. The default is @ref LitePDFUnit_mm.
  332 
  333       @param unitValue One of TLitePDFUnit values, to set as a unit.
  334 
  335       @see @ref units, GetUnit, MMToUnit, UnitToMM, InchToUnit, UnitToInch
  336    */
  337 
  338    TLitePDFUnit GetUnit(void);
  339    /**<
  340       Gets the currently set unit, which is used in functions which expect
  341       non-pixel size and position values. It can be one of TLitePDFUnit values.
  342       The default is @ref LitePDFUnit_mm.
  343 
  344       @return One of TLitePDFUnit values, which is set as the current unit.
  345 
  346       @see @ref units, SetUnit, MMToUnit, UnitToMM, InchToUnit, UnitToInch
  347    */
  348 
  349    double MMToUnitEx(TLitePDFUnit useUnit,
  350                      double mmValue) const;
  351    /**<
  352       Converts a value from millimeters to @a useUnit. The caller does
  353       the rounding as needed.
  354 
  355       @param useUnit The @ref TLitePDFUnit unit to convert the value to.
  356       @param mmValue The value in millimeters to convert.
  357       @return The @a mmValue converted to @a useUnit unit.
  358 
  359       @see UnitToMMEx, InchToUnitEx, UnitToInchEx, MMToUnit
  360    */
  361 
  362    double UnitToMMEx(TLitePDFUnit useUnit,
  363                      double unitValue) const;
  364    /**<
  365       Converts a value from @a useUnit to millimeters. The caller does
  366       the rounding as needed.
  367 
  368       @param useUnit The @ref TLitePDFUnit unit to convert the value from.
  369       @param unitValue The value in @a useUnit to convert.
  370       @return The @a unitValue in @a useUnit converted to millimeters.
  371 
  372       @see MMToUnitEx, InchToUnitEx, UnitToInchEx, UnitToMM
  373    */
  374 
  375    double InchToUnitEx(TLitePDFUnit useUnit,
  376                        double inchValue) const;
  377    /**<
  378       Converts a value from inches to @a useUnit. The caller does
  379       the rounding as needed.
  380 
  381       @param useUnit The @ref TLitePDFUnit unit to convert the value to.
  382       @param inchValue The value in inches to convert.
  383       @return The @a inchValue converted to @a useUnit unit.
  384 
  385       @see UnitToInchEx, MMToUnitEx, UnitToMMEx, InchToUnit
  386    */
  387 
  388    double UnitToInchEx(TLitePDFUnit useUnit,
  389                        double unitValue) const;
  390    /**<
  391       Converts a value from @a useUnit to inches. The caller does
  392       the rounding as needed.
  393 
  394       @param useUnit The @ref TLitePDFUnit unit to convert the value from.
  395       @param unitValue The value in @a useUnit to convert.
  396       @return The @a unitValue in @a useUnit converted to inches.
  397 
  398       @see InchToUnitEx, MMToUnitEx, UnitToMMEx, UnitToInch
  399    */
  400 
  401    double MMToUnit(double mmValue);
  402    /**<
  403       Converts a value from millimeters to current unit. The caller does
  404       the rounding as needed.
  405 
  406       @param mmValue A value in millimeters to convert to the current unit.
  407       @returns The @a mmValue converted to the current unit.
  408 
  409       @see GetUnit, UnitToMM, InchToUnit, UnitToInch, MMToUnitEx
  410    */
  411 
  412    double UnitToMM(double unitValue);
  413    /**<
  414       Converts a value from the current unit to millimeters. The caller does
  415       the rounding as needed.
  416 
  417       @param unitValue A value in the current unit to convert to millimeters.
  418       @returns The @a unitValue converted to millimeters.
  419 
  420       @see GetUnit, MMToUnit, InchToUnit, UnitToInch, UnitToMMEx
  421    */
  422 
  423    double InchToUnit(double inchValue);
  424    /**<
  425       Converts a value from inches to the current unit. The caller does
  426       the rounding as needed.
  427 
  428       @param inchValue A value in inches to convert to the current unit.
  429       @returns The @a inchValue converted to the current unit.
  430 
  431       @see GetUnit, UnitToInch, MMToUnit, UnitToMM, InchToUnitEx
  432    */
  433 
  434    double UnitToInch(double unitValue);
  435    /**<
  436       Converts a value from the current unit to inches. The caller does
  437       the rounding as needed.
  438 
  439       @param unitValue A value in the current unit to convert to inches.
  440       @returns The @a unitValue converted to inches.
  441 
  442       @see GetUnit, InchToUnit, MMToUnit, UnitToMM, UnitToInchEx
  443    */
  444 
  445    void PrepareEncryption(const char *userPassword,
  446                           const char *ownerPassword,
  447                           unsigned int permissions,
  448                           unsigned int algorithm);
  449    /**<
  450       Prepares encryption for newly created documents. The LitePDF
  451       object should be empty. The encryption is used only with
  452       @ref CreateFileDocument and @ref CreateMemDocument, other functions ignore it.
  453       Use NULL or an empty @a ownerPassword to unset any previously
  454       set encryption properties.
  455       Loading an encrypted document lefts it encrypted on save too.
  456 
  457       @param userPassword User's password, can be an empty string, or NULL,
  458          then the user doesn't need to write any password.
  459       @param ownerPassword Owner's password. Can be NULL or an empty string, to unset
  460          encryption properties.
  461       @param permissions Bit-or of @ref TLitePDFEncryptPermission flags, to set user's
  462          permissions for the document.
  463       @param algorithm One of @ref TLitePDFEncryptAlgorithm constants, an algorithm
  464          to be used to encrypt the document.
  465 
  466       @see CreateFileDocument, CreateMemDocument
  467    */
  468 
  469    void CreateFileDocument(const char *fileName);
  470    /**<
  471       Makes the LitePDF object hold a new PDF, which writes directly to a file.
  472       The object should not have opened any other PDF data. Call @ref Close,
  473       to close the file, and possibly save changes to it. Most of the operations
  474       require memory-based PDF, which can be created with @ref CreateMemDocument.
  475 
  476       @param fileName File name to write the PDF result to.
  477 
  478       @note PoDoFo doesn't support creation of file-based documents with AES encryption,
  479          thus use for it memory-based documents instead (@ref CreateMemDocument).
  480 
  481       @see PrepareEncryption, CreateFileDocumentW, CreateMemDocument, LoadFromFile
  482    */
  483 
  484    void CreateFileDocumentW(const wchar_t *fileName);
  485    /**<
  486       This is the same as @ref CreateFileDocument, the only difference is that
  487       the @a fileName is a wide string.
  488    */
  489 
  490    void CreateMemDocument(void);
  491    /**<
  492       Makes the litePDF object hold a memory-based PDF. Such PDF can be
  493       saved with @ref SaveToFile or  @ref SaveToData.
  494       The PDF should be closed with @ref Close.
  495 
  496       @see PrepareEncryption, CreateFileDocument, LoadFromFile
  497    */
  498 
  499    void LoadFromFile(const char *fileName,
  500                      const char *password,
  501                      bool loadCompletely,
  502                      bool forUpdate = false);
  503    /**<
  504       Makes the LitePDF object hold a memory-based PDF, which is loaded
  505       from a disk file. This should be closed with @ref Close.
  506       The @a loadCompletely parameter is used to determine whether the file
  507       should be loaded into memory completely, or when the file can be read
  508       on demand. Using complete load requires more memory, but the disk
  509       file can be changed freely in the background, while incomplete load
  510       requires left the file without changes while being opened.
  511       The @a forUpdate parameter specifies whether the file is being opened
  512       for incremental update. In that case saving such document will result
  513       in the changes being appended to the end of the original document,
  514       instead of resaving whole document.
  515 
  516       @param fileName File name to load the PDF from.
  517       @param password Password to use for encrypted documents.
  518       @param loadCompletely Set to true when the file should be loaded completely
  519          into memory, or false to keep the disk file in use while working with it.
  520       @param forUpdate Set to true to open the file for incremental update,
  521          or set to false otherwise. Default is false.
  522 
  523       @see LoadFromFileW
  524    */
  525 
  526    void LoadFromFileW(const wchar_t *fileName,
  527                       const char *password,
  528                       bool loadCompletely,
  529                       bool forUpdate = false);
  530    /**<
  531       This is the same as @ref LoadFromFile, the only difference is that
  532       the @a fileName is a wide string.
  533    */
  534 
  535    void LoadFromData(const BYTE *data,
  536                      unsigned int dataLength,
  537                      const char *password,
  538                      bool forUpdate = false);
  539    /**<
  540       Makes the LitePDF object hold a memory-based PDF, which is loaded
  541       with a PDF data. This should be closed with @ref Close.
  542       The @a forUpdate parameter specifies whether the file is being opened
  543       for incremental update. In that case saving such document will result
  544       in the changes being appended to the end of the original document,
  545       instead of resaving whole document.
  546 
  547       @param data PDF data to load.
  548       @param dataLength Length of PDF data.
  549       @param password Password to use for encrypted documents.
  550       @param forUpdate Set to true to open the file for incremental update,
  551          or set to false otherwise. Default is false.
  552 
  553       @see CreateMemDocument, SaveToFile, SaveToData
  554    */
  555 
  556    void SaveToFile(const char *fileName);
  557    /**<
  558       Saves memory-based PDF into a file. The object should hold PDF created only
  559       with @ref CreateMemDocument, @ref LoadFromFile or @ref LoadFromData.
  560       Using any other object results in an error.
  561 
  562       In case the PDF document had been loaded with @ref LoadFromFile,
  563       @ref LoadFromFileW or @ref LoadFromData with its @a forUpdate
  564       parameter being true, the resulting document will contain the changes as
  565       an incremental update (appended at the end of the original document), otherwise
  566       the whole document is completely rewritten.
  567 
  568       @param fileName File name to which save the memory-based PDF.
  569 
  570       @note The only valid operation after this is either close the document
  571          with @ref Close, or free the @ref TLitePDF object.
  572 
  573       @see SaveToFileW, SaveToData, SaveToFileWithSign, Close
  574    */
  575 
  576    void SaveToFileW(const wchar_t *fileName);
  577    /**<
  578       This is the same as @ref SaveToFile, the only difference is that
  579       the @a fileName is a wide string.
  580    */
  581 
  582    bool SaveToData(BYTE *data,
  583                    unsigned int *dataLength);
  584    /**<
  585       Saves memory-based PDF into a data. The object should hold PDF created only
  586       with @ref CreateMemDocument, @ref LoadFromFile or @ref LoadFromData.
  587       Using any other object results in an error.
  588 
  589       In case the PDF document had been loaded with @ref LoadFromFile,
  590       @ref LoadFromFileW or @ref LoadFromData with its @a forUpdate
  591       parameter being true, the resulting document will contain the changes as
  592       an incremental update (appended at the end of the original document), otherwise
  593       the whole document is completely rewritten.
  594 
  595       @param data [out] Actual data to store the PDF content to. It can be NULL, in which case
  596          the @a dataLength is populated with large-enough value to hold the whole data.
  597       @param dataLength [in/out] Tells how many bytes can be stored in @a data. If @a data
  598          is NULL, then it is set to large-enough value. Passing non-NULL @a data with no enough
  599          large buffer results in a failure with no change on @a dataLength.
  600       @return Whether succeeded.
  601 
  602       @note The only valid operation after this is either call of @ref SaveToData again,
  603          to get information about necessary buffer size or data itself, close the document
  604          with @ref Close, or free the @ref TLitePDF object.
  605 
  606       @see SaveToFile, SaveToDataWithSign, Close
  607    */
  608 
  609    void Close(void);
  610    /**<
  611       Closes PDF data in a LitePDF object, thus the object doesn't hold anything afterward,
  612       aka it's like a newly created object.  The function does nothing, if the object doesn't
  613       hold any data. In case of any drawing in progress, the drawing is discarded, same as any
  614       unsaved changes to the memory-based PDF documents. It also unsets any encryption properties,
  615       previously set by @ref PrepareEncryption.
  616 
  617       @see AddPage, InsertPage, UpdatePage, FinishPage
  618    */
  619 
  620    unsigned int GetPageCount(void);
  621    /**<
  622       Returns count of pages in an opened PDF document.
  623 
  624       @return Count of pages.
  625    */
  626 
  627    void GetPageSize(unsigned int pageIndex,
  628                     unsigned int *width_u,
  629                     unsigned int *height_u);
  630    /**<
  631       Gets size of an existing page, in the current unit.
  632 
  633       @param pageIndex Page index for which get the page size; counts from 0.
  634       @param width_u [out] Width of the page in the current unit.
  635       @param height_u [out] Height of the page in the current unit.
  636 
  637       @see GetUnit
  638    */
  639 
  640    HDC AddPage(unsigned int width_u,
  641                unsigned int height_u,
  642                unsigned int width_px,
  643                unsigned int height_px,
  644                unsigned int drawFlags);
  645    /**<
  646       Begins drawing into a new page into the PDF document of the given size.
  647       Newly created page is added as the last page of the PDF document.
  648       This cannot be called when other drawing is in progress.
  649 
  650       @param width_u Width of the new page in the current unit.
  651       @param height_u Height of the new page in the current unit.
  652       @param width_px Width of the new page in pixels.
  653       @param height_px Height of the new page in pixels.
  654       @param drawFlags Flags for drawing functions. This is a bit-or of @ref TLitePDFDrawFlags values
  655          and influences only @ref AddPage, @ref InsertPage, @ref UpdatePage
  656          and @ref AddResource functions.
  657       @return Device context into which can be drawn with standard GDI functions.
  658          Finish the drawing, and the page addition, with @ref FinishPage.
  659 
  660       @note Larger pixel page size produces more precise font mapping.
  661 
  662       @see GetUnit, InsertPage, UpdatePage, FinishPage, AddResource
  663    */
  664 
  665    HDC InsertPage(unsigned int pageIndex,
  666                   unsigned int width_u,
  667                   unsigned int height_u,
  668                   unsigned int width_px,
  669                   unsigned int height_px,
  670                   unsigned int drawFlags);
  671    /**<
  672       Begins drawing into a new page into the  PDF document of the given size.
  673       Newly created page is inserted at the given position of the PDF document.
  674       This cannot be called when other drawing is in progress.
  675       If the index is out of bounds, then the page is added ad the end, like with
  676       @ref AddPage.
  677 
  678       @param pageIndex Page index where to insert the page; counts from 0.
  679       @param width_u Width of the new page in the current unit.
  680       @param height_u Height of the new page in the current unit.
  681       @param width_px Width of the new page in pixels.
  682       @param height_px Height of the new page in pixels.
  683       @param drawFlags Flags for drawing functions. This is a bit-or of @ref TLitePDFDrawFlags values
  684          and influences only @ref AddPage, @ref InsertPage, @ref UpdatePage
  685          and @ref AddResource functions.
  686       @return Device context into which can be drawn with standard GDI functions.
  687          Finish the drawing, and the page insertion, with @ref FinishPage.
  688 
  689       @note Larger pixel page size produces more precise font mapping.
  690 
  691       @see GetUnit, GetPageCount, AddPage, UpdatePage, FinishPage, AddResource
  692    */
  693 
  694    HDC UpdatePage(unsigned int pageIndex,
  695                   unsigned int width_px,
  696                   unsigned int height_px,
  697                   unsigned int drawFlags);
  698    /**<
  699       Begins drawing into an already existing page. The page size in the current unit
  700       can be found by @ref GetPageSize. The function fails, and returns NULL,
  701       if the @a pageIndex is out of bounds.
  702 
  703       @param pageIndex Page index which to update; counts from 0.
  704       @param width_px Width of the new page in pixels.
  705       @param height_px Height of the new page in pixels.
  706       @param drawFlags Flags for drawing functions. This is a bit-or of @ref TLitePDFDrawFlags values
  707          and influences only @ref AddPage, @ref InsertPage, @ref UpdatePage
  708          and @ref AddResource functions.
  709       @return Device context into which can be drawn with standard GDI functions.
  710          Finish the drawing, and the page update, with @ref FinishPage.
  711 
  712       @see GetPageCount, AddPage, InsertPage, FinishPage, AddResource
  713    */
  714 
  715    void FinishPage(HDC hDC);
  716    /**<
  717       Tells litePDF that drawing into the page is finished and that it can
  718       be processed into PDF. The @a hDC is not valid after this call any more.
  719 
  720       @param hDC Device context previously returned by @ref AddPage,
  721          @ref InsertPage or @ref UpdatePage.
  722    */
  723 
  724    HDC AddResource(unsigned int width_u,
  725                    unsigned int height_u,
  726                    unsigned int width_px,
  727                    unsigned int height_px,
  728                    unsigned int drawFlags);
  729    /**<
  730       Begins drawing into a new resource into the PDF document of the given size.
  731       This cannot be called when other drawing is in progress.
  732 
  733       @param width_u Width of the new page in the current unit.
  734       @param height_u Height of the new page in the current unit.
  735       @param width_px Width of the new page in pixels.
  736       @param height_px Height of the new page in pixels.
  737       @param drawFlags Flags for drawing functions. This is a bit-or of @ref TLitePDFDrawFlags values
  738          and influences only @ref AddPage, @ref InsertPage, @ref UpdatePage
  739          and @ref AddResource functions.
  740       @return Device context into which can be drawn with standard GDI functions.
  741          Finish the drawing, and the resource addition, with @ref FinishResource.
  742 
  743       @note Larger pixel resource size produces more precise font mapping.
  744 
  745       @see GetUnit, AddPage, InsertPage, UpdatePage, FinishResource, DrawResource
  746    */
  747 
  748    unsigned int FinishResource(HDC hDC);
  749    /**<
  750       Tells litePDF that drawing into the resource is finished and that it can
  751       be processed into PDF. The @a hDC is not valid after this call any more.
  752 
  753       @param hDC Device context previously returned by @ref AddResource.
  754       @return Newly created resource ID, or 0 on error.
  755 
  756       @see AddResource, AddPageFromAsResource, DrawResource
  757    */
  758 
  759    void DeletePage(unsigned int pageIndex);
  760    /**<
  761       Deletes page at given index. It doesn't delete page resources, because these can
  762       be used by other pages.
  763 
  764       @param pageIndex Page index which to update; counts from 0.
  765       @return Whether succeeded.
  766 
  767       @see GetPageCount, PageToResource
  768    */
  769 
  770    void AddPagesFrom(litePDF::TLitePDF *from,
  771                      unsigned int pageIndex,
  772                      unsigned int pageCount);
  773    /**<
  774       Adds existing pages as the last pages from another PDF. Both objects should
  775       hold memory-based documents.
  776 
  777       @param from a LitePDF object from which add the pages.
  778       @param pageIndex Page index which to add from @a from; counts from 0.
  779       @param pageCount How many pages to add; 0 means whole document.
  780 
  781       @note The two objects cannot be the same.
  782 
  783       @see GetPageCount, InsertPageFrom, PageToResource
  784    */
  785 
  786    void InsertPageFrom(unsigned int pageIndexTo,
  787                        litePDF::TLitePDF *from,
  788                        unsigned int pageIndexFrom);
  789    /**<
  790       Inserts an existing page at the given index from another PDF. Both objects should
  791       hold memory-based documents.
  792 
  793       @param pageIndexTo Page index where to add the page; counts from 0. Adds page
  794          at the end, if out of bounds.
  795       @param from a LitePDF object, from which add the page.
  796       @param pageIndexFrom Page index which to add from @a from; counts from 0.
  797 
  798       @note The two objects cannot be the same.
  799 
  800       @see GetPageCount, AddPagesFrom, PageToResource
  801    */
  802 
  803    unsigned int AddPageFromAsResource(litePDF::TLitePDF *from,
  804                                       unsigned int pageIndex,
  805                                       bool useTrimBox = false);
  806    /**<
  807       Adds an existing page as a resource of a given PDF. This resource can be
  808       referenced multiple times by its identifier. Both objects should
  809       hold memory-based documents.
  810 
  811       @param from a LitePDF object, from which add the page.
  812       @param pageIndex Page index which to add from @a from; counts from 0.
  813       @param useTrimBox If true, try to use trimbox for size of the resource (XObject)
  814       @return Resource identifier, or 0 on error.
  815 
  816       @note The two objects cannot be the same.
  817 
  818       @see GetPageCount, AddPagesFrom, PageToResource, GetResourceSize,
  819          DrawResource
  820    */
  821 
  822    unsigned int PageToResource(unsigned int pageIndex);
  823    /**<
  824       Creates a resource, which will reference an existing page.
  825       The page itself is not deleted after call of this.
  826 
  827       @param pageIndex Page index for which create the resource reference; counts from 0.
  828       @return Resource identifier, or 0 on error.
  829       
  830       @see GetPageCount, AddPagesFrom, AddPageFromAsResource, GetResourceSize,
  831          DrawResource
  832    */
  833 
  834    void GetResourceSize(unsigned int resourceID,
  835                         unsigned int *width_u,
  836                         unsigned int *height_u);
  837    /**<
  838       Gets size of an existing resource, in the current unit. The resource ID
  839       was returned from @ref AddPageFromAsResource or @ref FinishResource.
  840 
  841       @param resourceID Resource ID for which get the size.
  842       @param width_u [out] Width of the resource, in the current unit.
  843       @param height_u [out] Height of the resource, in the current unit.
  844 
  845       @see GetUnit, AddPageFromAsResource, DrawResource
  846    */
  847 
  848    void DrawResource(unsigned int resourceID,
  849                      unsigned int pageIndex,
  850                      TLitePDFUnit unitValue,
  851                      int x,
  852                      int y,
  853                      int scaleX,
  854                      int scaleY);
  855    /**<
  856       Draws an existing resource at the given position. The resource ID 
  857       was returned from @ref AddPageFromAsResource, @ref PageToResource or @ref FinishResource.
  858       The @a unitValue is used for both the position and the scale. In case
  859       of the scale, it defines only the ratio to the base unit.
  860       For example, if the @a unitValue is either @ref LitePDFUnit_1000th_mm or
  861       @ref LitePDFUnit_1000th_inch, then the ratio for the @a scaleX and @a scaleY
  862       is used 1/1000 (where 1000 means the same size as the resource is in this case).
  863 
  864       @param resourceID Resource ID to draw.
  865       @param pageIndex Page index to which draw; counts from 0.
  866       @param unitValue A unit to use for the @a x and @a y, and a ratio for the @a scaleX and @a scaleY.
  867       @param x Where to draw on the page, X axes, in the given @a unitValue unit,
  868          with left-top corner being [0,0].
  869       @param y Where to draw on the page, Y axes, in the given @a unitValue unit,
  870          with left-top corner being [0,0].
  871       @param scaleX Scale factor of the page for the X axes, using the @a unitValue ratio.
  872       @param scaleY Scale factor of the page for the Y axes, using the @a unitValue ratio.
  873 
  874       @see GetPageCount, AddPageFromAsResource, PageToResource, FinishResource,
  875          GetResourceSize, DrawResourceWithMatrix
  876    */
  877 
  878    void DrawResourceWithMatrix(unsigned int resourceID,
  879                                unsigned int pageIndex,
  880                                double a,
  881                                double b,
  882                                double c,
  883                                double d,
  884                                double e,
  885                                double f);
  886    /**<
  887       Draws an existing resource with given transformation matrix. All
  888       the transformation values are passed into PDF directly, without any
  889       conversion. The resource ID was returned from @ref AddPageFromAsResource
  890       or @ref FinishResource. The constructed transformation matrix
  891       is a standard 3x3 matrix:<BR>
  892       <CODE>   | a b 0 |</CODE><BR>
  893       <CODE>   | c d 0 |</CODE><BR>
  894       <CODE>   | e f 1 |</CODE>
  895 
  896       @param resourceID Resource ID to draw.
  897       @param pageIndex Page index to which draw; counts from 0.
  898       @param a Transformation matrix [ a b c d e f ] parameter 'a', in PDF units.
  899       @param b Transformation matrix [ a b c d e f ] parameter 'b', in PDF units.
  900       @param c Transformation matrix [ a b c d e f ] parameter 'c', in PDF units.
  901       @param d Transformation matrix [ a b c d e f ] parameter 'd', in PDF units.
  902       @param e Transformation matrix [ a b c d e f ] parameter 'e', in PDF units.
  903       @param f Transformation matrix [ a b c d e f ] parameter 'f', in PDF units.
  904 
  905       @note Each of a, b, c, d, e, f is rounded down to nearest 1/1000th of PDF units.
  906 
  907       @see GetPageCount, AddPageFromAsResource, FinishResource,
  908          GetResourceSize, DrawResource
  909    */
  910 
  911    void SetDocumentInfo(const char *name,
  912                         const wchar_t *value);
  913    /**<
  914       Sets information about the document. The name can be one
  915       of the LitePDFDocumentInfo predefined constants.
  916 
  917       @param name Document info property name to set.
  918       @param value Null-terminated Unicode value to set.
  919    */
  920 
  921    bool GetDocumentInfoExists(const char *name);
  922    /**<
  923       Checks whether information about the document of the given name exists.
  924       The name can be one of the LitePDFDocumentInfo predefined constants.
  925 
  926       @param name Document info property name to test.
  927       @return Whether succeeded and the document information is set.
  928    */
  929 
  930    std::wstring GetDocumentInfo(const char *name);
  931    /**<
  932       Gets information about the document. The name can be one
  933       of the LitePDFDocumentInfo predefined constants.
  934 
  935       @param name Document info property name to get.
  936       @return Unicode value.
  937    */
  938 
  939    bool GetDocumentIsSigned(void);
  940    /**<
  941       Checks whether currently opened document is already signed. Signing already
  942       signed document can cause breakage of previous signatures, thus it's good
  943       to test whether the loaded document is signed, before signing it.
  944 
  945       @return Whether the opened document is already signed.
  946 
  947       @see GetSignatureCount, SaveToFileWithSign, SaveToDataWithSign
  948    */
  949 
  950    unsigned int GetSignatureCount(void);
  951    /**<
  952       Provides how many signature fields the currently opened document contains.
  953       It returns the count of the all fields, not only those already signed.
  954 
  955       @return How many signatures the currently opened document contains.
  956 
  957       @note The litePDF caches the list of the existing signature fields for performance
  958          reasons and it rebuilds it whenever this function is called or when the
  959          @ref CreateSignature is called, thus if there are made any changes
  960          directly with the PoDoFo API after the cache had been created, then make sure
  961          you call this function again to avoid a use-after-free or an outdated information
  962          being used. The litePDF will try to keep the cache up to date as needed, but
  963          it cannot cover every case, especially not the one when the PoDoFo API is used.
  964 
  965       @see GetDocumentIsSigned, GetSignatureHasData, GetSignatureData
  966    */
  967 
  968    std::string GetSignatureName(unsigned int index);
  969    /**<
  970       Gets the signature field name at the given @a index.
  971 
  972       @param index Which signature field name to get; counts from 0. This might be less
  973          than @ref GetSignatureCount.
  974       @return An ASCII name of the field.
  975    */
  976 
  977    unsigned int CreateSignature(const char *name,
  978                                 unsigned int annotationPageIndex,
  979                                 int annotationX_u,
  980                                 int annotationY_u,
  981                                 int annotationWidth_u,
  982                                 int annotationHeight_u,
  983                                 unsigned int annotationFlags);
  984    /**<
  985       Creates a new signature field named @a name. The field is created completely empty.
  986       Use @ref SetSignatureDate, @ref SetSignatureReason,
  987       @ref SetSignatureLocation, @ref SetSignatureCreator,
  988       @ref SetSignatureAppearance and such to populated it with required values.
  989       Finally, to sign the signature field use @ref SaveToFileWithSign family
  990       functions.
  991 
  992       @param name Signature field name to use. This should be unique.
  993       @param annotationPageIndex Page index where to place the signature annotation.
  994       @param annotationX_u X-origin of the annotation on the page, in the current unit.
  995       @param annotationY_u Y-origin of the annotation on the page, in the current unit.
  996       @param annotationWidth_u Width of the annotation on the page, in the current unit.
  997       @param annotationHeight_u Height of the annotation on the page, in the current unit.
  998       @param annotationFlags Bit-or of @ref TLitePDFAnnotationFlags flags.
  999       @return The index of the added signature field.
 1000 
 1001       @see GetSignatureCount, GetSignatureName
 1002    */
 1003 
 1004    bool GetSignatureHasData(unsigned int index);
 1005    /**<
 1006       Checks whether the given signature field contains any data, which
 1007       means whether the signature field is signed.
 1008 
 1009       @param index Which signature data to get; counts from 0. This might be less
 1010          than @ref GetSignatureCount.
 1011       @return Whether the given signature contains any data.
 1012 
 1013       @see GetSignatureData
 1014    */
 1015 
 1016    bool GetSignatureData(unsigned int index,
 1017                          BYTE *data,
 1018                          unsigned int *dataLength);
 1019    /**<
 1020       Gathers raw signature data for the given signature in the currently opened document.
 1021       Use @ref GetSignatureHasData to check whether the given signature field
 1022       is signed or not.
 1023 
 1024       @param index Which signature data to get; counts from 0. This might be less
 1025          than @ref GetSignatureCount.
 1026       @param data [out] Actual data to store the signature content to. It can be NULL, in which case
 1027          the @a dataLength is populated with large-enough value to hold the whole data.
 1028       @param dataLength [in/out] Tells how many bytes can be stored in @a data. If @a data
 1029          is NULL, then it is set to large-enough value. Passing non-NULL @a data with no enough
 1030          large buffer results in a failure with no change on @a dataLength.
 1031       @return Whether succeeded.
 1032 
 1033       @see GetDocumentIsSigned, GetSignatureCount, GetSignatureRanges
 1034    */
 1035 
 1036    bool GetSignatureRanges(unsigned int index,
 1037                            unsigned __int64 *pRangesArray,
 1038                            unsigned int *pRangesArrayLength);
 1039    /**<
 1040       Gathers signature ranges, that is the actual offsets into the opened file
 1041       which had been used to create the signature data (@ref GetSignatureData).
 1042       The array is a pair of numbers, where the first number is an offset into the file
 1043       from its beginning and the second number is the number of bytes being used for
 1044       the signature from this offset.
 1045 
 1046       @param index Which signature ranges to get; counts from 0. This might be less
 1047          than @ref GetSignatureCount.
 1048       @param pRangesArray [out] Actual array to store the signature ranges to. It can be NULL,
 1049          in which case the @a pRangesArrayLength is populated with large-enough value to hold
 1050          the whole array.
 1051       @param pRangesArrayLength [in/out] Tells how many items can be stored in @a pRangesArray.
 1052          If @a pRangesArray is NULL, then it is set to large-enough value. Passing non-NULL
 1053          @a pRangesArray with no enough large array results in a failure with no change
 1054          on @a pRangesArrayLength.
 1055       @return Whether succeeded.
 1056 
 1057       @note This function works only for the signatures which use this kind of signature method.
 1058 
 1059       @see GetDocumentIsSigned, GetSignatureCount, GetSignatureData
 1060    */
 1061 
 1062    void SetSignatureDate(unsigned int index,
 1063                          __int64 dateOfSign);
 1064    /**<
 1065       Sets signature field date of sign.
 1066 
 1067       @param index Which signature to use; counts from 0. This might be less
 1068          than @ref GetSignatureCount.
 1069       @param dateOfSign Date of sign, like Unix time_t, when the signature was created; less than
 1070          or equal to 0 means today. The value can be clamp on 32-bit systems.
 1071 
 1072       @see GetSignatureDate, GetSignatureCount
 1073    */
 1074 
 1075    __int64 GetSignatureDate(unsigned int index);
 1076    /**<
 1077       Gets signature field date of sign.
 1078 
 1079       @param index Which signature to use; counts from 0. This might be less
 1080          than @ref GetSignatureCount.
 1081       @return The date of sign. It's like Unix time_t, as set by the signature field creator.
 1082          The value can be clamp on 32-bit systems.
 1083 
 1084       @see SetSignatureDate, GetSignatureCount
 1085    */
 1086 
 1087    void SetSignatureReason(unsigned int index,
 1088                            const wchar_t *reason);
 1089    /**<
 1090       Sets signature reason.
 1091 
 1092       @param index Which signature to use; counts from 0. This might be less
 1093          than @ref GetSignatureCount.
 1094       @param reason The value to set.
 1095 
 1096       @see GetSignatureReason, GetSignatureCount
 1097    */
 1098 
 1099    std::wstring GetSignatureReason(unsigned int index);
 1100    /**<
 1101       Gets signature reason.
 1102 
 1103       @param index Which signature to use; counts from 0. This might be less
 1104          than @ref GetSignatureCount.
 1105       @return A Unicode string containing the value.
 1106 
 1107       @see SetSignatureReason, GetSignatureCount
 1108    */
 1109 
 1110    void SetSignatureLocation(unsigned int index,
 1111                              const wchar_t *location);
 1112    /**<
 1113       Sets signature location, aka where the signature had been made. This can be left unset.
 1114 
 1115       @param index Which signature to use; counts from 0. This might be less
 1116          than @ref GetSignatureCount.
 1117       @param location The value to set.
 1118 
 1119       @see GetSignatureLocation, GetSignatureCount
 1120    */
 1121 
 1122    std::wstring GetSignatureLocation(unsigned int index);
 1123    /**<
 1124       Gets signature location.
 1125 
 1126       @param index Which signature to use; counts from 0. This might be less
 1127          than @ref GetSignatureCount.
 1128       @return A Unicode string containing the value.
 1129 
 1130       @see SetSignatureLocation, GetSignatureCount
 1131    */
 1132 
 1133    void SetSignatureCreator(unsigned int index,
 1134                             const char *creator);
 1135    /**<
 1136       Sets signature creator. This can be left unset.
 1137 
 1138       @param index Which signature to use; counts from 0. This might be less
 1139          than @ref GetSignatureCount.
 1140       @param creator The value to set.
 1141 
 1142       @see GetSignatureCreator, GetSignatureCount
 1143    */
 1144 
 1145    std::string GetSignatureCreator(unsigned int index);
 1146    /**<
 1147       Gets signature creator.
 1148 
 1149       @param index Which signature to use; counts from 0. This might be less
 1150          than @ref GetSignatureCount.
 1151       @return An ASCII string containing the value.
 1152 
 1153       @see SetSignatureCreator, GetSignatureCount
 1154    */
 1155 
 1156    void SetSignatureAppearance(unsigned int index,
 1157                                TLitePDFAppearance appearanceType,
 1158                                unsigned int resourceID,
 1159                                int offsetX_u,
 1160                                int offsetY_u);
 1161    /**<
 1162       Sets the signature appearance.
 1163 
 1164       @param index Which signature to use; counts from 0. This might be less
 1165          than @ref GetSignatureCount.
 1166       @param appearanceType One of the @ref LitePDFAppearance_Normal, @ref LitePDFAppearance_Rollover
 1167          and @ref LitePDFAppearance_Down contacts. At least the @ref LitePDFAppearance_Normal type
 1168          should be set, if the appearance of the signature is requested.
 1169       @param resourceID An existing resource ID of the annotation content, as shown to the user.
 1170       @param offsetX_u X-offset of the resource inside the annotation of the signature, in the current unit.
 1171       @param offsetY_u Y-offset of the resource inside the annotation of the signature, in the current unit.
 1172 
 1173       @note The resoruce position offset is from [left, top] corner of the annotation rectangle.
 1174 
 1175       @see GetUnit, AddResource, GetSignatureCount, CreateSignature
 1176    */
 1177 
 1178    void SetSignatureSize(unsigned int requestBytes);
 1179    /**<
 1180       Sets how many bytes the signature may require. The default value is 2048 bytes
 1181       and it is automatically adjusted when the @ref SaveToFileWithSign or
 1182       @ref SaveToDataWithSign are used. The manual signing functions
 1183       require this value to be set before signing, if the final hash with the certificate
 1184       exceeds the default size.
 1185 
 1186       This value is remembered in general, not for any signature in particular.
 1187 
 1188       @param requestBytes How many bytes the signature will require.
 1189 
 1190       @see SaveToFileWithSignManual, SaveToFileWithSignManualW, SaveToDataWithSignManual
 1191    */
 1192 
 1193    void AddSignerPFX(const BYTE *pfxData,
 1194                      unsigned int pfxDataLength,
 1195                      const char *pfxPassword);
 1196    /**<
 1197       Adds a signer to be used when digitally signing the document with
 1198       @ref SaveToFileWithSign or @ref SaveToDataWithSign.
 1199       The passed-in certificate is in the PFX format and should include
 1200       the private key.
 1201 
 1202       @param pfxData A certificate with private key in the PFX format.
 1203       @param pfxDataLength A length of the @a pfxData.
 1204       @param pfxPassword A password to use to open the PFX certificate; can be NULL.
 1205 
 1206       @see AddSignerPEM
 1207    */
 1208 
 1209    void AddSignerPEM(const BYTE *pemData,
 1210                      unsigned int pemDataLength,
 1211                      const BYTE *pkeyData,
 1212                      unsigned int pkeyDataLength,
 1213                      const char *pkeyPassword);
 1214    /**<
 1215       Adds a signer to be used when digitally signing the document with
 1216       @ref SaveToFileWithSign or @ref SaveToDataWithSign.
 1217       The passed-in certificate and private key are in the PEM format.
 1218 
 1219       @param pemData A certificate in the PEM format.
 1220       @param pemDataLength A length of the @a pemData.
 1221       @param pkeyData A private key for the certificate, in the PEM format.
 1222       @param pkeyDataLength A length of the @a pkeyData.
 1223       @param pkeyPassword A password to use to open the private key; can be NULL.
 1224 
 1225       @see AddSignerPFX
 1226    */
 1227 
 1228    void SaveToFileWithSign(const char *fileName,
 1229                            unsigned int signatureIndex);
 1230    /**<
 1231       Digitally signs a PDF document opened at the LitePDF object. The caller is
 1232       responsible to set at least one signer with either @ref AddSignerPFX
 1233       or @ref AddSignerPEM first. An alternative @ref SaveToFileWithSignManual
 1234       is provided when it's required to compute the signature hash manually by the caller.
 1235 
 1236       In case the document had been loaded with @ref LoadFromFile,
 1237       @ref LoadFromFileW or @ref LoadFromData with its @a forUpdate
 1238       parameter being true, the resulting document will contain the changes as
 1239       an incremental update (appended at the end of the original document), otherwise
 1240       the whole document is completely rewritten.
 1241 
 1242       @param fileName A file name where to save signed PDF document.
 1243       @param signatureIndex Which signature to use; counts from 0. This might be less
 1244          than @ref GetSignatureCount.
 1245 
 1246       @note The only valid operation after this is either close the document
 1247          with @ref Close, or free the @ref TLitePDF object.
 1248 
 1249       @note Signing already signed document can cause breakage of previous signatures, thus
 1250          check whether the loaded document is already signed with @ref GetDocumentIsSigned.
 1251          Load the document with its @a forUpdate parameter set to true, to sign an existing document.
 1252 
 1253       @see SaveToFileWithSignW, SaveToDataWithSign
 1254    */
 1255 
 1256    void SaveToFileWithSignW(const wchar_t *fileName,
 1257                             unsigned int signatureIndex);
 1258    /**<
 1259       This is the same as @ref SaveToFileWithSign, the only difference is that
 1260       the @a fileName is a wide string.
 1261    */
 1262 
 1263    bool SaveToDataWithSign(unsigned int signatureIndex,
 1264                            BYTE *data,
 1265                            unsigned int *dataLength);
 1266    /**<
 1267       Digitally signs a PDF document opened at the LitePDF object. The caller is
 1268       responsible to set at least one signer with either @ref AddSignerPFX
 1269       or @ref AddSignerPEM first. An alternative @ref SaveToDataWithSignManual
 1270       is provided when it's required to compute the signature hash manually by the caller.
 1271 
 1272       In case the document had been loaded with @ref LoadFromFile,
 1273       @ref LoadFromFileW or @ref LoadFromData with its @a forUpdate
 1274       parameter being true, the resulting document will contain the changes as
 1275       an incremental update (appended at the end of the original document), otherwise
 1276       the whole document is completely rewritten.
 1277 
 1278       @param signatureIndex Which signature to use; counts from 0. This might be less
 1279          than @ref GetSignatureCount.
 1280       @param data [out] Actual data to store the PDF content to. It can be NULL, in which case
 1281          the @a dataLength is populated with large-enough value to hold the whole data.
 1282       @param dataLength [in/out] Tells how many bytes can be stored in @a data. If @a data
 1283          is NULL, then it is set to large-enough value. Passing non-NULL @a data with no enough
 1284          large buffer results in a failure with no change on @a dataLength.
 1285       @return Whether succeeded.
 1286 
 1287       @note The only valid operation after this is either call of @ref SaveToDataWithSign again,
 1288          to get information about necessary buffer size or data itself, close the document
 1289          with @ref Close, or free the @ref TLitePDF object.
 1290 
 1291       @note Signing already signed document can cause breakage of previous signatures, thus
 1292          check whether the loaded document is already signed with @ref GetDocumentIsSigned.
 1293          Load the document with its @a forUpdate parameter set to true, to sign an existing document.
 1294 
 1295       @see SaveToFileWithSign
 1296    */
 1297 
 1298    void SaveToFileWithSignManual(const char *fileName,
 1299                                  unsigned int signatureIndex,
 1300                                  TLitePDFAppendSignatureDataFunc appendSignatureData,
 1301                                  void *append_user_data,
 1302                                  TLitePDFFinishSignatureFunc finishSignature,
 1303                                  void *finish_user_data);
 1304    /**<
 1305       Digitally signs a PDF document opened at the LitePDF object. The caller is
 1306       responsible for a detached hash computations and related certificate management.
 1307 
 1308       In case the document had been loaded with @ref LoadFromFile,
 1309       @ref LoadFromFileW or @ref LoadFromData with its @a forUpdate
 1310       parameter being true, the resulting document will contain the changes as
 1311       an incremental update (appended at the end of the original document), otherwise
 1312       the whole document is completely rewritten.
 1313 
 1314       @param fileName A file name where to save signed PDF document.
 1315       @param signatureIndex Which signature to use; counts from 0. This might be less
 1316          than @ref GetSignatureCount.
 1317       @param appendSignatureData Called when more data should be added to hash computation.
 1318          The function cannot be NULL, even when called the second time, to get actual data.
 1319       @param append_user_data User data value for the @a appendSignatureData callback.
 1320       @param finishSignature Called when all the data are processed, and the signature
 1321          value is required. The @a signature_len contains size of the @a signature buffer.
 1322          The callback is responsible to populate @a signature and @a signature_len with
 1323          correct values. Set @a signature_len to zero on any error.
 1324          Note the callback is called only once.
 1325          The function cannot be NULL, even when called the second time, to get actual data.
 1326       @param finish_user_data User data value for the @a finishSignature callback.
 1327 
 1328       @note The only valid operation after this is either close the document
 1329          with @ref Close, or free the @ref TLitePDF object.
 1330 
 1331       @note Signing already signed document can cause breakage of previous signatures, thus
 1332          check whether the loaded document is already signed with @ref GetDocumentIsSigned.
 1333          Load the document with its @a forUpdate parameter set to true, to sign an existing document.
 1334 
 1335       @see SaveToFileWithSign, SaveToFileWithSignManualW, SaveToDataWithSignManual
 1336    */
 1337 
 1338    void SaveToFileWithSignManualW(const wchar_t *fileName,
 1339                                   unsigned int signatureIndex,
 1340                                   TLitePDFAppendSignatureDataFunc appendSignatureData,
 1341                                   void *append_user_data,
 1342                                   TLitePDFFinishSignatureFunc finishSignature,
 1343                                   void *finish_user_data);
 1344    /**<
 1345       This is the same as @ref SaveToFileWithSignManual, the only difference is that
 1346       the @a fileName is a wide string.
 1347    */
 1348 
 1349    bool SaveToDataWithSignManual(unsigned int signatureIndex,
 1350                                  TLitePDFAppendSignatureDataFunc appendSignatureData,
 1351                                  void *append_user_data,
 1352                                  TLitePDFFinishSignatureFunc finishSignature,
 1353                                  void *finish_user_data,
 1354                                  BYTE *data,
 1355                                  unsigned int *dataLength);
 1356    /**<
 1357       Digitally signs a PDF document opened at the LitePDF object. The caller is
 1358       responsible for a detached hash computations and related certificate management.
 1359 
 1360       In case the document had been loaded with @ref LoadFromFile,
 1361       @ref LoadFromFileW or @ref LoadFromData with its @a forUpdate
 1362       parameter being true, the resulting document will contain the changes as
 1363       an incremental update (appended at the end of the original document), otherwise
 1364       the whole document is completely rewritten.
 1365 
 1366       @param signatureIndex Which signature to use; counts from 0. This might be less
 1367          than @ref GetSignatureCount.
 1368       @param appendSignatureData Called when more data should be added to hash computation.
 1369          The function cannot be NULL, even when called the second time, to get actual data.
 1370       @param append_user_data User data value for the @a appendSignatureData callback.
 1371       @param finishSignature Called when all the data are processed, and the signature
 1372          value is required. The @a signature_len contains size of the @a signature buffer.
 1373          The callback is responsible to populate @a signature and @a signature_len with
 1374          correct values. Set @a signature_len to zero on any error.
 1375          Note the callback is called only once.
 1376          The function cannot be NULL, even when called the second time, to get actual data.
 1377       @param finish_user_data User data value for the @a finishSignature callback.
 1378       @param data [out] Actual data to store the PDF content to. It can be NULL, in which case
 1379          the @a dataLength is populated with large-enough value to hold the whole data.
 1380       @param dataLength [in/out] Tells how many bytes can be stored in @a data. If @a data
 1381          is NULL, then it is set to large-enough value. Passing non-NULL @a data with no enough
 1382          large buffer results in a failure with no change on @a dataLength.
 1383       @return Whether succeeded.
 1384 
 1385       @note The only valid operation after this is either call of @ref SaveToDataWithSignManual again,
 1386          to get information about necessary buffer size or data itself, close the document
 1387          with @ref Close, or free the @ref TLitePDF object.
 1388 
 1389       @note Signing already signed document can cause breakage of previous signatures, thus
 1390          check whether the loaded document is already signed with @ref GetDocumentIsSigned.
 1391          Load the document with its @a forUpdate parameter set to true, to sign an existing document.
 1392 
 1393       @see SaveToFileWithSignManual, SaveToFileWithSign
 1394    */
 1395 
 1396    void EmbedFile(const char *fileName);
 1397    /**<
 1398       Embeds a file into a PDF document.
 1399 
 1400       @param fileName File name of the file to be attached.
 1401       @return Whether succeeded.
 1402 
 1403       @note Files can be embed only to memory-based documents.
 1404 
 1405       @note The path is stripped from the @a fileName. The @a fileName is used as a key,
 1406          aka it's not possible to embed two files of the same name into a PDF document.
 1407 
 1408       @see EmbedFileW, EmbedData, CreateMemDocument
 1409    */
 1410 
 1411    void EmbedFileW(const wchar_t *fileName);
 1412    /**<
 1413       This is the same as @ref EmbedFile, the only difference is that
 1414       the @a fileName is a wide string.
 1415    */
 1416 
 1417    void EmbedData(const char *fileName,
 1418                   const BYTE *data,
 1419                   unsigned int dataLength);
 1420    /**<
 1421       Embeds a data (file) into a PDF document.
 1422 
 1423       @param fileName File name to be used for the data identification.
 1424       @param data Actual data to be attached.
 1425       @param dataLength Length of the data.
 1426 
 1427       @note Data can be embed only to memory-based documents.
 1428 
 1429       @note The path is stripped from the @a fileName. The @a fileName is used as a key,
 1430          aka it's not possible to embed two files of the same name into a PDF document.
 1431 
 1432       @see EmbedDataW, EmbedFile, CreateMemDocument
 1433    */
 1434 
 1435    void EmbedDataW(const wchar_t *fileName,
 1436                    const BYTE *data,
 1437                    unsigned int dataLength);
 1438    /**<
 1439       This is the same as @ref EmbedData, the only difference is that
 1440       the @a fileName is a wide string.
 1441    */
 1442 
 1443    int GetEmbeddedFileCount(void);
 1444    /**<
 1445       Gets count of embedded files stored in a PDF document.
 1446 
 1447       @return Count of found embedded files, or -1 on error.
 1448 
 1449       @see EmbedFile, EmbedData, GetEmbeddedFileName, GetEmbeddedFileData
 1450    */
 1451 
 1452    std::string GetEmbeddedFileName(unsigned int index);
 1453    /**<
 1454       Gets embedded file's name, as stored in a PDF document.
 1455 
 1456       @param index Index of the embedded file; returns failure, if out of range.
 1457       @return File's name, as stored in a PDF document.
 1458 
 1459       @see GetEmbeddedFileNameW, EmbedFile, EmbedData, GetEmbeddedFileCount, GetEmbeddedFileData
 1460    */
 1461 
 1462    std::wstring GetEmbeddedFileNameW(unsigned int index);
 1463    /**<
 1464       This is the same as @ref GetEmbeddedFileName, the only difference is that
 1465       the return fileName is a wide string.
 1466    */
 1467 
 1468    bool GetEmbeddedFileData(unsigned int index,
 1469                             BYTE *data,
 1470                             unsigned int *dataLength);
 1471    /**<
 1472       Gets embedded file's data, as stored in a PDF document. There are no data returned,
 1473       if the file was not embed.
 1474 
 1475       @param index Index of the embedded file; returns failure, if out of range.
 1476       @param data [out] Actual embedded file's data, as stored in the PDF. It can be NULL, in which case
 1477          the @a dataLength is populated with large-enough value to hold the whole data.
 1478       @param dataLength [in/out] Tells how many bytes can be stored in @a data. If @a data
 1479          is NULL, then it is set to large-enough value. Passing non-NULL @a data with no enough
 1480          large buffer results in a failure with no change on @a dataLength.
 1481       @return Whether succeeded.
 1482 
 1483       @see EmbedFile, EmbedData, GetEmbeddedFileCount, GetEmbeddedFileName
 1484    */
 1485 
 1486    void *GetPoDoFoDocument(void);
 1487    /**<
 1488       Gets a pointer to PoDoFo::PdfDocument document, which is currently opened.
 1489       The returned pointer is owned by litePDF, do not free it. It is valid until
 1490       the document is closed.
 1491 
 1492       @return Pointer to currently opened PoDoFo::PdfDocument.
 1493 
 1494       @see Close
 1495    */
 1496 
 1497    void DrawDebugPage(const char *filename);
 1498    /**<
 1499       Draws saved debugPage as a new page into the PDF file. There should not be
 1500       running any drawing when calling this function (like no page can be opened
 1501       for drawing).
 1502 
 1503       @param filename File name with full path for litePDF debug page.
 1504    */
 1505 
 1506    void CreateLinkAnnotation(unsigned int annotationPageIndex,
 1507                              int annotationX_u,
 1508                              int annotationY_u,
 1509                              int annotationWidth_u,
 1510                              int annotationHeight_u,
 1511                              unsigned int annotationFlags,
 1512                              unsigned int annotationResourceID,
 1513                              unsigned int destinationPageIndex,
 1514                              unsigned int destinationX_u,
 1515                              unsigned int destinationY_u,
 1516                              const wchar_t *destinationDescription);
 1517    /**<
 1518       Creates a link annotation at the given page and position, which will target the given
 1519       destination page and the position in it. The object should hold a memory-based document.
 1520       Note, the link annotation can be created only when the document is not drawing, to
 1521       have all the document pages available.
 1522 
 1523       @param annotationPageIndex Page index where to place the link annotation.
 1524       @param annotationX_u X-origin of the annotation on the page, in the current unit.
 1525       @param annotationY_u Y-origin of the annotation on the page, in the current unit.
 1526       @param annotationWidth_u Width of the annotation on the page, in the current unit.
 1527       @param annotationHeight_u Height of the annotation on the page, in the current unit.
 1528       @param annotationFlags Bit-or of @ref TLitePDFAnnotationFlags flags.
 1529       @param annotationResourceID Optional resource ID of the annotation content, as shown
 1530          to the user. 0 means do not add additional visualization on the page, but the annotation
 1531          can be still clicked.
 1532       @param destinationPageIndex Page index where the link points to.
 1533       @param destinationX_u X-origin of the destination on the page, in the current unit.
 1534       @param destinationY_u Y-origin of the destination on the page, in the current unit.
 1535       @param destinationDescription Optional destination description, which can be used
 1536          for accessibility reasons by the viewer.
 1537 
 1538       @see GetUnit, GetPageCount, AddResource, CreateBookmarkRoot
 1539    */
 1540 
 1541    unsigned int CreateBookmarkRoot(const wchar_t *title,
 1542                                    unsigned int flags,
 1543                                    COLORREF titleColor,
 1544                                    unsigned int destinationPageIndex,
 1545                                    unsigned int destinationX_u,
 1546                                    unsigned int destinationY_u);
 1547    /**<
 1548       Creates a new root (top-level) bookmark, which will target the given destination
 1549       page and the position in it. The object should hold a memory-based document.
 1550       Note, the bookmarks can be created only when the document is not drawing, to
 1551       have all the document pages available.
 1552 
 1553       @param title Title of the bookmark.
 1554       @param flags Bit-or of @ref TLitePDFBookmarkFlags flags.
 1555       @param titleColor RGB value of the title text color.
 1556       @param destinationPageIndex Page index where the link points to.
 1557       @param destinationX_u X-origin of the destination on the page, in the current unit.
 1558       @param destinationY_u Y-origin of the destination on the page, in the current unit.
 1559       @return Created bookmark ID or 0, when the bookmark could not be created.
 1560 
 1561       @see GetUnit, CreateBookmarkChild, CreateBookmarkSibling, CreateLinkAnnotation
 1562    */
 1563 
 1564    unsigned int CreateBookmarkChild(unsigned int parentBookmarkID,
 1565                                     const wchar_t *title,
 1566                                     unsigned int flags,
 1567                                     COLORREF titleColor,
 1568                                     unsigned int destinationPageIndex,
 1569                                     unsigned int destinationX_u,
 1570                                     unsigned int destinationY_u);
 1571    /**<
 1572       Creates a new child bookmark, which will target the given destination
 1573       page and the position in it. The object should hold a memory-based document.
 1574       Note, the bookmarks can be created only when the document is not drawing, to
 1575       have all the document pages available.
 1576 
 1577       @param parentBookmarkID Bookmark ID of the parent bookmark. The child will be
 1578          created under this bookmark.
 1579       @param title Title of the bookmark.
 1580       @param flags Bit-or of @ref TLitePDFBookmarkFlags flags.
 1581       @param titleColor RGB value of the title text color.
 1582       @param destinationPageIndex Page index where the link points to.
 1583       @param destinationX_u X-origin of the destination on the page, in the current unit.
 1584       @param destinationY_u Y-origin of the destination on the page, in the current unit.
 1585       @return Created bookmark ID or 0, when the bookmark could not be created.
 1586 
 1587       @see GetUnit, CreateBookmarkRoot, CreateBookmarkSibling, CreateLinkAnnotation
 1588    */
 1589 
 1590    unsigned int CreateBookmarkSibling(unsigned int previousBookmarkID,
 1591                                       const wchar_t *title,
 1592                                       unsigned int flags,
 1593                                       COLORREF titleColor,
 1594                                       unsigned int destinationPageIndex,
 1595                                       unsigned int destinationX_u,
 1596                                       unsigned int destinationY_u);
 1597    /**<
 1598       Creates a new sibling (next) bookmark, which will target the given destination
 1599       page and the position in it. The object should hold a memory-based document.
 1600       Note, the bookmarks can be created only when the document is not drawing, to
 1601       have all the document pages available.
 1602 
 1603       @param previousBookmarkID Bookmark ID of the previous bookmark. The sibling will be
 1604          created as the next of this bookmark.
 1605       @param title Title of the bookmark.
 1606       @param flags Bit-or of @ref TLitePDFBookmarkFlags flags.
 1607       @param titleColor RGB value of the title text color.
 1608       @param destinationPageIndex Page index where the link points to.
 1609       @param destinationX_u X-origin of the destination on the page, in the current unit.
 1610       @param destinationY_u Y-origin of the destination on the page, in the current unit.
 1611       @return Created bookmark ID or 0, when the bookmark could not be created.
 1612 
 1613       @see CreateBookmarkRoot, CreateBookmarkChild, CreateLinkAnnotation
 1614    */
 1615 };
 1616 
 1617 }; // namespace litePDF
 1618 
 1619 using namespace litePDF;
 1620 
 1621 #endif // litePDFH
TOPlist