Click or drag to resize
Pdf Library for .NET

HtmlToPdfOptionsAutoFitWidth Property

Specifies the html content horizontal auto fit mode.

Namespace:  SelectPdf
Assembly:  Select.HtmlToPdf (in Select.HtmlToPdf.dll) Version: 22.1
Syntax
public HtmlToPdfPageFitMode AutoFitWidth { get; set; }

Property Value

Type: HtmlToPdfPageFitMode
Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized horizontally in any way to fit the available space. If the content is larger, it will be cut and not all of it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content width is larger than the destination space (pdf page or rectangle) width. In this case, the content is shrunk to fit the destination space width and the elements that it contains (texts, images) will appear smaller in the generated pdf document than in the original web page. If the original content width is smaller than the destination width, no adjustments will be done and the content will be rendered exactly as it is, even though some additional white space might appear to its right.

If this property is set to AutoFit, the html content is resized to fit the available width of the destination space. If the original content width is smaller than the destination width, the elements rendered (texts, images) will appear larger in the generated pdf document. If the original content width is larger than the destination width, the elements rendered (texts, images) will appear smaller in the generated pdf document.

The default value of this property is ShrinkOnly.

See Also