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[] pdfRawData)
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.
|
Pdfcrowd.PdfToPdfClient |
setAction(String action)
Specifies the action to be performed on the input PDFs.
|
Pdfcrowd.PdfToPdfClient |
setDebugLog(boolean debugLog)
Turn on the debug logging.
|
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 retryCount)
Specifies the number of retries when the 502 HTTP status code is received.
|
Pdfcrowd.PdfToPdfClient |
setTag(String tag)
Tag the conversion with a custom value.
|
Pdfcrowd.PdfToPdfClient |
setUseHttp(boolean useHttp)
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
|
Pdfcrowd.PdfToPdfClient |
setUserAgent(String userAgent)
Set a custom user agent HTTP header.
|
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[] pdfRawData)
pdfRawData
- The raw PDF data. The input data must be PDF content.public Pdfcrowd.PdfToPdfClient setDebugLog(boolean debugLog)
debugLog
- 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 Pdfcrowd.PdfToPdfClient setTag(String tag)
tag
- A string with the custom tag.public Pdfcrowd.PdfToPdfClient setUseHttp(boolean useHttp)
useHttp
- Set to true to use HTTP.public Pdfcrowd.PdfToPdfClient setUserAgent(String userAgent)
userAgent
- 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 retryCount)
retryCount
- Number of retries wanted.Copyright © 2019. All rights reserved.