Constructor and Description |
---|
HtmlToPdfClient(String userName,
String apiKey)
Constructor for the Pdfcrowd API client.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
convertFile(String file)
Convert a local file.
|
void |
convertFileToFile(String file,
String filePath)
Convert a local file and write the result to a local file.
|
void |
convertFileToStream(String file,
OutputStream outStream)
Convert a local file and write the result to an output stream.
|
byte[] |
convertStream(InputStream inStream)
Convert the contents of an input stream.
|
void |
convertStreamToFile(InputStream inStream,
String filePath)
Convert the contents of an input stream and write the result to a local file.
|
void |
convertStreamToStream(InputStream inStream,
OutputStream outStream)
Convert the contents of an input stream and write the result to an output stream.
|
byte[] |
convertString(String text)
Convert a string.
|
void |
convertStringToFile(String text,
String filePath)
Convert a string and write the output to a file.
|
void |
convertStringToStream(String text,
OutputStream outStream)
Convert a string and write the output to an output stream.
|
byte[] |
convertUrl(String url)
Convert a web page.
|
void |
convertUrlToFile(String url,
String filePath)
Convert a web page and write the result to a local file.
|
void |
convertUrlToStream(String url,
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.
|
String |
getDebugLogUrl()
Get the URL of the debug log for the last conversion.
|
String |
getJobId()
Get the job id.
|
int |
getOutputSize()
Get the size of the output in bytes.
|
int |
getPageCount()
Get the number of pages in the output document.
|
int |
getRemainingCreditCount()
Get the number of conversion credits available in your account.
|
int |
getTotalPageCount()
Get the total number of pages in the original output document, including the pages excluded by setPrintPageRange().
|
String |
getVersion()
Get the version details.
|
Pdfcrowd.HtmlToPdfClient |
setAuthor(String author)
Set the author of the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setAutoDetectElementToConvert(boolean value)
The main HTML element for conversion is detected automatically.
|
Pdfcrowd.HtmlToPdfClient |
setBlockAds(boolean value)
Try to block ads.
|
Pdfcrowd.HtmlToPdfClient |
setCenterWindow(boolean value)
Specify whether to position the document's window in the center of the screen.
|
Pdfcrowd.HtmlToPdfClient |
setClientCertificate(String certificate)
A client certificate to authenticate Pdfcrowd converter on your web server.
|
Pdfcrowd.HtmlToPdfClient |
setClientCertificatePassword(String password)
A password for PKCS12 file with a client certificate if it is needed.
|
Pdfcrowd.HtmlToPdfClient |
setContentArea(String x,
String y,
String width,
String height)
Set the content area position and size.
|
Pdfcrowd.HtmlToPdfClient |
setContentAreaHeight(String height)
Set the height of the content area.
|
Pdfcrowd.HtmlToPdfClient |
setContentAreaWidth(String width)
Set the width of the content area.
|
Pdfcrowd.HtmlToPdfClient |
setContentAreaX(String x)
Set the top left X coordinate of the content area.
|
Pdfcrowd.HtmlToPdfClient |
setContentAreaY(String y)
Set the top left Y coordinate of the content area.
|
Pdfcrowd.HtmlToPdfClient |
setContentsMatrix(String matrix)
A 2D transformation matrix applied to the main contents on each page.
|
Pdfcrowd.HtmlToPdfClient |
setConverterVersion(String version)
Set the converter version.
|
Pdfcrowd.HtmlToPdfClient |
setConvertImagesToJpeg(String images)
Specify which image types will be converted to JPEG.
|
Pdfcrowd.HtmlToPdfClient |
setCookies(String cookies)
Set cookies that are sent in Pdfcrowd HTTP requests.
|
Pdfcrowd.HtmlToPdfClient |
setCssPageRuleMode(String mode)
Specifies behavior in presence of CSS @page rules.
|
Pdfcrowd.HtmlToPdfClient |
setCustomHttpHeader(String header)
Set a custom HTTP header that is sent in Pdfcrowd HTTP requests.
|
Pdfcrowd.HtmlToPdfClient |
setCustomJavascript(String javascript)
Run a custom JavaScript after the document is loaded and ready to print.
|
Pdfcrowd.HtmlToPdfClient |
setDataAutoEscape(boolean value)
Auto escape HTML symbols in the input data before placing them into the output.
|
Pdfcrowd.HtmlToPdfClient |
setDataEncoding(String encoding)
Set the encoding of the data file set by setDataFile.
|
Pdfcrowd.HtmlToPdfClient |
setDataFile(String dataFile)
Load the input data for template rendering from the specified file.
|
Pdfcrowd.HtmlToPdfClient |
setDataFormat(String dataFormat)
Specify the input data format.
|
Pdfcrowd.HtmlToPdfClient |
setDataIgnoreUndefined(boolean value)
Ignore undefined variables in the HTML template.
|
Pdfcrowd.HtmlToPdfClient |
setDataOptions(String options)
Set the advanced data options:csv_delimiter - The CSV data delimiter, the default is ,.xml_remove_root - Remove the root XML element from the input data.data_root - The name of the root element inserted into the input data without a root node (e.g.
|
Pdfcrowd.HtmlToPdfClient |
setDataString(String dataString)
Set the input data for template rendering.
|
Pdfcrowd.HtmlToPdfClient |
setDataTrimBlocks(boolean value)
Auto trim whitespace around each template command block.
|
Pdfcrowd.HtmlToPdfClient |
setDebugLog(boolean value)
Turn on the debug logging.
|
Pdfcrowd.HtmlToPdfClient |
setDefaultEncoding(String encoding)
Set the default HTML content text encoding.
|
Pdfcrowd.HtmlToPdfClient |
setDisableImageLoading(boolean value)
Do not load images.
|
Pdfcrowd.HtmlToPdfClient |
setDisableJavascript(boolean value)
Do not execute JavaScript.
|
Pdfcrowd.HtmlToPdfClient |
setDisablePageHeightOptimization(boolean value)
Disable automatic height adjustment that compensates for pixel to point rounding errors.
|
Pdfcrowd.HtmlToPdfClient |
setDisableRemoteFonts(boolean value)
Disable loading fonts from remote sources.
|
Pdfcrowd.HtmlToPdfClient |
setDisplayTitle(boolean value)
Specify whether the window's title bar should display the document title.
|
Pdfcrowd.HtmlToPdfClient |
setElementToConvert(String selectors)
Convert only the specified element from the main document and its children.
|
Pdfcrowd.HtmlToPdfClient |
setElementToConvertMode(String mode)
Specify the DOM handling when only a part of the document is converted.
|
Pdfcrowd.HtmlToPdfClient |
setEnablePdfForms(boolean value)
Convert HTML forms to fillable PDF forms.
|
Pdfcrowd.HtmlToPdfClient |
setEncrypt(boolean value)
Encrypt the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setExcludeFooterOnPages(String pages)
The page footer is not printed on the specified pages.
|
Pdfcrowd.HtmlToPdfClient |
setExcludeHeaderOnPages(String pages)
The page header is not printed on the specified pages.
|
Pdfcrowd.HtmlToPdfClient |
setExtractMetaTags(boolean value)
Extract meta tags (author, keywords and description) from the input HTML and use them in the output PDF.
|
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 value)
Specify whether to resize the document's window to fit the size of the first displayed page.
|
Pdfcrowd.HtmlToPdfClient |
setFooterHeight(String height)
Set the footer height.
|
Pdfcrowd.HtmlToPdfClient |
setFooterHtml(String html)
Use the specified HTML as the page footer.
|
Pdfcrowd.HtmlToPdfClient |
setFooterMatrix(String matrix)
A 2D transformation matrix applied to the page footer contents.
|
Pdfcrowd.HtmlToPdfClient |
setFooterUrl(String url)
Load an HTML code from the specified URL and use it as the page footer.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderFooterCssAnnotation(boolean value)
Add special CSS classes to the header/footer's body element.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderFooterScaleFactor(int factor)
Set the scaling factor (zoom) for the header and footer.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderHeight(String height)
Set the header height.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderHtml(String html)
Use the specified HTML code as the page header.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderMatrix(String matrix)
A 2D transformation matrix applied to the page header contents.
|
Pdfcrowd.HtmlToPdfClient |
setHeaderUrl(String url)
Load an HTML code from the specified URL and use it as the page header.
|
Pdfcrowd.HtmlToPdfClient |
setHideMenubar(boolean value)
Specify whether to hide the viewer application's menu bar when the document is active.
|
Pdfcrowd.HtmlToPdfClient |
setHideToolbar(boolean value)
Specify whether to hide the viewer application's tool bars when the document is active.
|
Pdfcrowd.HtmlToPdfClient |
setHideWindowUi(boolean value)
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(String userName,
String password)
Set credentials to access HTTP base authentication protected websites.
|
Pdfcrowd.HtmlToPdfClient |
setHttpAuthPassword(String password)
Set the HTTP authentication password.
|
Pdfcrowd.HtmlToPdfClient |
setHttpAuthUserName(String userName)
Set the HTTP authentication user name.
|
Pdfcrowd.HtmlToPdfClient |
setHttpProxy(String proxy)
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTP scheme.
|
Pdfcrowd.HtmlToPdfClient |
setHttpsProxy(String proxy)
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTPS scheme.
|
Pdfcrowd.HtmlToPdfClient |
setImageDpi(int dpi)
Set the DPI of images in PDF.
|
Pdfcrowd.HtmlToPdfClient |
setInitialPage(int page)
Display the specified page when the document is opened.
|
Pdfcrowd.HtmlToPdfClient |
setInitialZoom(int zoom)
Specify the initial page zoom in percents when the document is opened.
|
Pdfcrowd.HtmlToPdfClient |
setInitialZoomType(String zoomType)
Specify how the page should be displayed when opened.
|
Pdfcrowd.HtmlToPdfClient |
setJavascriptDelay(int delay)
Wait the specified number of milliseconds to finish all JavaScript after the document is loaded.
|
Pdfcrowd.HtmlToPdfClient |
setJpegQuality(int quality)
Set the quality of embedded JPEG images.
|
Pdfcrowd.HtmlToPdfClient |
setKeywords(String keywords)
Associate keywords with the document.
|
Pdfcrowd.HtmlToPdfClient |
setLayoutDpi(int dpi)
Set the internal DPI resolution used for positioning of PDF contents.
|
Pdfcrowd.HtmlToPdfClient |
setLinearize(boolean value)
Create linearized PDF.
|
Pdfcrowd.HtmlToPdfClient |
setLoadIframes(String iframes)
Specifies how iframes are handled.
|
Pdfcrowd.HtmlToPdfClient |
setLocale(String locale)
Set the locale for the conversion.
|
Pdfcrowd.HtmlToPdfClient |
setMainDocumentCssAnnotation(boolean value)
Add special CSS classes to the main document's body element.
|
Pdfcrowd.HtmlToPdfClient |
setMarginBottom(String bottom)
Set the output page bottom margin.
|
Pdfcrowd.HtmlToPdfClient |
setMarginLeft(String left)
Set the output page left margin.
|
Pdfcrowd.HtmlToPdfClient |
setMarginRight(String right)
Set the output page right margin.
|
Pdfcrowd.HtmlToPdfClient |
setMarginTop(String top)
Set the output page top margin.
|
Pdfcrowd.HtmlToPdfClient |
setMultipageBackground(String background)
Apply each page of a background to the corresponding page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setMultipageBackgroundUrl(String url)
Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setMultipageWatermark(String watermark)
Apply each page of a watermark to the corresponding page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setMultipageWatermarkUrl(String url)
Load a file from the specified URL and apply each page of the file as a watermark to the corresponding page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoBackground(boolean value)
Do not print the background graphics.
|
Pdfcrowd.HtmlToPdfClient |
setNoCopy(boolean value)
Disallow text and graphics extraction from the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoHeaderFooterHorizontalMargins(boolean value)
Disable horizontal page margins for header and footer.
|
Pdfcrowd.HtmlToPdfClient |
setNoMargins(boolean value)
Disable page margins.
|
Pdfcrowd.HtmlToPdfClient |
setNoModify(boolean value)
Disallow modification of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoPrint(boolean value)
Disallow printing of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setNoXpdfcrowdHeader(boolean value)
Do not send the X-Pdfcrowd HTTP header in Pdfcrowd HTTP requests.
|
Pdfcrowd.HtmlToPdfClient |
setOnLoadJavascript(String javascript)
Run a custom JavaScript right after the document is loaded.
|
Pdfcrowd.HtmlToPdfClient |
setOrientation(String orientation)
Set the output page orientation.
|
Pdfcrowd.HtmlToPdfClient |
setOwnerPassword(String password)
Protect the PDF with an owner password.
|
Pdfcrowd.HtmlToPdfClient |
setPageBackground(String background)
Apply a background to each page of the output PDF file.
|
Pdfcrowd.HtmlToPdfClient |
setPageBackgroundColor(String color)
The page background color in RGB or RGBA hexadecimal format.
|
Pdfcrowd.HtmlToPdfClient |
setPageBackgroundUrl(String url)
Load a file from the specified URL and apply the file as a background to each page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setPageDimensions(String width,
String height)
Set the output page dimensions.
|
Pdfcrowd.HtmlToPdfClient |
setPageHeight(String height)
Set the output page height.
|
Pdfcrowd.HtmlToPdfClient |
setPageLayout(String layout)
Specify the page layout to be used when the document is opened.
|
Pdfcrowd.HtmlToPdfClient |
setPageMargins(String top,
String right,
String bottom,
String left)
Set the output page margins.
|
Pdfcrowd.HtmlToPdfClient |
setPageMode(String mode)
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(String size)
Set the output page size.
|
Pdfcrowd.HtmlToPdfClient |
setPageWatermark(String watermark)
Apply a watermark to each page of the output PDF file.
|
Pdfcrowd.HtmlToPdfClient |
setPageWatermarkUrl(String url)
Load a file from the specified URL and apply the file as a watermark to each page of the output PDF.
|
Pdfcrowd.HtmlToPdfClient |
setPageWidth(String width)
Set the output page width.
|
Pdfcrowd.HtmlToPdfClient |
setPrintPageRange(String pages)
Set the page range to print.
|
Pdfcrowd.HtmlToPdfClient |
setProxy(String host,
int port,
String userName,
String password)
Specifies an HTTP proxy that the API client library will use to connect to the internet.
|
Pdfcrowd.HtmlToPdfClient |
setReadabilityEnhancements(String enhancements)
The input HTML is automatically enhanced to improve the readability.
|
Pdfcrowd.HtmlToPdfClient |
setRenderingMode(String mode)
Set the rendering mode.
|
Pdfcrowd.HtmlToPdfClient |
setRetryCount(int count)
Specifies the number of automatic retries when the 502 HTTP status code is received.
|
Pdfcrowd.HtmlToPdfClient |
setRightToLeft(boolean value)
Set the predominant reading order for text to right-to-left.
|
Pdfcrowd.HtmlToPdfClient |
setScaleFactor(int factor)
Set the scaling factor (zoom) for the main page area.
|
Pdfcrowd.HtmlToPdfClient |
setSmartScalingMode(String mode)
Specifies the scaling mode used for fitting the HTML contents to the print area.
|
Pdfcrowd.HtmlToPdfClient |
setSubject(String subject)
Set the subject of the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setTag(String tag)
Tag the conversion with a custom value.
|
Pdfcrowd.HtmlToPdfClient |
setTitle(String title)
Set the title of the PDF.
|
Pdfcrowd.HtmlToPdfClient |
setUseHttp(boolean value)
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
|
Pdfcrowd.HtmlToPdfClient |
setUseMobileUserAgent(boolean value)
Use a mobile user agent.
|
Pdfcrowd.HtmlToPdfClient |
setUsePrintMedia(boolean value)
Use the print version of the page if available (@media print).
|
Pdfcrowd.HtmlToPdfClient |
setUserAgent(String agent)
Set a custom user agent HTTP header.
|
Pdfcrowd.HtmlToPdfClient |
setUserPassword(String password)
Protect the PDF with a user password.
|
Pdfcrowd.HtmlToPdfClient |
setVerifySslCertificates(boolean value)
Do not allow insecure HTTPS connections.
|
Pdfcrowd.HtmlToPdfClient |
setViewport(int width,
int height)
Set the viewport size.
|
Pdfcrowd.HtmlToPdfClient |
setViewportHeight(int height)
Set the viewport height in pixels.
|
Pdfcrowd.HtmlToPdfClient |
setViewportWidth(int width)
Set the viewport width in pixels.
|
Pdfcrowd.HtmlToPdfClient |
setWaitForElement(String selectors)
Wait for the specified element in a source document.
|
Pdfcrowd.HtmlToPdfClient |
setZipFooterFilename(String filename)
Set the file name of the footer HTML document stored in the input archive.
|
Pdfcrowd.HtmlToPdfClient |
setZipHeaderFilename(String filename)
Set the file name of the header HTML document stored in the input archive.
|
Pdfcrowd.HtmlToPdfClient |
setZipMainFilename(String filename)
Set the file name of the main HTML document stored in the input archive.
|
public byte[] convertUrl(String url)
url
- The address of the web page to convert. The supported protocols are http:// and https://.public void convertUrlToStream(String url, 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(String url, String filePath) throws 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.IOException
public byte[] convertFile(String file)
file
- The path to a local file to convert.public void convertFileToStream(String file, OutputStream outStream)
file
- The path to a local file to convert.outStream
- The output stream that will contain the conversion output.public void convertFileToFile(String file, String filePath) throws IOException
file
- The path to a local file to convert.filePath
- The output file path. The string must not be empty.IOException
public byte[] convertString(String text)
text
- The string content to convert. The string must not be empty.public void convertStringToStream(String text, 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(String text, String filePath) throws IOException
text
- The string content to convert. The string must not be empty.filePath
- The output file path. The string must not be empty.IOException
public byte[] convertStream(InputStream inStream) throws IOException
inStream
- The input stream with source data.IOException
public void convertStreamToStream(InputStream inStream, OutputStream outStream) throws IOException
inStream
- The input stream with source data.outStream
- The output stream that will contain the conversion output.IOException
public void convertStreamToFile(InputStream inStream, String filePath) throws IOException
inStream
- The input stream with source data.filePath
- The output file path. The string must not be empty.IOException
public Pdfcrowd.HtmlToPdfClient setZipMainFilename(String filename)
filename
- The file name.public Pdfcrowd.HtmlToPdfClient setPageSize(String size)
size
- Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.public Pdfcrowd.HtmlToPdfClient setPageWidth(String width)
width
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setPageHeight(String height)
height
- The value must be -1 or specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setPageDimensions(String width, String height)
width
- Set the output page width. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF. The value must 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. The value must be -1 or specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setOrientation(String orientation)
orientation
- Allowed values are landscape, portrait.public Pdfcrowd.HtmlToPdfClient setMarginTop(String top)
top
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setMarginRight(String right)
right
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setMarginBottom(String bottom)
bottom
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setMarginLeft(String left)
left
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setNoMargins(boolean value)
value
- Set to true to disable margins.public Pdfcrowd.HtmlToPdfClient setPageMargins(String top, String right, String bottom, String left)
top
- Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".right
- Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".bottom
- Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".left
- Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setPrintPageRange(String pages)
pages
- A comma separated list of page numbers or ranges.public Pdfcrowd.HtmlToPdfClient setPageNumberingOffset(int offset)
offset
- Integer specifying page offset.public Pdfcrowd.HtmlToPdfClient setContentAreaX(String x)
x
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.public Pdfcrowd.HtmlToPdfClient setContentAreaY(String y)
y
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.public Pdfcrowd.HtmlToPdfClient setContentAreaWidth(String width)
width
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setContentAreaHeight(String height)
height
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setContentArea(String x, String y, String width, String height)
x
- Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.y
- Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.width
- Set the width of the content area. It should be at least 1 inch. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".height
- Set the height of the content area. It should be at least 1 inch. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setCssPageRuleMode(String mode)
mode
- The page rule mode. Allowed values are default, mode1, mode2.public Pdfcrowd.HtmlToPdfClient setHeaderUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setHeaderHtml(String html)
html
- The string must not be empty.public Pdfcrowd.HtmlToPdfClient setHeaderHeight(String height)
height
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setZipHeaderFilename(String filename)
filename
- The file name.public Pdfcrowd.HtmlToPdfClient setFooterUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setFooterHtml(String html)
html
- The string must not be empty.public Pdfcrowd.HtmlToPdfClient setFooterHeight(String height)
height
- The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".public Pdfcrowd.HtmlToPdfClient setZipFooterFilename(String filename)
filename
- The file name.public Pdfcrowd.HtmlToPdfClient setNoHeaderFooterHorizontalMargins(boolean value)
value
- Set to true to disable horizontal margins for header and footer.public Pdfcrowd.HtmlToPdfClient setExcludeHeaderOnPages(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 separated list of page numbers.public Pdfcrowd.HtmlToPdfClient setExcludeFooterOnPages(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 separated list of page numbers.public Pdfcrowd.HtmlToPdfClient setHeaderFooterScaleFactor(int factor)
factor
- The percentage value. The value must be in the range 10-500.public Pdfcrowd.HtmlToPdfClient setPageWatermark(String watermark)
watermark
- The file path to a local file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setPageWatermarkUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setMultipageWatermark(String watermark)
watermark
- The file path to a local file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setMultipageWatermarkUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setPageBackground(String background)
background
- The file path to a local file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setPageBackgroundUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setMultipageBackground(String background)
background
- The file path to a local file. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setMultipageBackgroundUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.HtmlToPdfClient setPageBackgroundColor(String color)
color
- The value must be in RRGGBB or RRGGBBAA hexadecimal format.public Pdfcrowd.HtmlToPdfClient setUsePrintMedia(boolean value)
value
- Set to true to use the print version of the page.public Pdfcrowd.HtmlToPdfClient setNoBackground(boolean value)
value
- Set to true to disable the background graphics.public Pdfcrowd.HtmlToPdfClient setDisableJavascript(boolean value)
value
- Set to true to disable JavaScript in web pages.public Pdfcrowd.HtmlToPdfClient setDisableImageLoading(boolean value)
value
- Set to true to disable loading of images.public Pdfcrowd.HtmlToPdfClient setDisableRemoteFonts(boolean value)
value
- Set to true disable loading remote fonts.public Pdfcrowd.HtmlToPdfClient setUseMobileUserAgent(boolean value)
value
- Set to true to use a mobile user agent.public Pdfcrowd.HtmlToPdfClient setLoadIframes(String iframes)
iframes
- Allowed values are all, same-origin, none.public Pdfcrowd.HtmlToPdfClient setBlockAds(boolean value)
value
- Set to true to block ads in web pages.public Pdfcrowd.HtmlToPdfClient setDefaultEncoding(String encoding)
encoding
- The text encoding of the HTML content.public Pdfcrowd.HtmlToPdfClient setLocale(String locale)
locale
- The locale code according to ISO 639.public Pdfcrowd.HtmlToPdfClient setHttpAuthUserName(String userName)
userName
- The user name.public Pdfcrowd.HtmlToPdfClient setHttpAuthPassword(String password)
password
- The password.public Pdfcrowd.HtmlToPdfClient setHttpAuth(String userName, String password)
userName
- Set the HTTP authentication user name.password
- Set the HTTP authentication password.public Pdfcrowd.HtmlToPdfClient setCookies(String cookies)
cookies
- The cookie string.public Pdfcrowd.HtmlToPdfClient setVerifySslCertificates(boolean value)
value
- 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 setNoXpdfcrowdHeader(boolean value)
value
- Set to true to disable sending X-Pdfcrowd HTTP header.public Pdfcrowd.HtmlToPdfClient setCustomJavascript(String javascript)
javascript
- A string containing a JavaScript code. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setOnLoadJavascript(String javascript)
javascript
- A string containing a JavaScript code. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setCustomHttpHeader(String header)
header
- A string containing the header name and value separated by a colon.public Pdfcrowd.HtmlToPdfClient setJavascriptDelay(int delay)
delay
- The number of milliseconds to wait. Must be a positive integer number or 0.public Pdfcrowd.HtmlToPdfClient setElementToConvert(String selectors)
selectors
- One or more CSS selectors separated by commas. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setElementToConvertMode(String mode)
mode
- Allowed values are cut-out, remove-siblings, hide-siblings.public Pdfcrowd.HtmlToPdfClient setWaitForElement(String selectors)
selectors
- One or more CSS selectors separated by commas. The string must not be empty.public Pdfcrowd.HtmlToPdfClient setAutoDetectElementToConvert(boolean value)
value
- Set to true to detect the main element.public Pdfcrowd.HtmlToPdfClient setReadabilityEnhancements(String enhancements)
enhancements
- Allowed values are none, readability-v1, readability-v2, readability-v3, readability-v4.public Pdfcrowd.HtmlToPdfClient setViewportWidth(int width)
width
- The value must be in the range 96-65000.public Pdfcrowd.HtmlToPdfClient setViewportHeight(int height)
height
- 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-65000.height
- Set the viewport height in pixels. The viewport is the user's visible area of the page. If the input HTML uses lazily loaded images, try using a large value that covers the entire height of the HTML, e.g. 100000. Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setRenderingMode(String mode)
mode
- The rendering mode. Allowed values are default, viewport.public Pdfcrowd.HtmlToPdfClient setSmartScalingMode(String mode)
mode
- The smart scaling mode. Allowed values are default, disabled, viewport-fit, content-fit, single-page-fit, single-page-fit-ex, mode1.public Pdfcrowd.HtmlToPdfClient setScaleFactor(int factor)
factor
- The percentage value. The value must be in the range 10-500.public Pdfcrowd.HtmlToPdfClient setJpegQuality(int quality)
quality
- The percentage value. The value must be in the range 1-100.public Pdfcrowd.HtmlToPdfClient setConvertImagesToJpeg(String images)
images
- The image category. Allowed values are none, opaque, all.public Pdfcrowd.HtmlToPdfClient setImageDpi(int dpi)
dpi
- The DPI value. Must be a positive integer number or 0.public Pdfcrowd.HtmlToPdfClient setEnablePdfForms(boolean value)
value
- Set to true to make fillable PDF forms.public Pdfcrowd.HtmlToPdfClient setLinearize(boolean value)
value
- Set to true to create linearized PDF.public Pdfcrowd.HtmlToPdfClient setEncrypt(boolean value)
value
- Set to true to enable PDF encryption.public Pdfcrowd.HtmlToPdfClient setUserPassword(String password)
password
- The user password.public Pdfcrowd.HtmlToPdfClient setOwnerPassword(String password)
password
- The owner password.public Pdfcrowd.HtmlToPdfClient setNoPrint(boolean value)
value
- Set to true to set the no-print flag in the output PDF.public Pdfcrowd.HtmlToPdfClient setNoModify(boolean value)
value
- Set to true to set the read-only only flag in the output PDF.public Pdfcrowd.HtmlToPdfClient setNoCopy(boolean value)
value
- Set to true to set the no-copy flag in the output PDF.public Pdfcrowd.HtmlToPdfClient setTitle(String title)
title
- The title.public Pdfcrowd.HtmlToPdfClient setSubject(String subject)
subject
- The subject.public Pdfcrowd.HtmlToPdfClient setAuthor(String author)
author
- The author.public Pdfcrowd.HtmlToPdfClient setKeywords(String keywords)
keywords
- The string with the keywords.public Pdfcrowd.HtmlToPdfClient setExtractMetaTags(boolean value)
value
- Set to true to extract meta tags.public Pdfcrowd.HtmlToPdfClient setPageLayout(String layout)
layout
- Allowed values are single-page, one-column, two-column-left, two-column-right.public Pdfcrowd.HtmlToPdfClient setPageMode(String mode)
mode
- Allowed values are full-screen, thumbnails, outlines.public Pdfcrowd.HtmlToPdfClient setInitialZoomType(String zoomType)
zoomType
- Allowed values are fit-width, fit-height, fit-page.public Pdfcrowd.HtmlToPdfClient setInitialPage(int page)
page
- Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setInitialZoom(int zoom)
zoom
- Must be a positive integer number.public Pdfcrowd.HtmlToPdfClient setHideToolbar(boolean value)
value
- Set to true to hide tool bars.public Pdfcrowd.HtmlToPdfClient setHideMenubar(boolean value)
value
- Set to true to hide the menu bar.public Pdfcrowd.HtmlToPdfClient setHideWindowUi(boolean value)
value
- Set to true to hide ui elements.public Pdfcrowd.HtmlToPdfClient setFitWindow(boolean value)
value
- Set to true to resize the window.public Pdfcrowd.HtmlToPdfClient setCenterWindow(boolean value)
value
- Set to true to center the window.public Pdfcrowd.HtmlToPdfClient setDisplayTitle(boolean value)
value
- Set to true to display the title.public Pdfcrowd.HtmlToPdfClient setRightToLeft(boolean value)
value
- Set to true to set right-to-left reading order.public Pdfcrowd.HtmlToPdfClient setDataString(String dataString)
dataString
- The input data string.public Pdfcrowd.HtmlToPdfClient setDataFile(String dataFile)
dataFile
- The file path to a local file containing the input data.public Pdfcrowd.HtmlToPdfClient setDataFormat(String dataFormat)
dataFormat
- The data format. Allowed values are auto, json, xml, yaml, csv.public Pdfcrowd.HtmlToPdfClient setDataEncoding(String encoding)
encoding
- The data file encoding.public Pdfcrowd.HtmlToPdfClient setDataIgnoreUndefined(boolean value)
value
- Set to true to ignore undefined variables.public Pdfcrowd.HtmlToPdfClient setDataAutoEscape(boolean value)
value
- Set to true to turn auto escaping on.public Pdfcrowd.HtmlToPdfClient setDataTrimBlocks(boolean value)
value
- Set to true to turn auto trimming on.public Pdfcrowd.HtmlToPdfClient setDataOptions(String options)
options
- Comma separated list of options.public Pdfcrowd.HtmlToPdfClient setDebugLog(boolean value)
value
- Set to true to enable the debug logging.public String getDebugLogUrl()
public int getRemainingCreditCount()
public int getConsumedCreditCount()
public String getJobId()
public int getPageCount()
public int getTotalPageCount()
public int getOutputSize()
public String getVersion()
public Pdfcrowd.HtmlToPdfClient setTag(String tag)
tag
- A string with the custom tag.public Pdfcrowd.HtmlToPdfClient setHttpProxy(String proxy)
proxy
- The value must have format DOMAIN_OR_IP_ADDRESS:PORT.public Pdfcrowd.HtmlToPdfClient setHttpsProxy(String proxy)
proxy
- The value must have format DOMAIN_OR_IP_ADDRESS:PORT.public Pdfcrowd.HtmlToPdfClient setClientCertificate(String certificate)
certificate
- The file must be in PKCS12 format. The file must exist and not be empty.public Pdfcrowd.HtmlToPdfClient setClientCertificatePassword(String password)
password
- public Pdfcrowd.HtmlToPdfClient setLayoutDpi(int dpi)
dpi
- The DPI value. The value must be in the range of 72-600.public Pdfcrowd.HtmlToPdfClient setContentsMatrix(String matrix)
matrix
- A comma separated string of matrix elements: "scaleX,skewX,transX,skewY,scaleY,transY"public Pdfcrowd.HtmlToPdfClient setHeaderMatrix(String matrix)
matrix
- A comma separated string of matrix elements: "scaleX,skewX,transX,skewY,scaleY,transY"public Pdfcrowd.HtmlToPdfClient setFooterMatrix(String matrix)
matrix
- A comma separated string of matrix elements: "scaleX,skewX,transX,skewY,scaleY,transY"public Pdfcrowd.HtmlToPdfClient setDisablePageHeightOptimization(boolean value)
value
- Set to true to disable automatic height scale.public Pdfcrowd.HtmlToPdfClient setMainDocumentCssAnnotation(boolean value)
value
- Set to true to add the special CSS classes.public Pdfcrowd.HtmlToPdfClient setHeaderFooterCssAnnotation(boolean value)
value
- Set to true to add the special CSS classes.public Pdfcrowd.HtmlToPdfClient setConverterVersion(String version)
version
- The version identifier. Allowed values are latest, 20.10, 18.10.public Pdfcrowd.HtmlToPdfClient setUseHttp(boolean value)
value
- Set to true to use HTTP.public Pdfcrowd.HtmlToPdfClient setUserAgent(String agent)
agent
- The user agent string.public Pdfcrowd.HtmlToPdfClient setProxy(String host, int port, String userName, String password)
host
- The proxy hostname.port
- The proxy port.userName
- The username.password
- The password.public Pdfcrowd.HtmlToPdfClient setRetryCount(int count)
count
- Number of retries.Copyright © 2022. All rights reserved.