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 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 |
setAuthor(String author)
Set the author of the PDF.
|
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 |
setInputPdfPassword(String password)
Password to open the encrypted PDF file.
|
Pdfcrowd.PdfToPdfClient |
setKeywords(String keywords)
Associate keywords with the document.
|
Pdfcrowd.PdfToPdfClient |
setLinearize(boolean value)
Create linearized PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageBackground(String background)
Apply each page of a background to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageBackgroundUrl(String url)
Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageWatermark(String watermark)
Apply each page of a watermark to the corresponding page of the output PDF.
|
Pdfcrowd.PdfToPdfClient |
setMultipageWatermarkUrl(String url)
Load a file from the specified URL and apply each page of the file as a watermark 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 a background to each page of the output PDF file.
|
Pdfcrowd.PdfToPdfClient |
setPageBackgroundUrl(String url)
Load a file from the specified URL and apply the file as a background to each 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 |
setPageRange(String pages)
Set the page range for extract or delete action.
|
Pdfcrowd.PdfToPdfClient |
setPageWatermark(String watermark)
Apply a watermark to each page of the output PDF file.
|
Pdfcrowd.PdfToPdfClient |
setPageWatermarkUrl(String url)
Load a file from the specified URL and apply the file as a watermark to each 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 automatic retries when the 502 or 503 HTTP status code is received.
|
Pdfcrowd.PdfToPdfClient |
setRightToLeft(boolean value)
Set the predominant reading order for text to right-to-left.
|
Pdfcrowd.PdfToPdfClient |
setSubject(String subject)
Set the subject of the PDF.
|
Pdfcrowd.PdfToPdfClient |
setTag(String tag)
Tag the conversion with a custom value.
|
Pdfcrowd.PdfToPdfClient |
setTitle(String title)
Set the title of the PDF.
|
Pdfcrowd.PdfToPdfClient |
setUseHttp(boolean value)
Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
|
Pdfcrowd.PdfToPdfClient |
setUseMetadataFrom(int index)
Use metadata (title, subject, author and keywords) from the n-th input PDF.
|
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, extract, delete.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 setInputPdfPassword(String password)
password
- The input PDF password.public Pdfcrowd.PdfToPdfClient setPageRange(String pages)
pages
- A comma separated list of page numbers or ranges.public Pdfcrowd.PdfToPdfClient setPageWatermark(String watermark)
watermark
- The file path to a local 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 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 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 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 setTitle(String title)
title
- The title.public Pdfcrowd.PdfToPdfClient setSubject(String subject)
subject
- The subject.public Pdfcrowd.PdfToPdfClient setAuthor(String author)
author
- The author.public Pdfcrowd.PdfToPdfClient setKeywords(String keywords)
keywords
- The string with the keywords.public Pdfcrowd.PdfToPdfClient setUseMetadataFrom(int index)
index
- Set the index of the input PDF file from which to use the metadata. 0 means no metadata. Must be a positive integer number or 0.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, 24.04, 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.Copyright © 2024. All rights reserved.