If this property is set to AutoFit, the html content is resized to fit the available width of the destination space. Will be rendered exactly as it is, even though some additional white space might appear to its right. If the original content width is smaller than the destination width, no adjustments will be done and the content (texts, images) will appear smaller in the generated pdf document than in the original web page. In this case, the content is shrunk to fit the destination space width and the elements that it contains The html content is resized only if the content width is larger than the destination space If the content is larger, it will be cut and not all of it will be displayed in the generated pdf file. The html content is not resized horizontally in any way to fit the available space. The converter considers both AutoFitWidth andĪutoFitHeight when the html content is rendered in the pdf page or specified rectangle. Select.Pdf Html to Pdf Converter has a few properties that control how the content from the web page is resized during the rendering into the pdf document:ĪutoFitWidth - Specifies the html content horizontal auto fit mode. Is larger than this pdf page width, when the content is rendered into pdf, it will either get trucated or it needs to be resized (shrinked) to fit the pdf page width. Because the web page width (1024px or more) This means that an A4 page width is 793px. Note: If WebPageFixedSize is set to true, a page height needs to be set using WebPageHeight,īecause the default value (0) will make the converter fail (cannot render a web page with no height).īecause a web page has generally a different width compared with a standard pdf page, the content will not fit perfectly when the web page content is rendered into pdf.Īs an example, most web sites are optimized for browsers with page widths of at least 1024px or 1280px.Ī standard A4 page has 595 x 842 points. These dimensions with be used even though the content will not fit the available space and it will be truncated. If WebPageFixedSize is set to true, this will indicate the converter not to calculate another width and height,īut use width and height specified by WebPageWidth and The converter will try to automatically calculate a larger width and height to be able to display the whole html content. WebPageHeight properties and WebPageFixedSize is set to false, If the web page does not fit the dimensions specified by the WebPageWidth and The default value of this property is false. Controls whether the web page is rendered with a fixed size internal browser or the size automatically extends to make the whole content visible. Only using the default 0 value will allow the whole page content to be rendered all the time in the generated pdf document. The content that exceeds this page height is truncated and will not appear in the generated pdf document. Otherwise no content might appear in the generated pdf. (for example for web pages with frames) and in that case, WebPageHeight needs to be set, Generally this property does not need to be changed, but there are situations when the converter cannot calculate correctly the web page height This means that the converter will automatically calculate the page height. The web page height is specified in pixels and the default value is 0px. Gets or sets the height of the converted web page as it would appear in the internal browser used to render the html. This property can also be set directly in the constructor of HtmlToPdf class. The converter will automatically determine the page width, finding the width that will fit the html content. WebPageHeight even though the content might be truncated. The web page will be rendered with the specified WebPageWidth and To avoid this, the WebPageFixedSize property needs to be set to true. If the content does not fit this width, the converter will automatically resize the internal browser to fit the whole html content. The page width is only an indication of the minimum page width recommended for conversion. The web page width is specified in pixels and the default value is 1024px. Gets or sets the width of the converted web page as it would appear in the internal browser used to render the html. There are some properties thatĬontrol how the web page will look in the internal browser: Select.Pdf Html to Pdf Converter has an internal browser that renders the web page just like a regular browser. More details about this in the following section: The size of the pdf pages can be specified using PdfPageSize Select.Pdf Library needs to perform some operations on the content rendered from the web page to be able to display it in the pdf page. Html pages that are converted to pdf and pdf pages in the generated document usually do not have the same size.
0 Comments
Leave a Reply. |