public static final class Pdfcrowd.HtmlToPdfClient
extends java.lang.Object
Constructor and Description |
---|
HtmlToPdfClient(java.lang.String userName,
java.lang.String apiKey)
Constructor for the Pdfcrowd API client.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
convertFile(java.lang.String file)
Convert a local file.
|
void |
convertFileToFile(java.lang.String file,
java.lang.String filePath)
Convert a local file and write the result to a local file.
|
void |
convertFileToStream(java.lang.String file,
java.io.OutputStream outStream)
Convert a local file and write the result to an output stream.
|
byte[] |
convertString(java.lang.String text)
Convert a string.
|
void |
convertStringToFile(java.lang.String text,
java.lang.String filePath)
Convert a string and write the output to a file.
|
void |
convertStringToStream(java.lang.String text,
java.io.OutputStream outStream)
Convert a string and write the output to an output stream.
|
byte[] |
convertUrl(java.lang.String url)
Convert a web page.
|
void |
convertUrlToFile(java.lang.String url,
java.lang.String filePath)
Convert a web page and write the result to a local file.
|
void |
convertUrlToStream(java.lang.String url,
java.io.OutputStream outStream)
Convert a web page and write the result to an output stream.
|
int |
getConsumedCreditCount()
Get the number of credits consumed by the last conversion.
|
java.lang.String |
getDebugLogUrl()
Get the URL of the debug log for the last conversion.
|
java.lang.String |
getJobId()
Get the job id.
|
int |
getOutputSize()
Get the size of the output in bytes.
|
int |
getPageCount()
Get the total number of pages in the output document.
|
int |
getRemainingCreditCount()
Get the number of conversion credits available in your account.
|
Pdfcrowd.HtmlToPdfClient |
setAuthor(java.lang.String author)
Set the author of the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setBlockAds(boolean blockAds)
Try to block ads.
|
Pdfcrowd.HtmlToPdfClient |
setCenterWindow(boolean centerWindow)
Specify whether to position the document's window in the center of the screen.
|
Pdfcrowd.HtmlToPdfClient |
setClientCertificate(java.lang.String clientCertificate)
A client certificate to authenticate Pdfcrowd converter on your web server.
|
Pdfcrowd.HtmlToPdfClient |
setClientCertificatePassword(java.lang.String clientCertificatePassword)
A password for PKCS12 file with a client certificate if it's needed.
|
Pdfcrowd.HtmlToPdfClient |
setConvertImagesToJpeg(java.lang.String convertImagesToJpeg)
Specify which image types will be converted to JPEG.
|
Pdfcrowd.HtmlToPdfClient |
setCookies(java.lang.String cookies)
Set cookies that are sent in Pdfcrowd HTTP requests.
|
Pdfcrowd.HtmlToPdfClient |
setCustomHttpHeader(java.lang.String customHttpHeader)
Set a custom HTTP header that is sent in Pdfcrowd HTTP requests.
|
Pdfcrowd.HtmlToPdfClient |
setCustomJavascript(java.lang.String customJavascript)
Run a custom JavaScript after the document is loaded and ready to print.
|
Pdfcrowd.HtmlToPdfClient |
setDebugLog(boolean debugLog)
Turn on the debug logging.
|
Pdfcrowd.HtmlToPdfClient |
setDefaultEncoding(java.lang.String defaultEncoding)
Set the default HTML content text encoding.
|
Pdfcrowd.HtmlToPdfClient |
setDisableImageLoading(boolean disableImageLoading)
Do not load images.
|
Pdfcrowd.HtmlToPdfClient |
setDisableJavascript(boolean disableJavascript)
Do not execute JavaScript.
|
Pdfcrowd.HtmlToPdfClient |
setDisableRemoteFonts(boolean disableRemoteFonts)
Disable loading fonts from remote sources.
|
Pdfcrowd.HtmlToPdfClient |
setDisableSmartShrinking(boolean disableSmartShrinking)
Disable the intelligent shrinking strategy that tries to optimally fit the HTML contents to a PDF page.
|
Pdfcrowd.HtmlToPdfClient |
setDisplayTitle(boolean displayTitle)
Specify whether the window's title bar should display the document title.
|
Pdfcrowd.HtmlToPdfClient |
setElementToConvert(java.lang.String selectors)
Convert only the specified element from the main document and its children.
|
Pdfcrowd.HtmlToPdfClient |
setElementToConvertMode(java.lang.String mode)
Specify the DOM handling when only a part of the document is converted.
|
Pdfcrowd.HtmlToPdfClient |
setEncrypt(boolean encrypt)
Encrypt the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setExcludeFooterOnPages(java.lang.String pages)
The page footer is not printed on the specified pages.
|
Pdfcrowd.HtmlToPdfClient |
setExcludeHeaderOnPages(java.lang.String pages)
The page header is not printed on the specified pages.
|
Pdfcrowd.HtmlToPdfClient |
setFailOnAnyUrlError(boolean failOnError)
Abort the conversion if any of the sub-request HTTP status code is greater than or equal to 400 or if some sub-requests are still pending.
|
Pdfcrowd.HtmlToPdfClient |
setFailOnMainUrlError(boolean failOnError)
Abort the conversion if the main URL HTTP status code is greater than or equal to 400.
|
Pdfcrowd.HtmlToPdfClient |
setFitWindow(boolean fitWindow)
Specify whether to resize the document's window to fit the size of the first displayed page.
|
Pdfcrowd.HtmlToPdfClient |
setFooterHeight(java.lang.String footerHeight)
Set the footer height.
|
Pdfcrowd.HtmlToPdfClient |
setFooterHtml(java.lang.String footerHtml)
Use the specified HTML as the page footer.
|
Pdfcrowd.HtmlToPdfClient |
setFooterUrl(java.lang.String footerUrl)
Load an HTML code from the specified URL and use it as the page footer.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderFooterScaleFactor(int headerFooterScaleFactor)
Set the scaling factor (zoom) for the header and footer.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderHeight(java.lang.String headerHeight)
Set the header height.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderHtml(java.lang.String headerHtml)
Use the specified HTML code as the page header.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderUrl(java.lang.String headerUrl)
Load an HTML code from the specified URL and use it as the page header.
|
Pdfcrowd.HtmlToPdfClient |
setHideMenubar(boolean hideMenubar)
Specify whether to hide the viewer application's menu bar when the document is active.
|
Pdfcrowd.HtmlToPdfClient |
setHideToolbar(boolean hideToolbar)
Specify whether to hide the viewer application's tool bars when the document is active.
|
Pdfcrowd.HtmlToPdfClient |
setHideWindowUi(boolean hideWindowUi)
Specify whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed.
|
Pdfcrowd.HtmlToPdfClient |
setHttpAuth(java.lang.String userName,
java.lang.String password)
Set credentials to access HTTP base authentication protected websites.
|
Pdfcrowd.HtmlToPdfClient |
setHttpAuthPassword(java.lang.String password)
Set the HTTP authentication password.
|
Pdfcrowd.HtmlToPdfClient |
setHttpAuthUserName(java.lang.String userName)
Set the HTTP authentication user name.
|
Pdfcrowd.HtmlToPdfClient |
setHttpProxy(java.lang.String httpProxy)
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTP scheme.
|
Pdfcrowd.HtmlToPdfClient |
setHttpsProxy(java.lang.String httpsProxy)
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTPS scheme.
|
Pdfcrowd.HtmlToPdfClient |
setImageDpi(int imageDpi)
Set the DPI of images in PDF.
|
Pdfcrowd.HtmlToPdfClient |
setInitialPage(int initialPage)
Display the specified page when the document is opened.
|
Pdfcrowd.HtmlToPdfClient |
setInitialZoom(int initialZoom)
Specify the initial page zoom in percents when the document is opened.
|
Pdfcrowd.HtmlToPdfClient |
setInitialZoomType(java.lang.String initialZoomType)
Specify how the page should be displayed when opened.
|
Pdfcrowd.HtmlToPdfClient |
setJavascriptDelay(int javascriptDelay)
Wait the specified number of milliseconds to finish all JavaScript after the document is loaded.
|
Pdfcrowd.HtmlToPdfClient |
setJpegQuality(int jpegQuality)
Set the quality of embedded JPEG images.
|
Pdfcrowd.HtmlToPdfClient |
setKeywords(java.lang.String keywords)
Associate keywords with the document.
|
Pdfcrowd.HtmlToPdfClient |
setLinearize(boolean linearize)
Create linearized PDF.
|
Pdfcrowd.HtmlToPdfClient |
setMarginBottom(java.lang.String marginBottom)
Set the output page bottom margin.
|
Pdfcrowd.HtmlToPdfClient |
setMarginLeft(java.lang.String marginLeft)
Set the output page left margin.
|
Pdfcrowd.HtmlToPdfClient |
setMarginRight(java.lang.String marginRight)
Set the output page right margin.
|
Pdfcrowd.HtmlToPdfClient |
setMarginTop(java.lang.String marginTop)
Set the output page top margin.
|
Pdfcrowd.HtmlToPdfClient |
setMultipageBackground(java.lang.String multipageBackground)
Apply each page of the specified PDF to the background of the corresponding page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setMultipageWatermark(java.lang.String multipageWatermark)
Apply each page of the specified watermark PDF to the corresponding page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoBackground(boolean noBackground)
Do not print the background graphics.
|
Pdfcrowd.HtmlToPdfClient |
setNoCopy(boolean noCopy)
Disallow text and graphics extraction from the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoMargins(boolean noMargins)
Disable margins.
|
Pdfcrowd.HtmlToPdfClient |
setNoModify(boolean noModify)
Disallow modification of the ouput PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoPrint(boolean noPrint)
Disallow printing of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoXpdfcrowdHeader(boolean noXpdfcrowdHeader)
Do not send the X-Pdfcrowd HTTP header in Pdfcrowd HTTP requests.
|
Pdfcrowd.HtmlToPdfClient |
setOnLoadJavascript(java.lang.String onLoadJavascript)
Run a custom JavaScript right after the document is loaded.
|
Pdfcrowd.HtmlToPdfClient |
setOrientation(java.lang.String orientation)
Set the output page orientation.
|
Pdfcrowd.HtmlToPdfClient |
setOwnerPassword(java.lang.String ownerPassword)
Protect the PDF with an owner password.
|
Pdfcrowd.HtmlToPdfClient |
setPageBackground(java.lang.String pageBackground)
Apply the first page of the specified PDF to the background of every page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setPageBackgroundColor(java.lang.String pageBackgroundColor)
The page background color in RGB or RGBA hexadecimal format.
|
Pdfcrowd.HtmlToPdfClient |
setPageDimensions(java.lang.String width,
java.lang.String height)
Set the output page dimensions.
|
Pdfcrowd.HtmlToPdfClient |
setPageHeight(java.lang.String pageHeight)
Set the output page height.
|
Pdfcrowd.HtmlToPdfClient |
setPageLayout(java.lang.String pageLayout)
Specify the page layout to be used when the document is opened.
|
Pdfcrowd.HtmlToPdfClient |
setPageMargins(java.lang.String top,
java.lang.String right,
java.lang.String bottom,
java.lang.String left)
Set the output page margins.
|
Pdfcrowd.HtmlToPdfClient |
setPageMode(java.lang.String pageMode)
Specify how the document should be displayed when opened.
|
Pdfcrowd.HtmlToPdfClient |
setPageNumberingOffset(int offset)
Set an offset between physical and logical page numbers.
|
Pdfcrowd.HtmlToPdfClient |
setPageSize(java.lang.String pageSize)
Set the output page size.
|
Pdfcrowd.HtmlToPdfClient |
setPageWatermark(java.lang.String pageWatermark)
Apply the first page of the watermark PDF to every page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setPageWidth(java.lang.String pageWidth)
Set the output page width.
|
Pdfcrowd.HtmlToPdfClient |
setPrintPageRange(java.lang.String pages)
Set the page range to print.
|
Pdfcrowd.HtmlToPdfClient |
setProxy(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password)
Specifies an HTTP proxy that the API client library will use to connect to the internet.
|
Pdfcrowd.HtmlToPdfClient |
setRenderingMode(java.lang.String renderingMode)
Set the rendering mode.
|
Pdfcrowd.HtmlToPdfClient |
setRetryCount(int retryCount)
Specifies the number of retries when the 502 HTTP status code is received.
|
Pdfcrowd.HtmlToPdfClient |
setRightToLeft(boolean rightToLeft)
Set the predominant reading order for text to right-to-left.
|
Pdfcrowd.HtmlToPdfClient |
setScaleFactor(int scaleFactor)
Set the scaling factor (zoom) for the main page area.
|
Pdfcrowd.HtmlToPdfClient |
setSubject(java.lang.String subject)
Set the subject of the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setTag(java.lang.String tag)
Tag the conversion with a custom value.
|
Pdfcrowd.HtmlToPdfClient |
setTitle(java.lang.String title)
Set the title of the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setUseHttp(boolean useHttp)
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
|
Pdfcrowd.HtmlToPdfClient |
setUsePrintMedia(boolean usePrintMedia)
Use the print version of the page if available (@media print).
|
Pdfcrowd.HtmlToPdfClient |
setUserAgent(java.lang.String userAgent)
Set a custom user agent HTTP header.
|
Pdfcrowd.HtmlToPdfClient |
setUserPassword(java.lang.String userPassword)
Protect the PDF with a user password.
|
Pdfcrowd.HtmlToPdfClient |
setVerifySslCertificates(boolean verifySslCertificates)
Do not allow insecure HTTPS connections.
|
Pdfcrowd.HtmlToPdfClient |
setViewport(int width,
int height)
Set the viewport size.
|
Pdfcrowd.HtmlToPdfClient |
setViewportHeight(int viewportHeight)
Set the viewport height in pixels.
|
Pdfcrowd.HtmlToPdfClient |
setViewportWidth(int viewportWidth)
Set the viewport width in pixels.
|
Pdfcrowd.HtmlToPdfClient |
setWaitForElement(java.lang.String selectors)
Wait for the specified element in a source document.
|
public HtmlToPdfClient(java.lang.String userName, java.lang.String apiKey)
userName
- Your username at Pdfcrowd.apiKey
- Your API key.public byte[] convertUrl(java.lang.String url)
url
- The address of the web page to convert. The supported protocols are http:// and https://.public void convertUrlToStream(java.lang.String url, java.io.OutputStream outStream)
url
- The address of the web page to convert. The supported protocols are http:// and https://.outStream
- The output stream that will contain the conversion output.public void convertUrlToFile(java.lang.String url, java.lang.String filePath) throws java.io.IOException
url
- The address of the web page to convert. The supported protocols are http:// and https://.filePath
- The output file path. The string must not be empty.java.io.IOException
public byte[] convertFile(java.lang.String file)
file
- The path to a local file to convert.public void convertFileToStream(java.lang.String file, java.io.OutputStream outStream)
file
- The path to a local file to convert.outStream
- The output stream that will contain the conversion output.public void convertFileToFile(java.lang.String file, java.lang.String filePath) throws java.io.IOException
file
- The path to a local file to convert.filePath
- The output file path. The string must not be empty.java.io.IOException
public byte[] convertString(java.lang.String text)
text
- The string content to convert. The string must not be empty.public void convertStringToStream(java.lang.String text, java.io.OutputStream outStream)
text
- The string content to convert. The string must not be empty.outStream
- The output stream that will contain the conversion output.public void convertStringToFile(java.lang.String text, java.lang.String filePath) throws java.io.IOException
text
- The string content to convert. The string must not be empty.filePath
- The output file path. The string must not be empty.java.io.IOException
public Pdfcrowd.HtmlToPdfClient setPageSize(java.lang.String pageSize)
pageSize
- Allowed values are A2, A3, A4, A5, A6, Letter.public Pdfcrowd.HtmlToPdfClient setPageWidth(java.lang.String pageWidth)
pageWidth
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setPageHeight(java.lang.String pageHeight)
pageHeight
- Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setPageDimensions(java.lang.String width, java.lang.String height)
width
- Set the output page width. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).height
- Set the output page height. Use -1 for a single page PDF. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF. Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setOrientation(java.lang.String orientation)
orientation
- Allowed values are landscape, portrait.public Pdfcrowd.HtmlToPdfClient setMarginTop(java.lang.String marginTop)
marginTop
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setMarginRight(java.lang.String marginRight)
marginRight
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setMarginBottom(java.lang.String marginBottom)
marginBottom
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setMarginLeft(java.lang.String marginLeft)
marginLeft
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setNoMargins(boolean noMargins)
noMargins
- Set to true to disable margins.public Pdfcrowd.HtmlToPdfClient setPageMargins(java.lang.String top, java.lang.String right, java.lang.String bottom, java.lang.String left)
top
- Set the output page top margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).right
- Set the output page right margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).bottom
- Set the output page bottom margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).left
- Set the output page left margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setHeaderUrl(java.lang.String headerUrl)
headerUrl
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setHeaderHtml(java.lang.String headerHtml)
headerHtml
- The string must not be empty.public Pdfcrowd.HtmlToPdfClient setHeaderHeight(java.lang.String headerHeight)
headerHeight
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setFooterUrl(java.lang.String footerUrl)
footerUrl
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setFooterHtml(java.lang.String footerHtml)
footerHtml
- The string must not be empty.public Pdfcrowd.HtmlToPdfClient setFooterHeight(java.lang.String footerHeight)
footerHeight
- Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).public Pdfcrowd.HtmlToPdfClient setPrintPageRange(java.lang.String pages)
pages
- A comma seperated list of page numbers or ranges.public Pdfcrowd.HtmlToPdfClient setPageBackgroundColor(java.lang.String pageBackgroundColor)
pageBackgroundColor
- The value must be in RRGGBB or RRGGBBAA hexadecimal format.public Pdfcrowd.HtmlToPdfClient setPageWatermark(java.lang.String pageWatermark)
pageWatermark
- The file path to a local watermark PDF file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setMultipageWatermark(java.lang.String multipageWatermark)
multipageWatermark
- The file path to a local watermark PDF file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setPageBackground(java.lang.String pageBackground)
pageBackground
- The file path to a local background PDF file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setMultipageBackground(java.lang.String multipageBackground)
multipageBackground
- The file path to a local background PDF file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setExcludeHeaderOnPages(java.lang.String pages)
pages
- List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma seperated list of page numbers.public Pdfcrowd.HtmlToPdfClient setExcludeFooterOnPages(java.lang.String pages)
pages
- List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma seperated list of page numbers.public Pdfcrowd.HtmlToPdfClient setPageNumberingOffset(int offset)
offset
- Integer specifying page offset.public Pdfcrowd.HtmlToPdfClient setNoBackground(boolean noBackground)
noBackground
- Set to true to disable the background graphics.public Pdfcrowd.HtmlToPdfClient setDisableJavascript(boolean disableJavascript)
disableJavascript
- Set to true to disable JavaScript in web pages.public Pdfcrowd.HtmlToPdfClient setDisableImageLoading(boolean disableImageLoading)
disableImageLoading
- Set to true to disable loading of images.public Pdfcrowd.HtmlToPdfClient setDisableRemoteFonts(boolean disableRemoteFonts)
disableRemoteFonts
- Set to true disable loading remote fonts.public Pdfcrowd.HtmlToPdfClient setBlockAds(boolean blockAds)
blockAds
- Set to true to block ads in web pages.public Pdfcrowd.HtmlToPdfClient setDefaultEncoding(java.lang.String defaultEncoding)
defaultEncoding
- The text encoding of the HTML content.public Pdfcrowd.HtmlToPdfClient setHttpAuthUserName(java.lang.String userName)
userName
- The user name.public Pdfcrowd.HtmlToPdfClient setHttpAuthPassword(java.lang.String password)
password
- The password.public Pdfcrowd.HtmlToPdfClient setHttpAuth(java.lang.String userName, java.lang.String password)
userName
- Set the HTTP authentication user name.password
- Set the HTTP authentication password.public Pdfcrowd.HtmlToPdfClient setUsePrintMedia(boolean usePrintMedia)
usePrintMedia
- Set to true to use the print version of the page.public Pdfcrowd.HtmlToPdfClient setNoXpdfcrowdHeader(boolean noXpdfcrowdHeader)
noXpdfcrowdHeader
- Set to true to disable sending X-Pdfcrowd HTTP header.public Pdfcrowd.HtmlToPdfClient setCookies(java.lang.String cookies)
cookies
- The cookie string.public Pdfcrowd.HtmlToPdfClient setVerifySslCertificates(boolean verifySslCertificates)
verifySslCertificates
- Set to true to enable SSL certificate verification.public Pdfcrowd.HtmlToPdfClient setFailOnMainUrlError(boolean failOnError)
failOnError
- Set to true to abort the conversion.public Pdfcrowd.HtmlToPdfClient setFailOnAnyUrlError(boolean failOnError)
failOnError
- Set to true to abort the conversion.public Pdfcrowd.HtmlToPdfClient setCustomJavascript(java.lang.String customJavascript)
customJavascript
- A string containing a JavaScript code. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setOnLoadJavascript(java.lang.String onLoadJavascript)
onLoadJavascript
- A string containing a JavaScript code. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setCustomHttpHeader(java.lang.String customHttpHeader)
customHttpHeader
- A string containing the header name and value separated by a colon.public Pdfcrowd.HtmlToPdfClient setJavascriptDelay(int javascriptDelay)
javascriptDelay
- The number of milliseconds to wait. Must be a positive integer number or 0.public Pdfcrowd.HtmlToPdfClient setElementToConvert(java.lang.String selectors)
selectors
- One or more CSS selectors separated by commas. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setElementToConvertMode(java.lang.String mode)
mode
- Allowed values are cut-out, remove-siblings, hide-siblings.public Pdfcrowd.HtmlToPdfClient setWaitForElement(java.lang.String selectors)
selectors
- One or more CSS selectors separated by commas. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setViewportWidth(int viewportWidth)
viewportWidth
- The value must be in the range 96-7680.public Pdfcrowd.HtmlToPdfClient setViewportHeight(int viewportHeight)
viewportHeight
- Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setViewport(int width, int height)
width
- Set the viewport width in pixels. The viewport is the user's visible area of the page. The value must be in the range 96-7680.height
- Set the viewport height in pixels. The viewport is the user's visible area of the page. Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setRenderingMode(java.lang.String renderingMode)
renderingMode
- The rendering mode. Allowed values are default, viewport.public Pdfcrowd.HtmlToPdfClient setScaleFactor(int scaleFactor)
scaleFactor
- The percentage value. The value must be in the range 10-500.public Pdfcrowd.HtmlToPdfClient setHeaderFooterScaleFactor(int headerFooterScaleFactor)
headerFooterScaleFactor
- The percentage value. The value must be in the range 10-500.public Pdfcrowd.HtmlToPdfClient setDisableSmartShrinking(boolean disableSmartShrinking)
disableSmartShrinking
- Set to true to disable the intelligent shrinking strategy.public Pdfcrowd.HtmlToPdfClient setJpegQuality(int jpegQuality)
jpegQuality
- The percentage value. The value must be in the range 1-100.public Pdfcrowd.HtmlToPdfClient setConvertImagesToJpeg(java.lang.String convertImagesToJpeg)
convertImagesToJpeg
- The image category. Allowed values are none, opaque, all.public Pdfcrowd.HtmlToPdfClient setImageDpi(int imageDpi)
imageDpi
- The DPI value. Must be a positive integer number or 0.public Pdfcrowd.HtmlToPdfClient setLinearize(boolean linearize)
linearize
- Set to true to create linearized PDF.public Pdfcrowd.HtmlToPdfClient setEncrypt(boolean encrypt)
encrypt
- Set to true to enable PDF encryption.public Pdfcrowd.HtmlToPdfClient setUserPassword(java.lang.String userPassword)
userPassword
- The user password.public Pdfcrowd.HtmlToPdfClient setOwnerPassword(java.lang.String ownerPassword)
ownerPassword
- The owner password.public Pdfcrowd.HtmlToPdfClient setNoPrint(boolean noPrint)
noPrint
- Set to true to set the no-print flag in the output PDF.public Pdfcrowd.HtmlToPdfClient setNoModify(boolean noModify)
noModify
- Set to true to set the read-only only flag in the output PDF.public Pdfcrowd.HtmlToPdfClient setNoCopy(boolean noCopy)
noCopy
- Set to true to set the no-copy flag in the output PDF.public Pdfcrowd.HtmlToPdfClient setTitle(java.lang.String title)
title
- The title.public Pdfcrowd.HtmlToPdfClient setSubject(java.lang.String subject)
subject
- The subject.public Pdfcrowd.HtmlToPdfClient setAuthor(java.lang.String author)
author
- The author.public Pdfcrowd.HtmlToPdfClient setKeywords(java.lang.String keywords)
keywords
- The string with the keywords.public Pdfcrowd.HtmlToPdfClient setPageLayout(java.lang.String pageLayout)
pageLayout
- Allowed values are single-page, one-column, two-column-left, two-column-right.public Pdfcrowd.HtmlToPdfClient setPageMode(java.lang.String pageMode)
pageMode
- Allowed values are full-screen, thumbnails, outlines.public Pdfcrowd.HtmlToPdfClient setInitialZoomType(java.lang.String initialZoomType)
initialZoomType
- Allowed values are fit-width, fit-height, fit-page.public Pdfcrowd.HtmlToPdfClient setInitialPage(int initialPage)
initialPage
- Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setInitialZoom(int initialZoom)
initialZoom
- Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setHideToolbar(boolean hideToolbar)
hideToolbar
- Set to true to hide tool bars.public Pdfcrowd.HtmlToPdfClient setHideMenubar(boolean hideMenubar)
hideMenubar
- Set to true to hide the menu bar.public Pdfcrowd.HtmlToPdfClient setHideWindowUi(boolean hideWindowUi)
hideWindowUi
- Set to true to hide ui elements.public Pdfcrowd.HtmlToPdfClient setFitWindow(boolean fitWindow)
fitWindow
- Set to true to resize the window.public Pdfcrowd.HtmlToPdfClient setCenterWindow(boolean centerWindow)
centerWindow
- Set to true to center the window.public Pdfcrowd.HtmlToPdfClient setDisplayTitle(boolean displayTitle)
displayTitle
- Set to true to display the title.public Pdfcrowd.HtmlToPdfClient setRightToLeft(boolean rightToLeft)
rightToLeft
- Set to true to set right-to-left reading order.public Pdfcrowd.HtmlToPdfClient setDebugLog(boolean debugLog)
debugLog
- Set to true to enable the debug logging.public java.lang.String getDebugLogUrl()
public int getRemainingCreditCount()
public int getConsumedCreditCount()
public java.lang.String getJobId()
public int getPageCount()
public int getOutputSize()
public Pdfcrowd.HtmlToPdfClient setTag(java.lang.String tag)
tag
- A string with the custom tag.public Pdfcrowd.HtmlToPdfClient setHttpProxy(java.lang.String httpProxy)
httpProxy
- The value must have format DOMAIN_OR_IP_ADDRESS:PORT.public Pdfcrowd.HtmlToPdfClient setHttpsProxy(java.lang.String httpsProxy)
httpsProxy
- The value must have format DOMAIN_OR_IP_ADDRESS:PORT.public Pdfcrowd.HtmlToPdfClient setClientCertificate(java.lang.String clientCertificate)
clientCertificate
- The file must be in PKCS12 format. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setClientCertificatePassword(java.lang.String clientCertificatePassword)
clientCertificatePassword
- public Pdfcrowd.HtmlToPdfClient setUseHttp(boolean useHttp)
useHttp
- Set to true to use HTTP.public Pdfcrowd.HtmlToPdfClient setUserAgent(java.lang.String userAgent)
userAgent
- The user agent string.public Pdfcrowd.HtmlToPdfClient setProxy(java.lang.String host, int port, java.lang.String userName, java.lang.String password)
host
- The proxy hostname.port
- The proxy port.userName
- The username.password
- The password.public Pdfcrowd.HtmlToPdfClient setRetryCount(int retryCount)
retryCount
- Number of retries wanted.Copyright © 2019. All rights reserved.