Constructor and Description |
---|
ImageToPdfClient(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[] |
convertRawData(byte[] data)
Convert raw data.
|
void |
convertRawDataToFile(byte[] data,
String filePath)
Convert raw data to a file.
|
void |
convertRawDataToStream(byte[] data,
OutputStream outStream)
Convert raw data and write the result to an output stream.
|
byte[] |
convertUrl(String url)
Convert an image.
|
void |
convertUrlToFile(String url,
String filePath)
Convert an image and write the result to a local file.
|
void |
convertUrlToStream(String url,
OutputStream outStream)
Convert an image 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 |
getRemainingCreditCount()
Get the number of conversion credits available in your account.
|
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 |
setResize(String resize)
Resize the image.
|
void |
setRotate(String rotate)
Rotate the image.
|
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 byte[] convertUrl(String url)
url
- The address of the image to convert. The supported protocols are http:// and https://.public void convertUrlToStream(String url, OutputStream outStream)
url
- The address of the image 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 image 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[] convertRawData(byte[] data)
data
- The raw content to be converted.public void convertRawDataToStream(byte[] data, OutputStream outStream)
data
- The raw content to be converted.outStream
- The output stream that will contain the conversion output.public void convertRawDataToFile(byte[] data, String filePath) throws IOException
data
- The raw content to be converted.filePath
- The output file path. The string must not be empty.IOException
public void setResize(String resize)
resize
- The resize percentage or new image dimensions.public void setRotate(String rotate)
rotate
- The rotation specified in degrees.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 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.