public class HtmlInfo extends Object
Encapsulates info for HTML when inporting HTML.
[C#] // Instantiate an object PDF class Pdf pdf = new Pdf(); // add the section to PDF document sections collection Aspose.Pdf.Generator.Section section = pdf.Sections.Add(); // Read the contents of HTML file into StreamReader object StreamReader Stream = File.OpenText(
Modifier and Type | Class and Description |
---|---|
static class |
HtmlInfo.CharsetApplyingForceLevel
It enumerates possible levels of enforcing of usage of preferrable
encoding when document is loaded from HTML-stream.
|
Modifier and Type | Field and Description |
---|---|
int |
badHtmlHandlingStrategy_
This parameter is used during HTML to PDF conversion of textblocks
where IsHtmlTagSupported flag set as 'true'.
|
int |
charsetApplyingLevelOfForce
This field is in use when document is loaded from HTML-stream.
|
String |
SandboxOptions |
boolean |
showUnknownHtmlTagsAsText |
boolean |
shrinkLongImagesToPageHeight
Gets or sets a bool value that indicates whether durimg HTML
conversion big images will be shrinked vertically to match page's size.
|
boolean |
useNewHtmlConvertorForEachHtmlTextBlock
This parameter is used during HTML to PDF conversion and by default
set to 'True'.
|
Constructor and Description |
---|
HtmlInfo() |
Modifier and Type | Method and Description |
---|---|
String |
getCharSet()
Gets or sets a string value that indicates character-set of the HTML
document
|
String |
getExternalResourcesBasePath()
Gets or sets the external resources base path.
|
String |
getImgUrl()
Gets or sets a string value that indicates the image url as from the
database when converting HTML to PDF.
|
float |
getListLabelWidth()
Gets or sets a float value that indicates the width of the label in
HTML list.
|
int |
getListLevelIndent()
Gets or sets a float value that indicates the horizontal shift when
go to next layer in lists.
|
MarginInfo |
getMargin()
Gets or sets a
MarginInfo object that indicates the page
margin info. |
float |
getMarginAboveP() |
float |
getMarginBelowP() |
float |
getPageHeight()
Gets or sets a float value that indicates the page height of the PDF
document when converting HTML to PDF.
|
float |
getPageWidth()
Gets or sets a float value that indicates the page width of the PDF
document when converting HTML to PDF.
|
String |
getSvgUrl()
Gets or sets a string value that indicates the svg url when
converting Embedded Svg HTML to PDF.
|
MarginInfo |
getTdPadding()
Gets or sets a
MarginInfo object that indicates the cell's
padding. |
MarginInfo |
getTdTextMargin()
Gets or sets a
MarginInfo object that indicates the cell
text's margin. |
int |
getTimeOut()
Gets or sets an int value that indicates the maximum time for a Http
request to get response.
|
boolean |
getTryEnlargePredefinedTableColumnWidthsToAvoidWordBreaking() |
boolean |
isLandScape()
Gets or sets a bool value that indicates whether the page orientation
is landscape.
|
void |
isLandScape(boolean value) |
String |
resolveImageUri(String imageUriFromStyle) |
void |
setCharSet(String value) |
void |
setExternalResourcesBasePath(String value) |
void |
setImgUrl(String value) |
void |
setListLabelWidth(float value) |
void |
setListLevelIndent(int value) |
void |
setMargin(MarginInfo value) |
void |
setMarginAboveP(float value) |
void |
setMarginBelowP(float value) |
void |
setPageHeight(float value) |
void |
setPageWidth(float value) |
void |
setSvgUrl(String value) |
void |
setTdPadding(MarginInfo value) |
void |
setTdTextMargin(MarginInfo value) |
void |
setTimeOut(int value) |
void |
setTryEnlargePredefinedTableColumnWidthsToAvoidWordBreaking(boolean value) |
public boolean shrinkLongImagesToPageHeight
Gets or sets a bool value that indicates whether durimg HTML conversion big images will be shrinked vertically to match page's size. The default is false.
public int charsetApplyingLevelOfForce
This field is in use when document is loaded from HTML-stream. (in such case stream is converted to HTML-string). This attribute tells loader how to treat preferrable encoding (as mandatory or as preferrable). Applied charset (it's web-name) specified in attribute 'CharSet'.
public String SandboxOptions
public boolean useNewHtmlConvertorForEachHtmlTextBlock
This parameter is used during HTML to PDF conversion and by default set to 'True'. It means that for each textblock treated as HTML(having isHtmlTagSupported flag set as 'True') will be created it's own converter. Such strategy does not work good on HTML pages with huge amount of textblocks with relatively simple HTML cause creation of Html conversion classes is relatively expensive operation. To deminish conversion time in such cases please set this parameter to 'False'.
public int badHtmlHandlingStrategy_
This parameter is used during HTML to PDF conversion of textblocks where IsHtmlTagSupported flag set as 'true'. It selects strategy of handling of situation when serious errors in converted HTML detected and Aspose.PDF unable normally process HTML markup. By default in such situation will be thrown exception . If this parameter set as 'TreateAsPlainText' - then instead of exception generation, IsHtmlTagSupported for processed textblock will be forcebly reset and processing of that textblock will be continued but it's content will be treated as plain text without markup
public boolean showUnknownHtmlTagsAsText
public String getExternalResourcesBasePath()
Gets or sets the external resources base path.
Value: The external resources base path.public void setExternalResourcesBasePath(String value)
public boolean isLandScape()
Gets or sets a bool value that indicates whether the page orientation is landscape. The default is false, portrait.
public void isLandScape(boolean value)
public float getPageWidth()
Gets or sets a float value that indicates the page width of the PDF document when converting HTML to PDF. Default is A4 width.
public void setPageWidth(float value)
public float getPageHeight()
Gets or sets a float value that indicates the page height of the PDF document when converting HTML to PDF. Default is A4 height.
public void setPageHeight(float value)
public MarginInfo getMargin()
Gets or sets a MarginInfo
object that indicates the page
margin info.
public void setMargin(MarginInfo value)
public String getCharSet()
Gets or sets a string value that indicates character-set of the HTML document
public void setCharSet(String value)
public String getImgUrl()
Gets or sets a string value that indicates the image url as from the database when converting HTML to PDF.
public void setImgUrl(String value)
public String getSvgUrl()
Gets or sets a string value that indicates the svg url when converting Embedded Svg HTML to PDF.
public void setSvgUrl(String value)
public MarginInfo getTdPadding()
Gets or sets a MarginInfo
object that indicates the cell's
padding.
public void setTdPadding(MarginInfo value)
public MarginInfo getTdTextMargin()
Gets or sets a MarginInfo
object that indicates the cell
text's margin.
public void setTdTextMargin(MarginInfo value)
public float getListLabelWidth()
Gets or sets a float value that indicates the width of the label in HTML list. Default value is 30 points.
public void setListLabelWidth(float value)
public int getListLevelIndent()
Gets or sets a float value that indicates the horizontal shift when go to next layer in lists. Default value is 32 points.
public void setListLevelIndent(int value)
public int getTimeOut()
Gets or sets an int value that indicates the maximum time for a Http request to get response. Default value is Timeout.Infinite. Once you set the value in your code, you must also handle the WebException. Otherwise there will be an error in your program when your HttpWebRequest expires.
public void setTimeOut(int value)
public float getMarginAboveP()
public void setMarginAboveP(float value)
public float getMarginBelowP()
public void setMarginBelowP(float value)
public boolean getTryEnlargePredefinedTableColumnWidthsToAvoidWordBreaking()
public void setTryEnlargePredefinedTableColumnWidthsToAvoidWordBreaking(boolean value)
Copyright © 2016 Aspose. All Rights Reserved.