public static final class Pdfcrowd.PdfToPdfClient
extends java.lang.Object
Constructor and Description |
---|
PdfToPdfClient(java.lang.String userName,
java.lang.String apiKey)
Constructor for the Pdfcrowd API client.
|
Modifier and Type | Method and Description |
---|---|
Pdfcrowd.PdfToPdfClient |
addPdfFile(java.lang.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(java.lang.String filePath)
Perform an action on the input files and write the output PDF to a file.
|
void |
convertToStream(java.io.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.
|
java.lang.String |
getDebugLogUrl()
Get the URL of the debug log for the last conversion.
|
java.lang.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(java.lang.String action)
Specifies the action to be performed on the input PDFs.
|
Pdfcrowd.PdfToPdfClient |
setCenterWindow(boolean centerWindow)
Specify whether to position the document's window in the center of the screen.
|
Pdfcrowd.PdfToPdfClient |
setDebugLog(boolean debugLog)
Turn on the debug logging.
|
Pdfcrowd.PdfToPdfClient |
setDisplayTitle(boolean displayTitle)
Specify whether the window's title bar should display the document title.
|
Pdfcrowd.PdfToPdfClient |
setEncrypt(boolean encrypt)
Encrypt the PDF.
|
Pdfcrowd.PdfToPdfClient |
setFitWindow(boolean fitWindow)
Specify whether to resize the document's window to fit the size of the first displayed page.
|
Pdfcrowd.PdfToPdfClient |
setHideMenubar(boolean hideMenubar)
Specify whether to hide the viewer application's menu bar when the document is active.
|
Pdfcrowd.PdfToPdfClient |
setHideToolbar(boolean hideToolbar)
Specify whether to hide the viewer application's tool bars when the document is active.
|
Pdfcrowd.PdfToPdfClient |
setHideWindowUi(boolean hideWindowUi)
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 initialPage)
Display the specified page when the document is opened.
|
Pdfcrowd.PdfToPdfClient |
setInitialZoom(int initialZoom)
Specify the initial page zoom in percents when the document is opened.
|
Pdfcrowd.PdfToPdfClient |
setInitialZoomType(java.lang.String initialZoomType)
Specify how the page should be displayed when opened.
|
Pdfcrowd.PdfToPdfClient |
setLinearize(boolean linearize)
Create linearized PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageBackground(java.lang.String multipageBackground)
Apply each page of the specified PDF to the background of the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageWatermark(java.lang.String multipageWatermark)
Apply each page of the specified watermark PDF to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setNoCopy(boolean noCopy)
Disallow text and graphics extraction from the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setNoModify(boolean noModify)
Disallow modification of the ouput PDF.
|
Pdfcrowd.PdfToPdfClient |
setNoPrint(boolean noPrint)
Disallow printing of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setOwnerPassword(java.lang.String ownerPassword)
Protect the PDF with an owner password.
|
Pdfcrowd.PdfToPdfClient |
setPageBackground(java.lang.String pageBackground)
Apply the first page of the specified PDF to the background of every page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setPageLayout(java.lang.String pageLayout)
Specify the page layout to be used when the document is opened.
|
Pdfcrowd.PdfToPdfClient |
setPageMode(java.lang.String pageMode)
Specify how the document should be displayed when opened.
|
Pdfcrowd.PdfToPdfClient |
setPageWatermark(java.lang.String pageWatermark)
Apply the first page of the watermark PDF to every page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setProxy(java.lang.String host,
int port,
java.lang.String userName,
java.lang.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 |
setRightToLeft(boolean rightToLeft)
Set the predominant reading order for text to right-to-left.
|
Pdfcrowd.PdfToPdfClient |
setTag(java.lang.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(java.lang.String userAgent)
Set a custom user agent HTTP header.
|
Pdfcrowd.PdfToPdfClient |
setUserPassword(java.lang.String userPassword)
Protect the PDF with a user password.
|
public PdfToPdfClient(java.lang.String userName, java.lang.String apiKey)
userName
- Your username at Pdfcrowd.apiKey
- Your API key.public Pdfcrowd.PdfToPdfClient setAction(java.lang.String action)
action
- Allowed values are join, shuffle.public byte[] convert()
public void convertToStream(java.io.OutputStream outStream)
outStream
- The output stream that will contain the output PDF.public void convertToFile(java.lang.String filePath) throws java.io.IOException
filePath
- The output file path. The string must not be empty.java.io.IOException
public Pdfcrowd.PdfToPdfClient addPdfFile(java.lang.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 setPageWatermark(java.lang.String pageWatermark)
pageWatermark
- The file path to a local watermark PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setMultipageWatermark(java.lang.String multipageWatermark)
multipageWatermark
- The file path to a local watermark PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setPageBackground(java.lang.String pageBackground)
pageBackground
- The file path to a local background PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setMultipageBackground(java.lang.String multipageBackground)
multipageBackground
- The file path to a local background PDF file. The file must exist and not be empty.public Pdfcrowd.PdfToPdfClient setLinearize(boolean linearize)
linearize
- Set to true to create linearized PDF.public Pdfcrowd.PdfToPdfClient setEncrypt(boolean encrypt)
encrypt
- Set to true to enable PDF encryption.public Pdfcrowd.PdfToPdfClient setUserPassword(java.lang.String userPassword)
userPassword
- The user password.public Pdfcrowd.PdfToPdfClient setOwnerPassword(java.lang.String ownerPassword)
ownerPassword
- The owner password.public Pdfcrowd.PdfToPdfClient setNoPrint(boolean noPrint)
noPrint
- Set to true to set the no-print flag in the output PDF.public Pdfcrowd.PdfToPdfClient setNoModify(boolean noModify)
noModify
- Set to true to set the read-only only flag in the output PDF.public Pdfcrowd.PdfToPdfClient setNoCopy(boolean noCopy)
noCopy
- Set to true to set the no-copy flag in the output PDF.public Pdfcrowd.PdfToPdfClient setPageLayout(java.lang.String pageLayout)
pageLayout
- Allowed values are single-page, one-column, two-column-left, two-column-right.public Pdfcrowd.PdfToPdfClient setPageMode(java.lang.String pageMode)
pageMode
- Allowed values are full-screen, thumbnails, outlines.public Pdfcrowd.PdfToPdfClient setInitialZoomType(java.lang.String initialZoomType)
initialZoomType
- Allowed values are fit-width, fit-height, fit-page.public Pdfcrowd.PdfToPdfClient setInitialPage(int initialPage)
initialPage
- Must be a positive integer number.public Pdfcrowd.PdfToPdfClient setInitialZoom(int initialZoom)
initialZoom
- Must be a positive integer number.public Pdfcrowd.PdfToPdfClient setHideToolbar(boolean hideToolbar)
hideToolbar
- Set to true to hide tool bars.public Pdfcrowd.PdfToPdfClient setHideMenubar(boolean hideMenubar)
hideMenubar
- Set to true to hide the menu bar.public Pdfcrowd.PdfToPdfClient setHideWindowUi(boolean hideWindowUi)
hideWindowUi
- Set to true to hide ui elements.public Pdfcrowd.PdfToPdfClient setFitWindow(boolean fitWindow)
fitWindow
- Set to true to resize the window.public Pdfcrowd.PdfToPdfClient setCenterWindow(boolean centerWindow)
centerWindow
- Set to true to center the window.public Pdfcrowd.PdfToPdfClient setDisplayTitle(boolean displayTitle)
displayTitle
- Set to true to display the title.public Pdfcrowd.PdfToPdfClient setRightToLeft(boolean rightToLeft)
rightToLeft
- Set to true to set right-to-left reading order.public Pdfcrowd.PdfToPdfClient setDebugLog(boolean debugLog)
debugLog
- Set to true to enable the debug logging.public java.lang.String getDebugLogUrl()
public int getRemainingCreditCount()
public int getConsumedCreditCount()
public java.lang.String getJobId()
public int getPageCount()
public int getOutputSize()
public Pdfcrowd.PdfToPdfClient setTag(java.lang.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(java.lang.String userAgent)
userAgent
- The user agent string.public Pdfcrowd.PdfToPdfClient setProxy(java.lang.String host, int port, java.lang.String userName, java.lang.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.