Constructor and Description |
---|
PdfToPdfClient(String userName,
String apiKey)
Constructor for the Pdfcrowd API client.
|
Modifier and Type | Method and Description |
---|---|
void |
addPdfFile(String filePath)
Add a PDF file to the list of the input PDFs.
|
void |
addPdfRawData(byte[] pdfRawData)
Add in-memory raw PDF data to the list of the input PDFs.
|
byte[] |
convertFiles()
Perform an action on the input files.
|
void |
convertFilesToFile(String filePath)
Perform an action on the input files and write the output PDF to a file.
|
void |
convertFilesToStream(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.
|
void |
setAction(String action)
Specifies the action to be performed on the input PDFs.
|
void |
setDebugLog(boolean debugLog)
Turn on the debug logging.
|
void |
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.
|
void |
setUseHttp(boolean useHttp)
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
|
void |
setUserAgent(String userAgent)
Set a custom user agent HTTP header.
|
public void setAction(String action)
action
- Allowed values are join, shuffle.public byte[] convertFiles()
public void convertFilesToStream(OutputStream outStream)
outStream
- The output stream that will contain the output PDF.public void convertFilesToFile(String filePath) throws IOException
filePath
- The output file path. The string must not be empty.IOException
public void addPdfFile(String filePath)
filePath
- The file path to a local PDF file. The file must exist and not be empty.public void addPdfRawData(byte[] pdfRawData)
pdfRawData
- The raw PDF data. The input data must be PDF content.public void 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 void setUseHttp(boolean useHttp)
useHttp
- Set to true to use HTTP.public void setUserAgent(String userAgent)
userAgent
- The user agent string.Copyright © 2017. All rights reserved.