Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
typedef struct _RASTERIZEDOCOPTIONS
{
L_UINT uStructSize;
L_DOUBLE dPageWidth;
L_DOUBLE dPageHeight;
L_DOUBLE dLeftMargin;
L_DOUBLE dTopMargin;
L_DOUBLE dRightMargin;
L_DOUBLE dBottomMargin;
RASTERIZEDOC_UNIT
uUnit;
L_UINT uXResolution;
L_UINT uYResolution;
RASTERIZEDOC_SIZEMODE
uSizeMode;
} RASTERIZEDOCOPTIONS, *pRASTERIZEDOCOPTIONS;
The RASTERIZEDOCOPTIONS structure provides information about rasterizing document files in LEADTOOLS.
Member |
Description |
|
uStructSize |
Size of the structure. This must be set before passing this structure to the LEAD functions. Use the sizeof(RASTERIZEDOCOPTIONS) macro to calculate this value. |
|
dPageWidth |
The width of the result BITMAPHANDLE measured by uUnit value. Default value is 8.5 inches. The value of dPageWidth must be greater than 0. The value of the result raster image width and height in pixels depends on the current resolution and size mode values. When the value of uSizeMode is set to RASTERIZEDOC_SIZEMODE_NONE, the original document size is kept and hence dPageWidth and dPageHeight will not be used. | |
dPageHeight |
The height of the result BITMAPHANDLE measured by uUnit value. Default value is 11 inches. The value of dPageHeight must be greater than 0. |
|
dLeftMargin |
The margin value measured by uUnit value to use when rasterizing a document to a raster image. Default value is 1.25 inches. The value of dLeftMargin must be greater than or equal to 0. The value of the dLeftMargin, dTopMargin, dRightMargin and dBottomMargin are only used when loading RTF and TXT documents. They are not used when loading other document formats such as PDF, XPS and XLS. |
dTopMargin |
The margin value measured by uUnit value to use when rasterizing a document to a raster image. Default value is 1.0 inches. The value of dTopMargin must be greater than or equal to 0. |
|
dRightMargin |
The margin value measured by uUnit value to use when rasterizing a document to a raster image. Default value is 1.25 inches. The value of dRightMargin must be greater than or equal to 0. |
|
dBottomMargin |
The margin value measured by uUnit value to use when rasterizing a document to a raster image. Default value is 1.0 inches. The value of dBottomMargin must be greater than or equal to 0. |
|
uUnit |
The unit to use for dPageWidth, dPageHeight, dLeftMargin, dTopMargin, dRightMargin and dBottomMargin. Default value is RASTERIZEDOC_UNIT_INCH. Possible value are: |
|
|
Value |
Meaning |
|
RASTERIZEDOC_UNIT_PIXEL |
[0] The values are in pixels. |
|
RASTERIZEDOC_UNIT_INCH |
[1] The values are in inches. |
|
RASTERIZEDOC_UNIT_MILLIMETER |
[2] The values are in millimeters. |
uXResolution |
The horizontal resolution to use when rasterizing document files. A value of 0 means use the current screen resolution. The default value is 150. |
|
uYResolution |
The vertical resolution to use when rasterizing document files. A value of 0 means use the current screen resolution. The default value is 150. |
uSizeMode |
The transformation to use when converting the logical size specified in dPageWidth and dPageHeight to the final physical raster image size. Default value is RASTERIZEDOC_SIZEMODE_NONE. |
|
|
You can use the uSizeMode to control how to use dPageWidth and dPageHeight to control the final raster image size. LEADTOOLS will determine the original document size (a value that can be obtained in FILEINFO.dDocPageWidth and FILEINFO.dDocPageHeight) |
|
|
and then apply the transformation from this value to determine the final bitmap width and height as follows: |
|
|
Value |
Description |
|
RASTERIZEDOC_SIZEMODE_NONE |
[0] Use the original document width and height. No transformation will be performed and dPageWidth and dPageHeight are not used. |
|
The final bitmap will have a width or height value equals to the original document size. |
|
|
RASTERIZEDOC_SIZEMODE_FIT |
[1] Fit the result raster image into dPageWidth and dPageHeight while maintaining the aspect ratio. If the original document size is smaller than the requested page size, no transformation is performed. |
|
The final bitmap will have a width or height equal to or less than the requested page width or height but not greater. |
|
|
RASTERIZEDOC_SIZEMODE_FIT_ALWAYS |
[2] Always fit the result raster image into dPageWidth and dPageHeight while maintaining the aspect ratio. If the original document size is smaller than the requested page size, then the result image is scaled up. |
|
The final bitmap will have a width or height equal to the requested page width or height. Not less and not greater. |
|
|
RASTERIZEDOC_SIZEMODE_FIT_WIDTH |
[3] Fit the result raster image width into dPageWidth while maintaining the aspect ratio. The image height will be calculated based on the transformation and dPageHeight is not used. |
|
The final bitmap will have a width equal to the requested page width. The height depends on the original document height. |
|
|
RASTERIZEDOC_SIZEMODE_STRETCH |
[4] The result raster image width and height will be exactly equal to dPageWidth and dPageHeight. Aspect ratio might be different than the original document. |
|
The final image will have a width and height equal to the requested page width and height. |
Comments
pRASTERIZEDOCOPTIONS is a pointer to a RASTERIZEDOCOPTIONS structure.
The following functions make use of this structure: