Table of Contents

Method CreateFitSize

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

CreateFitSize(PdfSize, bool)

Creates draw options for producing images of PDF pages resized to fit the specified size.

public static PdfDrawOptions CreateFitSize(PdfSize sizePixels, bool cutUnusedSpace)

Parameters

sizePixels PdfSize

The size of images in pixels.

cutUnusedSpace bool

Defines whether to cut unused space.

Returns

PdfDrawOptions

The options for producing images of PDF pages resized to fit the specified size.

Remarks

The width and height should be in the [1..10000] range.

If cutUnusedSpace is true then produced images will have the width and height equal to the width and height of the corresponding PDF pages, resized to fit specified size.

If cutUnusedSpace is false then produced images will have the size equal to the size specified by sizePixels. The corresponding PDF pages will be drawn in the center of their image, preserving aspect ratio. The unused space will be filled with the transparent color.

Use HorizontalResolution and VerticalResolution properties to change the pixel density (i.e., the physical size) of the output image.

The Convert PDF to image in C# and VB.NET article contains examples of using this method.