Constructor and Description |
---|
PdfToPdfClient(String userName,
String apiKey)
Constructor for the Pdfcrowd API client.
|
Modifier and Type | Method and Description |
---|---|
Pdfcrowd.PdfToPdfClient |
addPdfFile(String filePath)
Add a PDF file to the list of the input PDFs.
|
Pdfcrowd.PdfToPdfClient |
addPdfRawData(byte[] data)
Add in-memory raw PDF data to the list of the input PDFs.
Typical usage is for adding PDF created by another Pdfcrowd converter. Example in PHP: $clientPdf2Pdf->addPdfRawData($clientHtml2Pdf->convertUrl('http://www.example.com')); |
byte[] |
convert()
Perform an action on the input files.
|
void |
convertToFile(String filePath)
Perform an action on the input files and write the output PDF to a file.
|
void |
convertToStream(OutputStream outStream)
Perform an action on the input files and write the output PDF 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 total number of pages in the output document.
|
int |
getRemainingCreditCount()
Get the number of conversion credits available in your account.
|
String |
getVersion()
Get the version details.
|
Pdfcrowd.PdfToPdfClient |
setAction(String action)
Specifies the action to be performed on the input PDFs.
|
Pdfcrowd.PdfToPdfClient |
setCenterWindow(boolean value)
Specify whether to position the document's window in the center of the screen.
|
Pdfcrowd.PdfToPdfClient |
setConverterVersion(String version)
Set the converter version.
|
Pdfcrowd.PdfToPdfClient |
setDebugLog(boolean value)
Turn on the debug logging.
|
Pdfcrowd.PdfToPdfClient |
setDisplayTitle(boolean value)
Specify whether the window's title bar should display the document title.
|
Pdfcrowd.PdfToPdfClient |
setEncrypt(boolean value)
Encrypt the PDF.
|
Pdfcrowd.PdfToPdfClient |
setFitWindow(boolean value)
Specify whether to resize the document's window to fit the size of the first displayed page.
|
Pdfcrowd.PdfToPdfClient |
setHideMenubar(boolean value)
Specify whether to hide the viewer application's menu bar when the document is active.
|
Pdfcrowd.PdfToPdfClient |
setHideToolbar(boolean value)
Specify whether to hide the viewer application's tool bars when the document is active.
|
Pdfcrowd.PdfToPdfClient |
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.PdfToPdfClient |
setInitialPage(int page)
Display the specified page when the document is opened.
|
Pdfcrowd.PdfToPdfClient |
setInitialZoom(int zoom)
Specify the initial page zoom in percents when the document is opened.
|
Pdfcrowd.PdfToPdfClient |
setInitialZoomType(String zoomType)
Specify how the page should be displayed when opened.
|
Pdfcrowd.PdfToPdfClient |
setLinearize(boolean value)
Create linearized PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageBackground(String background)
Apply each page of the specified PDF to the background of the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageBackgroundUrl(String url)
Load a background PDF from the specified URL and apply each page of the specified background PDF to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageWatermark(String watermark)
Apply each page of the specified watermark PDF to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageWatermarkUrl(String url)
Load a watermark PDF from the specified URL and apply each page of the specified watermark PDF to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setNoCopy(boolean value)
Disallow text and graphics extraction from the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setNoModify(boolean value)
Disallow modification of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setNoPrint(boolean value)
Disallow printing of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setOwnerPassword(String password)
Protect the PDF with an owner password.
|
Pdfcrowd.PdfToPdfClient |
setPageBackground(String background)
Apply the first page of the specified PDF to the background of every page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setPageBackgroundUrl(String url)
Load a background PDF from the specified URL and apply the first page of the background PDF to every page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setPageLayout(String layout)
Specify the page layout to be used when the document is opened.
|
Pdfcrowd.PdfToPdfClient |
setPageMode(String mode)
Specify how the document should be displayed when opened.
|
Pdfcrowd.PdfToPdfClient |
setPageWatermark(String watermark)
Apply the first page of the watermark PDF to every page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setPageWatermarkUrl(String url)
Load a watermark PDF from the specified URL and apply the first page of the watermark PDF to every page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
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.PdfToPdfClient |
setRetryCount(int count)
Specifies the number of retries when the 502 HTTP status code is received.
|
Pdfcrowd.PdfToPdfClient |
setRightToLeft(boolean value)
Set the predominant reading order for text to right-to-left.
|
Pdfcrowd.PdfToPdfClient |
setTag(String tag)
Tag the conversion with a custom value.
|
Pdfcrowd.PdfToPdfClient |
setUseHttp(boolean value)
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
|
Pdfcrowd.PdfToPdfClient |
setUserAgent(String agent)
Set a custom user agent HTTP header.
|
Pdfcrowd.PdfToPdfClient |
setUserPassword(String password)
Protect the PDF with a user password.
|
public Pdfcrowd.PdfToPdfClient setAction(String action)
action
- Allowed values are join, shuffle.public byte[] convert()
public void convertToStream(OutputStream outStream)
outStream
- The output stream that will contain the output PDF.public void convertToFile(String filePath) throws IOException
filePath
- The output file path. The string must not be empty.IOException
public Pdfcrowd.PdfToPdfClient addPdfFile(String filePath)
filePath
- The file path to a local PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient addPdfRawData(byte[] data)
data
- The raw PDF data. The input data must be PDF content.public Pdfcrowd.PdfToPdfClient setPageWatermark(String watermark)
watermark
- The file path to a local watermark PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setPageWatermarkUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.PdfToPdfClient setMultipageWatermark(String watermark)
watermark
- The file path to a local watermark PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setMultipageWatermarkUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.PdfToPdfClient setPageBackground(String background)
background
- The file path to a local background PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setPageBackgroundUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.PdfToPdfClient setMultipageBackground(String background)
background
- The file path to a local background PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setMultipageBackgroundUrl(String url)
url
- The supported protocols are http:// and https://.public Pdfcrowd.PdfToPdfClient setLinearize(boolean value)
value
- Set to true to create linearized PDF.public Pdfcrowd.PdfToPdfClient setEncrypt(boolean value)
value
- Set to true to enable PDF encryption.public Pdfcrowd.PdfToPdfClient setUserPassword(String password)
password
- The user password.public Pdfcrowd.PdfToPdfClient setOwnerPassword(String password)
password
- The owner password.public Pdfcrowd.PdfToPdfClient setNoPrint(boolean value)
value
- Set to true to set the no-print flag in the output PDF.public Pdfcrowd.PdfToPdfClient setNoModify(boolean value)
value
- Set to true to set the read-only only flag in the output PDF.public Pdfcrowd.PdfToPdfClient setNoCopy(boolean value)
value
- Set to true to set the no-copy flag in the output PDF.public Pdfcrowd.PdfToPdfClient setPageLayout(String layout)
layout
- Allowed values are single-page, one-column, two-column-left, two-column-right.public Pdfcrowd.PdfToPdfClient setPageMode(String mode)
mode
- Allowed values are full-screen, thumbnails, outlines.public Pdfcrowd.PdfToPdfClient setInitialZoomType(String zoomType)
zoomType
- Allowed values are fit-width, fit-height, fit-page.public Pdfcrowd.PdfToPdfClient setInitialPage(int page)
page
- Must be a positive integer number.public Pdfcrowd.PdfToPdfClient setInitialZoom(int zoom)
zoom
- Must be a positive integer number.public Pdfcrowd.PdfToPdfClient setHideToolbar(boolean value)
value
- Set to true to hide tool bars.public Pdfcrowd.PdfToPdfClient setHideMenubar(boolean value)
value
- Set to true to hide the menu bar.public Pdfcrowd.PdfToPdfClient setHideWindowUi(boolean value)
value
- Set to true to hide ui elements.public Pdfcrowd.PdfToPdfClient setFitWindow(boolean value)
value
- Set to true to resize the window.public Pdfcrowd.PdfToPdfClient setCenterWindow(boolean value)
value
- Set to true to center the window.public Pdfcrowd.PdfToPdfClient setDisplayTitle(boolean value)
value
- Set to true to display the title.public Pdfcrowd.PdfToPdfClient setRightToLeft(boolean value)
value
- Set to true to set right-to-left reading order.public Pdfcrowd.PdfToPdfClient 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 getOutputSize()
public String getVersion()
public Pdfcrowd.PdfToPdfClient setTag(String tag)
tag
- A string with the custom tag.public Pdfcrowd.PdfToPdfClient setConverterVersion(String version)
version
- The version identifier. Allowed values are latest, 20.10, 18.10.public Pdfcrowd.PdfToPdfClient setUseHttp(boolean value)
value
- Set to true to use HTTP.public Pdfcrowd.PdfToPdfClient setUserAgent(String agent)
agent
- The user agent string.public Pdfcrowd.PdfToPdfClient 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.PdfToPdfClient setRetryCount(int count)
count
- Number of retries wanted.Copyright © 2021. All rights reserved.