Package com.ironsoftware.ironpdf.stamp
Class HtmlStamper
- java.lang.Object
-
- com.ironsoftware.ironpdf.stamp.Stamper
-
- com.ironsoftware.ironpdf.stamp.HtmlStamper
-
public class HtmlStamper extends Stamper
Defines an HTML stamper allowing developers to edit aPdfDocument
by adding new content designed in HTML, CSS and JavaScript.An implementation of
Stamper
.
-
-
Constructor Summary
Constructors Constructor Description HtmlStamper()
Initializes a new instance of theHtmlStamper
class.HtmlStamper(String html)
Initializes a new instance of theHtmlStamper
class.HtmlStamper(String html, String baseUrlString)
Initializes a new instance of theHtmlStamper
class.HtmlStamper(String html, Path baseUrl)
Initializes a new instance of theHtmlStamper
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CssMediaType
getCssMediaType()
Gets css media type.String
getHtmlBaseUrl()
Gets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.int
getRenderDelay()
Deprecated.useStamper.getWaitFor()
insteadint
getTimeout()
Gets timeout.void
setCssMediaType(CssMediaType value)
Sets css media type.void
setHtmlBaseUrl(String value)
Sets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.void
setRenderDelay(int value)
Deprecated.void
setTimeout(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, getWaitFor, isStampBehindContent, setHorizontalAlignment, setHorizontalOffset, setHtml, setHyperlink, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOpacity, setRotation, setScale, setStampBehindContent, setVerticalAlignment, setVerticalOffset, setWaitFor
-
-
-
-
Constructor Detail
-
HtmlStamper
public HtmlStamper(String html)
Initializes a new instance of theHtmlStamper
class.- Parameters:
html
- The HTML string.
-
HtmlStamper
public HtmlStamper(String html, String baseUrlString)
Initializes a new instance of theHtmlStamper
class.- Parameters:
html
- The HTML string.baseUrlString
- The HTML base URL for which references to external CSS, Javascript and Image files will be relative.
-
HtmlStamper
public HtmlStamper(String html, Path baseUrl)
Initializes a new instance of theHtmlStamper
class.- 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 theHtmlStamper
class.
-
-
Method Detail
-
getHtmlBaseUrl
public final String 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
public final void setHtmlBaseUrl(String value)
Sets the HTML base URL for which references to external CSS, Javascript and Image files will be relative.- Parameters:
value
- the value
-
getRenderDelay
@Deprecated public final int getRenderDelay()
Deprecated.useStamper.getWaitFor()
instead
-
setRenderDelay
@Deprecated public final void setRenderDelay(int value)
Deprecated.
-
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
public final CssMediaType 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
public final void setCssMediaType(CssMediaType value)
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
-
-