typedef struct _DOCWRTPDFOPTIONS
{
DOCWRTOPTIONS Options;
DOCWRTPDFPROFILE PdfProfile;
DOCWRTFONTEMBED FontEmbed;
L_BOOL bImageOverText;
L_BOOL bLinearized;
L_WCHAR *pwszTitle;
L_WCHAR *pwszSubject;
L_WCHAR *pwszKeywords;
L_WCHAR *pwszAuthor;
L_BOOL bProtected;
L_CHAR *pszUserPassword;
L_CHAR *pszOwnerPassword;
DOCWRTPDFENCRYPTIONMODE EncryptionMode;
L_BOOL bPrintEnabled;
L_BOOL bHighQualityPrintEnabled;
L_BOOL bCopyEnabled;
L_BOOL bEditEnabled;
L_BOOL bAnnotationsEnabled;
L_BOOL bAssemblyEnabled;
DOCWRT1BITIMGCOMP OneBitCompression;
DOCWRTCOLORIMGCOMP ColorImgCompression;
L_INT nQualityFactor;
DOCWRTPDFBOOKMARK PdfBookmark;
L_UINT32 uFlags;
DOCWRTPAGEFITTYPE PageFitType;
DOCWRTPAGEMODETYPE PageModeType;
DOCWRTPAGELAYOUTTYPE PageLayoutType;
L_INT nInitialPage;
L_DOUBLE dZoomPercent;
L_DOUBLE dXCoordinate;
L_DOUBLE dYCoordinate;
L_BOOL bHideToolbar;
L_BOOL bHideMenubar;
L_BOOL bHideWindowUI;
L_BOOL bFitWindow;
L_BOOL bCenterWindow;
L_BOOL bDisplayDocTitle;
} DOCWRTPDFOPTIONS, *pDOCWRTPDFOPTIONS;
The DOCWRTPDFOPTIONS structure provides information about PDF document files.
Member | Description | |
---|---|---|
Options | DOCWRTOPTIONS structure that contains options for a PDF file. | |
PdfProfile | Value that indicates the type of PDF file will be created. Possible values are: | |
Value | Meaning | |
DOCWRTPDFPROFILE_PDF | [0] The created file will be a regular PDF v1.4 document. This is the default value. | |
DOCWRTPDFPROFILE_PDFA | [1] The created file will be a PdfA document. | |
DOCWRTPDFPROFILE_PDF12 | [2] The created file will be Pdf v1.2 document. | |
DOCWRTPDFPROFILE_PDF13 | [3] The created file will be Pdf v1.3 document. | |
DOCWRTPDFPROFILE_PDF15 | [4] The created file will be Pdf v1.5 document. | |
DOCWRTPDFPROFILE_PDF16 | [5] The created file will be Pdf v1.6 document. | |
FontEmbed | Value that indicates the font embedding mode to use when creating a PDF document. Possible values are: | |
Value | Meaning | |
DOCWRTFONTEMBED_NOEMBED | [0] So not embed fonts | |
DOCWRTFONTEMBED_AUTO | [1] Embed fonts that are not commonly available with the exception of Licensed Fonts. This is the default value. | |
DOCWRTFONTEMBED_FORCE | [2] Embed fonts that are not commonly available with Licensed Fonts. | |
DOCWRTFONTEMBED_ALL | [3] Embed all fonts, including the Licensed Fonts with the document. | |
bImageOverText | Flag that indicates whether to create an image over text PDF file. Possible values are: | |
Value | Meaning | |
TRUE | Creates an image over text PDF document. | |
FALSE | Creates a regular PDF document. This is the default value. | |
bLinearized | Flag that indicates whether to create a PDF document that is optimized for fast web viewing. Possible values are: | |
Value | Meaning | |
TRUE | Creates a fast web viewing PDF document. | |
FALSE | Creates a regular PDF document. This is the default value. | |
A linearized PDF file is a file that has been organized in such a way as to enable efficient, incremental access in a network environment.
Linearized PDF files allow the first page of the PDF file to be displayed in a user Web browser before the entire file is downloaded from the Web server. |
||
pwszTitle | Character string that contains the title of the PDF document. | |
pwszSubject | Character string that contains the subject of the created PDF document. | |
pwszKeywords | Character string that contains the keywords for the created PDF document. | |
pwszAuthor | Character string that contains the author of the created PDF document. | |
bProtected | Flag to indicate whether to create protected (encrypted) PDF document. Possible values are: | |
Value | Meaning | |
TRUE | Creates a protected PDF document. | |
FALSE | Creates a PDF document with no protection (not encrypted). This is the default value. | |
pszUserPassword | Character string that contains the user password to be used for opening/reading PDF file. | |
pszOwnerPassword | Character string that contains the owners password which is used when changing the rights of the PDF document. | |
EncryptionMode | Value that indicates the encryption level for the PDF document. Possible values are: | |
Value | Meaning | |
DOCWRTPDFENCRYPTIONMODE_RC128BIT | Uses High level encryption (128-bit RC4). This is the default value. | |
DOCWRTPDFENCRYPTIONMODE_RC40BIT | Uses Low level encryption (40-bit RC4). | |
bPrintEnabled | Flag that indicates whether to allow/disallow printing for the created PDF document. Possible values are: | |
Value | Meaning | |
TRUE | Allows printing for the PDF document. This is the default value. | |
FALSE | Disallows printing for the PDF document. | |
bHighQualityPrintEnabled | Flag that indicates whether to enable or disable external viewers and editors to print the resulting PDF document in high quality. This flag is available only for documents created with RC4 128-bit encryption. Possible values are: | |
Value | Meaning | |
TRUE | Enables printing the resulting PDF document in high quality. This is the default value. | |
FALSE | Disables printing the resulting PDF document in high quality. | |
bCopyEnabled | Flag that indicates whether to enable or disable external viewers and editors to copy text from the resulting PDF document. Possible values are: | |
Value | Meaning | |
TRUE | Enables copying text. This is the default value. | |
FALSE | Disables copying text. | |
bEditEnabled | Flag indicate whether to enable or disable external viewers and editors to edit the resulting PDF document. Possible values are: | |
Value | Meaning | |
TRUE | Enables editing the resulting PDF document. This is the default value. | |
FALSE | Disables editing the resulting PDF document. | |
bAnnotationsEnabled | Flag that indicates whether to enable or disable external viewers and editors to add annotations and comments to the resulting PDF document. Possible values are: | |
Value | Meaning | |
TRUE | Enables adding annotations and comments. This is the default value. | |
FALSE | Disable adding annotations and comments. | |
bAssemblyEnabled | Flag that indicates whether to enable or disable external viewers and editors to add or remove pages from the resulting PDF document. Possible values are: | |
Value | Meaning | |
TRUE | Enables adding or removing pages. This is the default value. | |
FALSE | Disables adding or removing pages. | |
OneBitCompression | Value that indicates the one bit image compression types. Possible values are: | |
Value | Meaning | |
DOCWRT1BITIMGCOMP_FLATE | [0] Uses flat compression for compressing one bit images. | |
DOCWRT1BITIMGCOMP_FAX_G31D | [1] Uses FAX G3_1D compression for compressing one bit images. | |
DOCWRT1BITIMGCOMP_FAX_G32D | [2] Uses FAX G3_2D compression for compressing one bit images. | |
DOCWRT1BITIMGCOMP_FAX_G4 | [3] Uses FAX G4 compression for compressing one bit images. | |
DOCWRT1BITIMGCOMP_LZW | [4] Uses LZW compression for compressing one bit images. | |
DOCWRT1BITIMGCOMP_JBIG2 | [5] Uses JBIG2 compression for compressing one bit images. | |
ColorImgCompression | Value that indicates the colored image compression types. Possible values are: | |
Value | Meaning | |
DOCWRTCOLORIMGCOMP_FLATE_JPEG | [0] Uses JPEG compression for images which are more than 8BPP, or for grayscale 8BPP, else use flat compression. | |
DOCWRTCOLORIMGCOMP_LZW_JPEG | [1] Uses JPEG compression for images which are more than 8BPP, or for grayscale 8BPP, else use LZW compression. | |
DOCWRTCOLORIMGCOMP_FLATE | [2] Uses flat compression for compressing colored images. | |
DOCWRTCOLORIMGCOMP_LZW | [3] Uses LZW compression for compressing colored images. | |
DOCWRTCOLORIMGCOMP_JPEG | [4] Uses JPEG compression for compressing colored images. | |
nQualityFactor |
Number that determines the degree of loss in the compression process. The higher factor the smaller size, this work for JPEG compression only. The default value is 80.
|
|
PdfBookmark | DOCWRTPDFBOOKMARK structure that contains settings for book marking PDF file. | |
uFlags | Flag that indicates the extra options for writing PDF files. Currently there are no flags. This is for future use. | |
PageFitType | The page fit type. For possible values, refer to DOCWRTPAGEFITTYPE enumeration. | |
PageModeType | The page mode type which is specifying how the document should be displayed when it is opened. For possible values, refer to DOCWRTPAGEMODETYPE enumeration. | |
PageLayoutType | The page layout mode to be used when the document is opened. For possible values, refer to DOCWRTPAGELAYOUTTYPE enumeration. | |
nInitialPage | The initial page number to be viewed when the PDF document is opened. | |
dZoomPercent | The initial page zoom percent; 100 equals no zoom. The default value is 0. | |
dXCoordinate | The horizontal coordinate in points inside initial page to display page at them. Default value is 0. | |
dYCoordinate | The vertical coordinate in points inside initial page to display page at them. Default value is 0. | |
bHideToolbar | Flag that indicates whether to hide/show the viewer application’s toolbar when the document is active. Possible values are: | |
Value | Meaning | |
TRUE | Hides the toolbar. | |
FALSE | Shows the toolbar. This is the default value. | |
bHideMenubar | Flag that indicates whether to hide/show the viewer application’s menu bar when the document is active. Possible values are: | |
Value | Meaning | |
TRUE | Hides the menu bar. | |
FALSE | Shows the menu bar. This is the default value. | |
bHideWindowUI | Flag that indicates whether to hide/show the user interface elements in the document’s window. Possible values are: | |
Value | Meaning | |
TRUE | Hides the user interface. The document’s contents will be displayed only. | |
FALSE | Shows the user interface. This is the default value. | |
bFitWindow | Flag that indicates whether to allow/disallow resizing the document’s window to fit the size of the first displayed page. Possible values are: | |
Value | Meaning | |
TRUE | Allows resizing. | |
FALSE | Disallows resizing. This is the default value. | |
bCenterWindow | Flag that indicates whether to allow/disallow positioning the document’s window in the center of the screen. Possible values are: | |
Value | Meaning | |
TRUE | Allows positioning. | |
FALSE | Disallows positioning. This is the default value. | |
bDisplayDocTitle | Flag that indicates whether to show/hide the document title on window’s title bar. Possible values are: | |
Value | Meaning | |
TRUE | Shows the document title. | |
FALSE | Hides the document title. This is the default value. |
pDOCWRTPDFOPTIONS is a pointer to DOCWRTPDFOPTIONS structure. Generally, where a function parameter type is pDOCWRTPDFOPTIONS, you can declare a DOCWRTPDFOPTIONS variable, update the structure's fields, and then pass the variable's address in the parameter. Declaring a pDOCWRTPDFOPTIONS variable is necessary only if your program requires a pointer.
Portable Document Format (PDF). PDF was developed by the Adobe Corporation to allow the exchange and viewing of electronic documents easily and reliably, independent of the environment in which they were created. This format lets you compress large documents to a size small enough to download very quickly. It is also becoming a powerful format for reproducing documents over the web.
The LEADTOOLS Document Writers support creating PDF and PDF/A documents. The following features are supported:
The Low Level encryption method (40-bit RC4), allows access for some PDF document areas to be restricted. The user may allow/disallow the following for the created PDF document: print document, modify document content, extract text and graphics, modify comments, etc.
The High Level Encryption method (128-bit RC4), allows you to have more restrictions beside the ones of the low level encryption method, so that the user here may allow/disallow printing high resolution and assemble the document.
User password is for opening/reading the PDF file. If you define the user password the resulting PDF file will be encrypted and you have to enter the user password to open it.
Owner password is used for changing the rights of the PDF document. When an owner password protected PDF document is viewed, the owner password is not requested, but it is requested when trying to change something in the password protected PDF file.
Also note that the pszUserPassword, pszOwnerPassword, DOCWRTPDFENCRYPTIONMODE, and Security permissions such as PrintEnabled, bHighQualityPrintEnabled, bCopyEnabled, bEditEnabled, bAnnotationsEnabled and bAssemblyEnabled only have effect if bProtected is TRUE.
bAssemblyEnabled has effect only if the encryption level is high (128-bit RC4), while bHighQualityPrintEnabled has effect only if bPrintEnabled is TRUE and the encryption level is high (128-bit RC4).
Fast web view (Linearization), Security options, and PDF document description options (author, title, subject and keywords) are available only for PDF and they are not supported for PDF/A.
The Bookmarks feature allows for the creation of bookmarks, which can be used to mark parts of a document for quick access. For more information refer to DOCWRTPDFBOOKMARK structure.
Before using the LEADTOOLS Document Writers SDK, unlock it by using the L_SetLicenseFile function. If you want to use the PDF format you must also unlock PDF support with L_SetLicenseFile.
This structure is used with the L_DocWriterConvert and L_DocWriterInit functions.