SDK behavior
Calling conventions and results
Conversion methods such as
convert() and convertToFile() support Promises and callbacks
in Node.js SDK 7 and later. Omitting the callback argument or passing
undefined returns a Promise. Handle it with await or
.then()/.catch().
Supplying a valid callback selects callback mode and returns undefined.
Promise results
| Methods | Result | When it resolves |
|---|---|---|
| Content methods | Buffer |
All PDF output has been received. |
*ToFile |
Supplied file path | The output has been written and the file closed. |
*ToStream (Promise-only) |
Readable |
The response is available. Await a pipeline or finish async iteration to receive all output and observe later failures. |
The SDK has no cancellation API. Closing a local stream does not guarantee that a conversion running on the service stops.
Callbacks
Content methods accept a callbacks object with required
data and error handlers and an optional
end handler:
| Handler | Meaning |
|---|---|
data(readStream) |
Receives the response stream. |
error(message, statusCode, cause) |
Reports conversion failure. Status and underlying cause may be absent. |
end() |
The conversion response is complete. Wait separately for your destination to finish writing. |
File methods accept callback(error, filePath): success calls
callback(null, filePath) after the file closes; failure passes the SDK error.
Callback helpers can write a file or send an HTTP response.
Errors
- Promise mode: conversion failures and invalid inputs reject the Promise.
- Stream output: handle both Promise rejection and errors while consuming the stream.
- Synchronous errors: an invalid callback argument, including
null, throwsTypeError. Constructors and setters remain synchronous; callback mode retains synchronous validation errors.
Conversion failures use pdfcrowd.Pdfcrowd.Error, a native
Error subclass. Its cause holds an underlying error when available.
See error details
for status, reason, and message accessors.
Error object
pdfcrowd.Pdfcrowd.Error extends the native Error class.
Its cause holds an underlying error when available.
The table lists the SDK error object's methods and string representation.
| Operation | Return type | Description |
|---|---|---|
getStatusCode |
number | string | undefined |
The HTTP status code, or undefined when unavailable. |
getReasonCode |
number | string |
The PDFCrowd reason code, or -1 when unavailable. |
getMessage |
string |
The error message. |
getDocumentationLink |
string |
A URL with more information about the error, or an empty string when unavailable. |
toString |
string |
The complete error text, including status and reason codes and a documentation link when present. |
Callback helpers
These functions return a callbacks object for content conversion methods.
pdfcrowd.saveToFile(filePath, callback)
Writes the conversion output to a file.
- Callback:
- The optional
callback(error, filePath)reports failure or completion after the file closes.
pdfcrowd.sendGenericHttpResponse(response, contentType, fileName, disposition)
Sends the output in an HTTP response with the supplied content type and filename.
- Defaults:
- Optional
dispositiondefaults to'attachment'; use'inline'to display the output in the browser. - Errors:
- Conversion errors are sent as plain text in the HTTP response.
pdfcrowd.sendPdfInHttpResponse(response, fileName, disposition)
Sends PDF output with content type application/pdf.
- Defaults:
- Optional
fileNamedefaults to'generated.pdf'. Disposition and error handling followsendGenericHttpResponse.
pdfcrowd.sendHttpResponse(response, disposition, fileName)
Legacy PDF response helper with a different argument order.
- Behavior:
- Same as
sendPdfInHttpResponse.
class PdfToPdfClient
All setter methods return PdfToPdfClient object unless specified otherwise.
Constructor
function PdfToPdfClient(userName, apiKey)
Constructor for the PDFCrowd API client. Initialize a new instance of the conversion client with your PDFCrowd account credentials.
You must provide both your username and API key. This establishes the authenticated connection for all subsequent conversion operations.
- TypeScript:
-
constructor(userName: string, apiKey: string); - Parameters:
-
-
userName- Your username at PDFCrowd. -
apiKey- Your API key.
-
PDF Manipulation
function setAction(action)
Specify the PDF manipulation operation to perform on input files.
- TypeScript:
-
setAction(action: string): this; - Parameter:
-
-
action- Allowed Values:
-
-
join— Merge multiple input PDFs into a single document in the order they were added. -
shuffle— Interleave pages from input PDFs into a single document, taking one page at a time from each PDF in rotation. -
extract— Create a new PDF containing only the specified pages from the input PDF. -
delete— Remove the specified pages from the input PDF and output the remaining pages.
-
- Default:
-
join
-
convert
Execute the configured PDF manipulation operation and return the resulting PDF as a byte array. Processes all added input PDFs according to the selected action and returns the manipulated document in memory.
- Promise:
client.convert()- Callback:
client.convert(callbacks)- TypeScript:
-
convert(callbacks?: undefined): Promise<Buffer>;
convert(callbacks: Callbacks): void; - Parameter:
-
-
callbacks- For callback mode; see Calling conventions and results.
-
- Returns:
- Promise<Buffer> - The complete conversion output. See Calling conventions and results.
convertToStream
Run the conversion and return its output as a readable stream.
- Promise:
client.convertToStream()- TypeScript:
-
convertToStream(): Promise<Readable>; - Returns:
- Promise<Readable> - The readable conversion output. See Calling conventions and results.
convertToFile
Execute the configured PDF manipulation operation and save the resulting PDF to a file.
- Promise:
client.convertToFile(filePath)- Callback:
client.convertToFile(filePath, callback)- TypeScript:
-
convertToFile(filePath: string, callback?: undefined): Promise<string>;
convertToFile(filePath: string, callback: FileCallback): void; - Parameters:
-
-
filePath- The output file path. -
callback- For callback mode; see Calling conventions and results.
-
- Returns:
- Promise<string> - The supplied output file path. See Calling conventions and results.
function addPdfFile(filePath)
Add a PDF file from the local filesystem to the input list. This method can be called multiple times to add multiple input files. Files are processed in the order they were added.
- TypeScript:
-
addPdfFile(filePath: string): this; - Parameter:
-
-
filePath- The file path to a local PDF file.- Constraint:
-
- The file must exist and not be empty.
-
function addPdfRawData(data)
Add in-memory PDF data (byte array) to the input list. This method can be called multiple times to add multiple input PDFs.
Example in PHP:
$clientPdf2Pdf->addPdfRawData($clientHtml2Pdf->convertUrl('http://www.example.com'));
- TypeScript:
-
addPdfRawData(data: Buffer | string): this; - Parameter:
-
-
data(Buffer | string) - The raw PDF data.- Constraint:
-
- The input data must be PDF content.
-
function setInputPdfPassword(password)
Password for decrypting encrypted input PDFs.
- TypeScript:
-
setInputPdfPassword(password: string): this; - Availability:
- API client >= 5.4.0, converter >= 20.10. See versioning.
- Parameter:
-
-
password- The input PDF password.
-
function setPageRange(pages)
Specify which pages to target. Supports individual pages, ranges, open-ended ranges, and combinations. The keyword "last" can be used to reference the final page.
- TypeScript:
-
setPageRange(pages: string): this; - Parameter:
-
-
pages- Constraint:
-
- A comma separated list of page numbers or ranges.
-
- Examples:
-
-
Just the second page is selected:
setPageRange("2") -
The first and the third page are selected:
setPageRange("1,3") -
Everything except the first page is selected:
setPageRange("2-") -
Just the first 3 pages are selected:
setPageRange("-3") -
Pages 3, 6, 7, 8 and 9 are selected:
setPageRange("3,6-9")
-
Just the second page is selected:
Watermark & Background
function setPageWatermark(watermark)
Apply the first page of a watermark PDF to every page of the output PDF. Use this to add transparent overlays like "DRAFT" stamps, security markings, or branding elements that appear on top of content. Use this to mark confidential documents.
- TypeScript:
-
setPageWatermark(watermark: string): this; - Parameter:
-
-
watermark- The file path to a local file.- Constraint:
-
- The file must exist and not be empty.
-
- Examples:
-
-
Multi-page PDF for watermarking:
setPageWatermark("/home/user/john/watermark.pdf") -
Transparent PNG overlay:
setPageWatermark("/home/user/john/watermark.png")
-
Multi-page PDF for watermarking:
function setPageWatermarkUrl(url)
Load a file from the specified URL and apply the file as a watermark to each page of the output PDF. A watermark can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the watermark.
- TypeScript:
-
setPageWatermarkUrl(url: string): this; - Parameter:
-
-
url- Constraint:
-
- Supported protocols are http:// and https://.
-
- Examples:
-
-
Download watermark from server:
setPageWatermarkUrl("http://myserver.com/watermark.pdf") -
Remote logo watermark:
setPageWatermarkUrl("http://myserver.com/watermark.png")
-
Download watermark from server:
function setMultipageWatermark(watermark)
Apply each page of a watermark PDF to the corresponding page of the output PDF. Use this for page-specific watermarks where different pages need different overlays - for example, different approval stamps per department.
If the watermark has fewer pages than the output, the last watermark page is repeated for remaining pages.
- TypeScript:
-
setMultipageWatermark(watermark: string): this; - Parameter:
-
-
watermark- The file path to a local file.- Constraint:
-
- The file must exist and not be empty.
-
- Examples:
-
-
Multi-page PDF for watermarking:
setMultipageWatermark("/home/user/john/watermark.pdf") -
Transparent PNG overlay:
setMultipageWatermark("/home/user/john/watermark.png")
-
Multi-page PDF for watermarking:
function setMultipageWatermarkUrl(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. A watermark can be either a PDF or an image.
- TypeScript:
-
setMultipageWatermarkUrl(url: string): this; - Parameter:
-
-
url- Constraint:
-
- Supported protocols are http:// and https://.
-
- Examples:
-
-
Download watermark from server:
setMultipageWatermarkUrl("http://myserver.com/watermark.pdf") -
Remote logo watermark:
setMultipageWatermarkUrl("http://myserver.com/watermark.png")
-
Download watermark from server:
function setPageBackground(background)
Apply the first page of a background PDF to every page of the output PDF. Use this to add letterheads, branded templates, or decorative backgrounds that appear behind your content. Backgrounds appear beneath content, while watermarks layer on top.
- TypeScript:
-
setPageBackground(background: string): this; - Parameter:
-
-
background- The file path to a local file.- Constraint:
-
- The file must exist and not be empty.
-
- Examples:
-
-
PDF template background:
setPageBackground("/home/user/john/background.pdf") -
Image texture background:
setPageBackground("/home/user/john/background.png")
-
PDF template background:
function setPageBackgroundUrl(url)
Load a file from the specified URL and apply the file as a background to each page of the output PDF. A background can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the background.
- TypeScript:
-
setPageBackgroundUrl(url: string): this; - Parameter:
-
-
url- Constraint:
-
- Supported protocols are http:// and https://.
-
- Examples:
-
-
Download template background:
setPageBackgroundUrl("http://myserver.com/background.pdf") -
Remote background pattern:
setPageBackgroundUrl("http://myserver.com/background.png")
-
Download template background:
function setMultipageBackground(background)
Apply each page of a background PDF to the corresponding page of the output PDF. Use this for page-specific backgrounds where each page needs a different template - for example, different letterheads for front and back pages.
If the background has fewer pages than the output, the last background page is repeated for remaining pages.
- TypeScript:
-
setMultipageBackground(background: string): this; - Parameter:
-
-
background- The file path to a local file.- Constraint:
-
- The file must exist and not be empty.
-
- Examples:
-
-
PDF template background:
setMultipageBackground("/home/user/john/background.pdf") -
Image texture background:
setMultipageBackground("/home/user/john/background.png")
-
PDF template background:
function setMultipageBackgroundUrl(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. A background can be either a PDF or an image.
- TypeScript:
-
setMultipageBackgroundUrl(url: string): this; - Parameter:
-
-
url- Constraint:
-
- Supported protocols are http:// and https://.
-
- Examples:
-
-
Download template background:
setMultipageBackgroundUrl("http://myserver.com/background.pdf") -
Remote background pattern:
setMultipageBackgroundUrl("http://myserver.com/background.png")
-
Download template background:
PDF Format
Miscellaneous values for PDF output.
function setLinearize(value)
Create linearized PDF. This is also known as Fast Web View. Use this to optimize PDFs for progressive download, allowing users to start viewing the first page while the rest downloads.
- TypeScript:
-
setLinearize(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto create linearized PDF.- Default:
-
false
-
function setEncrypt(value)
Encrypt the PDF to prevent search engines from indexing the contents and add an extra layer of security. Use this for confidential documents, internal reports, or any content you do not want appearing in search results.
Combine with a password to require authentication for viewing, or just use encryption alone to prevent indexing while keeping the PDF publicly readable.
- TypeScript:
-
setEncrypt(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto enable PDF encryption.- Default:
-
false
-
function setUserPassword(password)
Protect the PDF with a user password to restrict who can open and view the document. Recipients must enter this password to view the PDF. Use this for confidential documents, sensitive data, or content distribution where you want to control access.
Combine with permission flags to restrict what users can do after opening.
- TypeScript:
-
setUserPassword(password: string): this; - Parameter:
-
-
password- The user password.
-
- Example:
-
-
Simple document password:
setUserPassword("123456")
-
Simple document password:
function setOwnerPassword(password)
Protect the PDF with an owner password for administrative control. This password allows changing permissions, passwords, and document restrictions - like a master key. Use different user and owner passwords to give recipients restricted access while retaining full control.
The owner password should be kept confidential and different from the user password.
- TypeScript:
-
setOwnerPassword(password: string): this; - Parameter:
-
-
password- The owner password.
-
- Example:
-
-
Admin access password:
setOwnerPassword("123456")
-
Admin access password:
function setNoPrint(value)
Disallow printing of the output PDF to protect sensitive content. Use this for confidential documents, copyrighted materials, or preview versions you want to restrict.
- TypeScript:
-
setNoPrint(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto set the no-print flag in the output PDF.- Default:
-
false
-
function setNoModify(value)
Disallow modification of the output PDF to maintain document integrity. Use this for official documents, contracts, or records that should not be altered after creation. Prevents recipients from editing content, adding annotations, or extracting pages.
- TypeScript:
-
setNoModify(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto set the read-only only flag in the output PDF.- Default:
-
false
-
function setNoCopy(value)
Disallow text and graphics extraction from the output PDF to protect copyrighted content. Use this for ebooks, proprietary documents, or materials where you want to prevent easy copying and redistribution.
- TypeScript:
-
setNoCopy(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto set the no-copy flag in the output PDF.- Default:
-
false
-
function setTitle(title)
Set the title of the PDF that appears in PDF reader title bars and document properties. Use descriptive titles for better organization and searchability in document management systems.
This metadata helps users identify documents when multiple PDFs are open and improves accessibility for screen readers.
- TypeScript:
-
setTitle(title: string): this; - Parameter:
-
-
title- The title.
-
- Example:
-
-
Personal CV title:
setTitle("My Resume")
-
Personal CV title:
function setSubject(subject)
Set the subject of the PDF to categorize or summarize the document content. Use this to add searchable metadata for document management systems, improve organization in large PDF libraries, or provide context about the document's purpose.
Appears in PDF properties dialog.
- TypeScript:
-
setSubject(subject: string): this; - Parameter:
-
-
subject- The subject.
-
- Example:
-
-
Technical position subject:
setSubject("CV - Software Developer")
-
Technical position subject:
function setKeywords(keywords)
Associate keywords with the document to improve searchability in document management systems. Use relevant terms that describe the content, making it easier to find documents later.
Separate multiple keywords with commas. Particularly useful for large document repositories or DAM systems.
- TypeScript:
-
setKeywords(keywords: string): this; - Parameter:
-
-
keywords- The string with the keywords.
-
- Example:
-
-
Technical skills for searchability:
setKeywords("software developer, Unix, databases")
-
Technical skills for searchability:
function setUseMetadataFrom(index)
Use metadata (title, subject, author and keywords) from the n-th input PDF when merging multiple PDFs. Set to 1 to use the first PDF's metadata, 2 for the second, etc. Use this when combining PDFs and you want to preserve the metadata from a specific document rather than starting with blank metadata.
Set to 0 for no metadata.
- TypeScript:
-
setUseMetadataFrom(index: number): this; - Parameter:
-
-
index(number) - Set the index of the input PDF file from which to use the metadata. 0 means no metadata.- Constraint:
-
- Must be a positive integer or 0.
-
- Example:
-
-
Use metadata from the first input PDF:
setUseMetadataFrom(1)
-
Use metadata from the first input PDF:
function addAttachment(attachment)
Embed a file as an attachment in the output PDF. Call this method repeatedly to attach several files.
- TypeScript:
-
addAttachment(attachment: string): this; - Availability:
- API client >= 6.7.0, converter >= 24.04. See versioning.
- Parameter:
-
-
attachment- The file path to a local file.- Constraint:
-
- The file must exist and not be empty.
-
Viewer Preferences
These preferences specify how a PDF viewer should present the document. The preferences may be ignored by some PDF viewers.
function setPageLayout(layout)
Control how pages appear when the PDF opens in viewers that respect these preferences. "single-page" for focused reading one page at a time. "one-column" for continuous scrolling like a web page. "two-column-left" for book-like layouts with odd pages on left (international standard). "two-column-right" for magazines with odd pages on right.
- TypeScript:
-
setPageLayout(layout: string): this; - Parameter:
-
-
layout- Allowed Values:
-
-
single-page— Display one page at a time. -
one-column— Display the pages in one column. -
two-column-left— Display the pages in two columns, with odd-numbered pages on the left. -
two-column-right— Display the pages in two columns, with odd-numbered pages on the right.
-
-
function setPageMode(mode)
Control the initial display mode when the PDF opens. "full-screen" for presentations and kiosk displays where you want an immersive experience. "thumbnails" for long documents where visual page navigation is helpful. "outlines" for structured documents with bookmarks/table of contents.
- TypeScript:
-
setPageMode(mode: string): this; - Parameter:
-
-
mode- Allowed Values:
-
-
full-screen— Full-screen mode. -
thumbnails— Thumbnail images are visible. -
outlines— Document outline is visible.
-
-
function setInitialZoomType(zoomType)
Control how the PDF is initially zoomed when opened.
- TypeScript:
-
setInitialZoomType(zoomType: string): this; - Parameter:
-
-
zoomType- Allowed Values:
-
-
fit-width— The page content is magnified just enough to fit the entire width of the page within the window. -
fit-height— The page content is magnified just enough to fit the entire height of the page within the window. -
fit-page— The page content is magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension.
-
-
function setInitialPage(page)
Display the specified page when the document is opened.
- TypeScript:
-
setInitialPage(page: number): this; - Parameter:
-
-
page(number)- Constraint:
-
- Must be a positive integer.
-
- Example:
-
-
Start at second page:
setInitialPage(2)
-
Start at second page:
function setInitialZoom(zoom)
Specify the initial page zoom in percents when the document is opened.
- TypeScript:
-
setInitialZoom(zoom: number): this; - Parameter:
-
-
zoom(number)- Constraint:
-
- Must be a positive integer.
-
- Example:
-
-
Half-size zoom level:
setInitialZoom(50)
-
Half-size zoom level:
function setHideToolbar(value)
Hide the viewer's toolbar when the PDF is opened to provide a cleaner, more focused reading experience. Use this for presentations, kiosk displays, or immersive reading where you want minimal UI distractions.
- TypeScript:
-
setHideToolbar(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto hide tool bars.- Default:
-
false
-
function setHideWindowUi(value)
Hide user interface elements like scroll bars and navigation controls when the PDF opens. Use this for presentation mode, digital signage, or embedded PDFs where you want the most minimal interface possible.
Combines with other UI hiding options for full-screen immersive viewing.
- TypeScript:
-
setHideWindowUi(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto hide ui elements.- Default:
-
false
-
function setFitWindow(value)
Resize the PDF viewer window to fit the size of the first displayed page when opened. Use this to ensure the PDF opens at an appropriate size rather than filling the entire screen.
Particularly useful for small documents, forms, or certificates that look better at actual size.
- TypeScript:
-
setFitWindow(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto resize the window.- Default:
-
false
-
function setCenterWindow(value)
Position the PDF viewer window in the center of the screen when opened.
- TypeScript:
-
setCenterWindow(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto center the window.- Default:
-
false
-
function setDisplayTitle(value)
Display the title of the HTML document in the PDF viewer's title bar instead of the filename. Use this to show more descriptive titles when PDFs are opened - particularly useful when the filename is cryptic or auto-generated.
Improves user experience by showing meaningful document names.
- TypeScript:
-
setDisplayTitle(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto display the title.- Default:
-
false
-
function setRightToLeft(value)
Set the predominant reading order for text to right-to-left. This option has no direct effect on the document's contents or page numbering but can be used to determine the relative positioning of pages when displayed side by side or printed n-up.
- TypeScript:
-
setRightToLeft(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto set right-to-left reading order.- Default:
-
false
-
Miscellaneous
function setDebugLog(value)
Turn on debug logging to troubleshoot conversion issues. Details about the conversion process, including resource loading, rendering steps, and error messages are stored in the debug log. Use this when conversions fail or produce unexpected results. The URL of the log can be obtained from the getDebugLogUrl method or available in conversion statistics.
- TypeScript:
-
setDebugLog(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto enable debug logging.- Default:
-
false
-
function getDebugLogUrl() { return string; }
Get the URL of the debug log for the last conversion.
- TypeScript:
-
getDebugLogUrl(): string | null; - Returns:
- string - The link to the debug log.
function getRemainingCreditCount() { return int; }
Get the number of conversion credits available in your account. Use this to monitor your credit usage and implement alerts before running out of credits.
This method can only be called after a call to one of the convertXtoY methods.
The returned value can differ from the actual count if you run parallel conversions.
The special value 999999 is returned if the information is not available.
- TypeScript:
-
getRemainingCreditCount(): number; - Returns:
- int - The number of credits.
function getConsumedCreditCount() { return int; }
Get the number of credits consumed by the last conversion. Use this to track costs per conversion, especially for complex documents or operations that may consume multiple credits.
- TypeScript:
-
getConsumedCreditCount(): number; - Returns:
- int - The number of credits.
function getJobId() { return string; }
Get the unique job ID for the conversion. Use this to track conversions in your logs, correlate with debug logs, or reference specific conversions when contacting support.
- TypeScript:
-
getJobId(): string; - Returns:
- string - The unique job identifier.
function getPageCount() { return int; }
Get the number of pages in the output document. Use this to validate conversion results, calculate pagination for user interfaces, or track document complexity metrics.
- TypeScript:
-
getPageCount(): number; - Returns:
- int - The page count.
function getOutputSize() { return int; }
Get the size of the output document in bytes. Use this to check file sizes before delivery, implement size-based quotas, or optimize storage allocation.
- TypeScript:
-
getOutputSize(): number; - Returns:
- int - The count of bytes.
function getVersion() { return string; }
Get the version details including API version, converter version, and client library version. Use this for debugging, logging, or ensuring compatibility when reporting issues.
- TypeScript:
-
getVersion(): string; - Returns:
- string - API version, converter version, and client version.
function setTag(tag)
Tag the conversion with a custom value for tracking and analytics. Use this to categorize conversions by customer ID, document type, or business unit. The tag appears in conversion statistics. A value longer than 32 characters is cut off.
- TypeScript:
-
setTag(tag: string): this; - Parameter:
-
-
tag- A string with the custom tag.
-
- Example:
-
-
Track job in analytics:
setTag("client-1234")
-
Track job in analytics:
API Client Options
function setConverterVersion(version)
Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.
- TypeScript:
-
setConverterVersion(version: string): this; - Availability:
- API client >= 5.0.0. See versioning.
- Parameter:
-
-
version- The version identifier.- Allowed Values:
-
-
24.04— Version 24.04. -
20.10— Version 20.10. -
18.10— Version 18.10. -
latest— Version 20.10 is used.
-
- Default:
-
24.04
-
function setUseHttp(value)
Specify whether to use HTTP or HTTPS when connecting to the PDFCrowd API.
- TypeScript:
-
setUseHttp(value: boolean): this; - Parameter:
-
-
value(boolean) - Set totrueto use HTTP.- Default:
-
false
-
function setClientUserAgent(agent)
Specify the User-Agent HTTP header that the client library will use when interacting with the API.
- TypeScript:
-
setClientUserAgent(agent: string): this; - Availability:
- API client >= 6.4.0 See versioning.
- Parameter:
-
-
agent- The user agent string.
-
function setProxy(host, port, userName, password)
Specify an HTTP proxy that the API client library will use to connect to the internet.
- TypeScript:
-
setProxy(host: string, port: number, userName: string, password: string): this; - Parameters:
-
-
host- The proxy hostname. -
port(number) - The proxy port. -
userName- The username. -
password- The password.
-
function setRetryCount(count)
Specify the number of automatic retries when a 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
- TypeScript:
-
setRetryCount(count: number): this; - Parameter:
-
-
count(number) - Number of retries.- Default:
-
1
-
- Example:
-
-
Retry failed requests three times:
setRetryCount(3)
-
Retry failed requests three times: