Gets or sets a value that indicates the transformation to use when converting the logical size specified in PageWidth and PageHeight to the final physical raster image size.
public CodecsRasterizeDocumentSizeMode SizeMode { get; set; }
Public Property SizeMode As CodecsRasterizeDocumentSizeMode
@property (nonatomic, assign) LTCodecsRasterizeDocumentSizeMode sizeMode
public CodecsRasterizeDocumentSizeMode getSizeMode()
public void setSizeMode(CodecsRasterizeDocumentSizeMode value)
public:
property CodecsRasterizeDocumentSizeMode SizeMode {
CodecsRasterizeDocumentSizeMode get();
void set ( CodecsRasterizeDocumentSizeMode );
}
A CodecsRasterizeDocumentSizeMode enumeration member that indicates the transformation to use when converting the logical size specified in PageWidth and PageHeight to the final physical raster image size. Default value is CodecsRasterizeDocumentSizeMode.None.
LEADTOOLS provides support for loading a document as a raster image. Document formats such as PDF, XPS, DOCX/DOC, PPTX/PPT, XLSS/XLS, RTF and Text do not contain physical width, height or resolution. It is up to the loader (in this case, the RasterCodecs object) to specify the transformation from logical coordinates to physical pixels through a process called rasterization. For more information, refer to CodecsRasterizeDocumentLoadOptions.
You can use the SizeMode property to specify how to use PageWidth and PageHeight to control the final raster image size. LEADTOOLS will determine the original document size (a value that can be obtained in CodecsDocumentImageInfo.PageWidth and CodecsDocumentImageInfo.PageHeight) and then apply the transformation from this value to determine the final RasterImage width and height as follows:
CodecsRasterizeDocumentLoadOptions.SizeMode | Description |
---|---|
CodecsRasterizeDocumentSizeMode.None |
Use the original document width and height. No transformation will be performed and CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight are not used. The final RasterImage will have a width or height value equals to the original document size. |
CodecsRasterizeDocumentSizeMode.Fit |
Fit the resulting raster image into CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight while maintaining the aspect ratio. If the original document size is smaller than the requested page size, no transformation is performed. The final RasterImage will have a width or height equal to or less than the requested page width or height but not greater. |
CodecsRasterizeDocumentSizeMode.FitAlways |
Always fit the resulting raster image into CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight while maintaining the aspect ratio. If the original document size is smaller than the requested page size, then the resulting image is scaled up. The final RasterImage will have a width or height equal to the requested page width or height. Not less and not greater. |
CodecsRasterizeDocumentSizeMode.FitWidth |
Fit the resulting raster image width into CodecsRasterizeDocumentLoadOptions.PageWidth while maintaining the aspect ratio. The image height will be calculated based on the transformation and CodecsRasterizeDocumentLoadOptions.PageHeight is not used. The final RasterImage will have a width equal to the requested page width. The height depends on the original document height. |
CodecsRasterizeDocumentSizeMode.Stretch |
The resulting raster image width and height will be exactly equal to CodecsRasterizeDocumentLoadOptions.PageWidth and CodecsRasterizeDocumentLoadOptions.PageHeight. The aspect ratio can be different than the original document. The final RasterImage will have a width and height equal to the requested page width and height. |
CodecsRasterizeDocumentLoadOptions Class
CodecsRasterizeDocumentLoadOptions Members
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document