Package com.ironsoftware.ironpdf.stamp
Class HtmlStamper
java.lang.Object
com.ironsoftware.ironpdf.stamp.Stamper
com.ironsoftware.ironpdf.stamp.HtmlStamper
Defines an HTML stamper allowing developers to edit a
PdfDocument by adding new content designed in HTML, CSS and JavaScript.
An implementation of Stamper.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of theHtmlStamperclass.HtmlStamper(String html) Initializes a new instance of theHtmlStamperclass.HtmlStamper(String html, String baseUrlString) Initializes a new instance of theHtmlStamperclass.HtmlStamper(String html, Path baseUrl) Initializes a new instance of theHtmlStamperclass. -
Method Summary
Modifier and TypeMethodDescriptionfinal CssMediaTypeGets css media type.final StringGets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.final intGets render delay.final intGets timeout.final voidsetCssMediaType(CssMediaType value) Sets css media type.final voidsetHtmlBaseUrl(String value) Sets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.final voidsetRenderDelay(int value) Sets render delay.final voidsetTimeout(int value) Sets timeout.Methods inherited from class com.ironsoftware.ironpdf.stamp.Stamper
getHorizontalAlignment, getHorizontalOffset, getHtml, getHyperlink, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getRotation, getScale, getVerticalAlignment, getVerticalOffset, isStampBehindContent, setHorizontalAlignment, setHorizontalOffset, setHtml, setHyperlink, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOpacity, setRotation, setScale, setStampBehindContent, setVerticalAlignment, setVerticalOffset
-
Constructor Details
-
HtmlStamper
Initializes a new instance of theHtmlStamperclass.- Parameters:
html- The HTML string.
-
HtmlStamper
Initializes a new instance of theHtmlStamperclass.- Parameters:
html- The HTML string.baseUrlString- The HTML base URL for which references to external CSS, Javascript and Image files will be relative.
-
HtmlStamper
Initializes a new instance of theHtmlStamperclass.- Parameters:
html- The HTML string.baseUrl- The HTML base URL for which references to external CSS, Javascript and Image files will be relative.
-
HtmlStamper
public HtmlStamper()Initializes a new instance of theHtmlStamperclass.
-
-
Method Details
-
getHtmlBaseUrl
Gets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.- Returns:
- the html base url
-
setHtmlBaseUrl
Sets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.- Parameters:
value- the value
-
getRenderDelay
public final int getRenderDelay()Gets render delay. Milliseconds to wait after Html is rendered before printing. This can use useful when considering the rendering of JavaScript, WebFonts, Ajax or animations.Default value is 0.
- Returns:
- the render delay
-
setRenderDelay
public final void setRenderDelay(int value) Sets render delay. Milliseconds to wait after Html is rendered before printing. This can use useful when considering the rendering of JavaScript, WebFonts, Ajax or animations.Default value is 0.
- Parameters:
value- the value
-
getTimeout
public final int getTimeout()Gets timeout. Render timeout in secondsDefault value is 60.
- Returns:
- the timeout
-
setTimeout
public final void setTimeout(int value) Sets timeout. Render timeout in secondsDefault value is 60.
- Parameters:
value- the value
-
getCssMediaType
Gets css media type. Enables Media="screen" CSS Styles and StyleSheetsNote: By setting CssMediaType=PRINT, IronPdf renders Stamp from HTML using CSS for media="print" as if printing a web page in a browser print dialog. It renders exactly as per Google Chrome.
Default value is CssMediaType.SCREEN.
- Returns:
- the css media type
-
setCssMediaType
Sets css media type. Enables Media="screen" CSS Styles and StyleSheetsNote: By setting CssMediaType=PRINT, IronPdf renders Stamp from HTML using CSS for media="print" as if printing a web page in a browser print dialog. It renders exactly as per Google Chrome.
Default value is CssMediaType.SCREEN.
- Parameters:
value- the value
-