KVPDFOptions

This structure modifies PDF Export options.

typedef struct
{
	KVStructHeader;
	char pszSourceFilePassword[MAX_PASSWORD_LEN];
	double pageWidthInches;
	double pageHeightInches;
}
KVPDFOptions;

Member Descriptions

KVStructHeader The KeyView version of the structure. See KVStructHead.
pszSourceFilePassword A fixed length char array, which should either be left zero-filled, or contain a password as a null-terminated C string.
pageWidthInches The default page width to use when a page width cannot be determined from the source document, in inches.
pageHeightInches The default page height to use when a page height cannot be determined from the source document, in inches.

Discussion

KeyView attempts to determine appropriate page dimensions from a file before resorting to using pageWidthInches and pageHeightInches. KeyView could use, for example, the height of slides in a presentation format file or the right-most column filled in a spreadsheet.

Unless both pageWidthInches and pageHeightInches are specified, they must both be equal to zero.

US letter dimensions are used when no dimensions can be obtained from a document and pageWidthInches and pageHeightInches are not set.

Examples

In this example, an options structure is filled with a password (pszPassword here). You might use this option in a call to fpConvertFileToFile() to open a password protected document.

KVPDFOptions getPDFOptionsStructContainingPassword(const char* const pszPassword)
{
    KVPDFOptions sOptions = {0};
    KVStructInit(&sOptions);
    // Copy ensuring the password is always null-terminated.
    strncpy(sOptions.pszSourceFilePassword, pszPassword, MAX_PASSWORD_LEN - 1);
    return sOptions;
}

The following example shows a function that sets the default page width and height in a KVPDFOptions structure. KeyView uses these values when it cannot determine appropriate page dimensions from the input file.

void setPageWidthAndHeight(
    KVPDFOptions* const optionsStructToDecorate,
    const double pageWidthInInches,
    const double pageHeightInInches)
{
    optionsStructToDecorate->pageWidthInches = pageWidthInInches;
    optionsStructToDecorate->pageHeightInches = pageHeightInInches;
}