/// import {Readable} from 'stream'; import {IncomingMessage, ServerResponse} from 'http'; declare namespace pdfcrowd { interface LegacyCallbacks { data?: (stream: IncomingMessage) => void; pdf?: (stream: IncomingMessage) => void; error?: (message: string, statusCode?: number | string, cause?: unknown) => void; end?: () => void; } // Modern conversions require content and error handlers; pdf aliases data. type Callbacks = LegacyCallbacks & { error: (message: string, statusCode?: number | string, cause?: unknown) => void; } & ( {data: (stream: IncomingMessage) => void} | {pdf: (stream: IncomingMessage) => void} ); type FileCallback = (error: Pdfcrowd.Error | null, filePath?: string) => void; function saveToFile(filePath: string, callback?: FileCallback): Callbacks; function sendHttpResponse(response: ServerResponse, disposition?: string, fileName?: string): Callbacks; function sendPdfInHttpResponse(response: ServerResponse, fileName?: string, disposition?: string): Callbacks; function sendImageInHttpResponse(response: ServerResponse, contentType: string, fileName: string, disposition?: string): Callbacks; function sendGenericHttpResponse(response: ServerResponse, contentType: string, fileName: string, disposition?: string): Callbacks; // The legacy client retains its callback-only interface. class Pdfcrowd { constructor(username: string, apikey: string, host?: string); convertHtml(html: string, callbacks?: LegacyCallbacks, options?: LegacyOptions): void; convertURI(uri: string, callbacks?: LegacyCallbacks, options?: LegacyOptions): void; convertFile(fileName: string, callbacks?: LegacyCallbacks, options?: LegacyOptions): void; } interface LegacyOptions { [name: string]: string | number | boolean; } namespace Pdfcrowd { // This SDK error is a subclass of the native Error constructor, so // `err instanceof Error` holds and it carries a real stack/cause. class Error extends globalThis.Error { constructor(error: string | globalThis.Error, httpCode?: number | string, cause?: unknown); // Declared explicitly: native Error only exposes `cause` when the // consumer targets ES2022+, but this SDK always sets it (see the // runtime fallback in pdfcrowd.js), so it must be visible at any target. cause: unknown; error: string; // Explicit string statuses are normalized to numbers too. httpCode: number | undefined; reasonCode: number; docLink: string; toString(): string; getStatusCode(): number | undefined; getReasonCode(): number; getMessage(): string; getDocumentationLink(): string; } } class HtmlToPdfClient { constructor(userName: string, apiKey: string); convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertString(text: string, callbacks?: undefined): Promise; convertString(text: string, callbacks: Callbacks): void; convertStringToStream(text: string): Promise; convertStringToFile(text: string, filePath: string, callback?: undefined): Promise; convertStringToFile(text: string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setZipMainFilename(filename: string): this; setPageSize(size: string): this; setPageWidth(width: string): this; setPageHeight(height: string): this; setPageDimensions(width: string, height: string): this; setOrientation(orientation: string): this; setMarginTop(top: string): this; setMarginRight(right: string): this; setMarginBottom(bottom: string): this; setMarginLeft(left: string): this; setNoMargins(value: boolean): this; setPageMargins(top: string, right: string, bottom: string, left: string): this; setPrintPageRange(pages: string): this; setContentViewportWidth(width: string): this; setContentViewportHeight(height: string): this; setContentFitMode(mode: string): this; setRemoveBlankPages(pages: string): this; setHeaderUrl(url: string): this; setHeaderHtml(html: string): this; setHeaderHeight(height: string): this; setZipHeaderFilename(filename: string): this; setFooterUrl(url: string): this; setFooterHtml(html: string): this; setFooterHeight(height: string): this; setZipFooterFilename(filename: string): this; setNoHeaderFooterHorizontalMargins(value: boolean): this; setExcludeHeaderOnPages(pages: string): this; setExcludeFooterOnPages(pages: string): this; setHeaderFooterScaleFactor(factor: number): this; setPageNumberingOffset(offset: number): this; setPageWatermark(watermark: string): this; setPageWatermarkUrl(url: string): this; setMultipageWatermark(watermark: string): this; setMultipageWatermarkUrl(url: string): this; setPageBackground(background: string): this; setPageBackgroundUrl(url: string): this; setMultipageBackground(background: string): this; setMultipageBackgroundUrl(url: string): this; setPageBackgroundColor(color: string): this; setUsePrintMedia(value: boolean): this; setNoBackground(value: boolean): this; setDisableJavascript(value: boolean): this; setDisableImageLoading(value: boolean): this; setDisableRemoteFonts(value: boolean): this; setLoadIframes(iframes: string): this; setBlockAds(value: boolean): this; setDefaultEncoding(encoding: string): this; setLocale(locale: string): this; setHttpAuthUserName(userName: string): this; setHttpAuthPassword(password: string): this; setHttpAuth(userName: string, password: string): this; setCookies(cookies: string): this; setVerifySslCertificates(value: boolean): this; setFailOnMainUrlError(failOnError: boolean): this; setFailOnAnyUrlError(failOnError: boolean): this; setNoXpdfcrowdHeader(value: boolean): this; setCssPageRuleMode(mode: string): this; setCustomCss(css: string): this; setCustomJavascript(javascript: string): this; setOnLoadJavascript(javascript: string): this; setCustomHttpHeader(header: string): this; setJavascriptDelay(delay: number): this; setElementToConvert(selectors: string): this; setElementToConvertMode(mode: string): this; setWaitForElement(selectors: string): this; setAutoDetectElementToConvert(value: boolean): this; setReadabilityEnhancements(enhancements: string): this; setScaleFactor(factor: number): this; setJpegQuality(quality: number): this; setConvertImagesToJpeg(images: string): this; setImageDpi(dpi: number): this; setEnablePdfForms(value: boolean): this; setLinearize(value: boolean): this; setEncrypt(value: boolean): this; setUserPassword(password: string): this; setOwnerPassword(password: string): this; setNoPrint(value: boolean): this; setNoModify(value: boolean): this; setNoCopy(value: boolean): this; setTitle(title: string): this; setSubject(subject: string): this; setAuthor(author: string): this; setKeywords(keywords: string): this; setExtractMetaTags(value: boolean): this; setConformance(conformance: string): this; setTaggedPdf(value: boolean): this; addAttachment(attachment: string): this; setPageLayout(layout: string): this; setPageMode(mode: string): this; setInitialZoomType(zoomType: string): this; setInitialPage(page: number): this; setInitialZoom(zoom: number): this; setHideToolbar(value: boolean): this; setHideMenubar(value: boolean): this; setHideWindowUi(value: boolean): this; setFitWindow(value: boolean): this; setCenterWindow(value: boolean): this; setDisplayTitle(value: boolean): this; setRightToLeft(value: boolean): this; setDataString(dataString: string): this; setDataFile(dataFile: string): this; setDataFormat(dataFormat: string): this; setDataEncoding(encoding: string): this; setDataIgnoreUndefined(value: boolean): this; setDataAutoEscape(value: boolean): this; setDataTrimBlocks(value: boolean): this; setDataVariableMarkers(markers: string): this; setDataOptions(options: string): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getPageCount(): number; getTotalPageCount(): number; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setClientCertificate(certificate: string): this; setClientCertificatePassword(password: string): this; setLayoutDpi(dpi: number): this; setContentAreaX(x: string): this; setContentAreaY(y: string): this; setContentAreaWidth(width: string): this; setContentAreaHeight(height: string): this; setContentArea(x: string, y: string, width: string, height: string): this; setContentsMatrix(matrix: string): this; setHeaderMatrix(matrix: string): this; setFooterMatrix(matrix: string): this; setDisablePageHeightOptimization(value: boolean): this; setMainDocumentCssAnnotation(value: boolean): this; setHeaderFooterCssAnnotation(value: boolean): this; setMaxLoadingTime(maxTime: number): this; setConversionConfig(jsonString: string): this; setConversionConfigFile(filepath: string): this; setSubprocessReferrer(referrer: string): this; setConverterUserAgent(agent: string): this; setConverterVersion(version: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class HtmlToImageClient { constructor(userName: string, apiKey: string); setOutputFormat(outputFormat: string): this; convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertString(text: string, callbacks?: undefined): Promise; convertString(text: string, callbacks: Callbacks): void; convertStringToStream(text: string): Promise; convertStringToFile(text: string, filePath: string, callback?: undefined): Promise; convertStringToFile(text: string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setZipMainFilename(filename: string): this; setScreenshotWidth(width: number): this; setScreenshotHeight(height: number): this; setScaleFactor(factor: number): this; setBackgroundColor(color: string): this; setUsePrintMedia(value: boolean): this; setNoBackground(value: boolean): this; setDisableJavascript(value: boolean): this; setDisableImageLoading(value: boolean): this; setDisableRemoteFonts(value: boolean): this; setLoadIframes(iframes: string): this; setBlockAds(value: boolean): this; setDefaultEncoding(encoding: string): this; setLocale(locale: string): this; setHttpAuthUserName(userName: string): this; setHttpAuthPassword(password: string): this; setHttpAuth(userName: string, password: string): this; setCookies(cookies: string): this; setVerifySslCertificates(value: boolean): this; setFailOnMainUrlError(failOnError: boolean): this; setFailOnAnyUrlError(failOnError: boolean): this; setNoXpdfcrowdHeader(value: boolean): this; setCustomCss(css: string): this; setCustomJavascript(javascript: string): this; setOnLoadJavascript(javascript: string): this; setCustomHttpHeader(header: string): this; setJavascriptDelay(delay: number): this; setElementToConvert(selectors: string): this; setElementToConvertMode(mode: string): this; setWaitForElement(selectors: string): this; setAutoDetectElementToConvert(value: boolean): this; setReadabilityEnhancements(enhancements: string): this; setDataString(dataString: string): this; setDataFile(dataFile: string): this; setDataFormat(dataFormat: string): this; setDataEncoding(encoding: string): this; setDataIgnoreUndefined(value: boolean): this; setDataAutoEscape(value: boolean): this; setDataTrimBlocks(value: boolean): this; setDataVariableMarkers(markers: string): this; setDataOptions(options: string): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setClientCertificate(certificate: string): this; setClientCertificatePassword(password: string): this; setMaxLoadingTime(maxTime: number): this; setSubprocessReferrer(referrer: string): this; setConverterUserAgent(agent: string): this; setConverterVersion(version: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class ImageToImageClient { constructor(userName: string, apiKey: string); convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertRawData(data: Buffer | string, callbacks?: undefined): Promise; convertRawData(data: Buffer | string, callbacks: Callbacks): void; convertRawDataToStream(data: Buffer | string): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback?: undefined): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setOutputFormat(outputFormat: string): this; setResize(resize: string): this; setRotate(rotate: string): this; setCropAreaX(x: string): this; setCropAreaY(y: string): this; setCropAreaWidth(width: string): this; setCropAreaHeight(height: string): this; setCropArea(x: string, y: string, width: string, height: string): this; setRemoveBorders(value: boolean): this; setCanvasSize(size: string): this; setCanvasWidth(width: string): this; setCanvasHeight(height: string): this; setCanvasDimensions(width: string, height: string): this; setOrientation(orientation: string): this; setPosition(position: string): this; setPrintCanvasMode(mode: string): this; setMarginTop(top: string): this; setMarginRight(right: string): this; setMarginBottom(bottom: string): this; setMarginLeft(left: string): this; setMargins(top: string, right: string, bottom: string, left: string): this; setCanvasBackgroundColor(color: string): this; setDpi(dpi: number): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setConverterVersion(version: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class PdfToPdfClient { constructor(userName: string, apiKey: string); setAction(action: string): this; convert(callbacks?: undefined): Promise; convert(callbacks: Callbacks): void; convertToStream(): Promise; convertToFile(filePath: string, callback?: undefined): Promise; convertToFile(filePath: string, callback: FileCallback): void; addPdfFile(filePath: string): this; addPdfRawData(data: Buffer | string): this; setInputPdfPassword(password: string): this; setPageRange(pages: string): this; setPageWatermark(watermark: string): this; setPageWatermarkUrl(url: string): this; setMultipageWatermark(watermark: string): this; setMultipageWatermarkUrl(url: string): this; setPageBackground(background: string): this; setPageBackgroundUrl(url: string): this; setMultipageBackground(background: string): this; setMultipageBackgroundUrl(url: string): this; setLinearize(value: boolean): this; setEncrypt(value: boolean): this; setUserPassword(password: string): this; setOwnerPassword(password: string): this; setNoPrint(value: boolean): this; setNoModify(value: boolean): this; setNoCopy(value: boolean): this; setTitle(title: string): this; setSubject(subject: string): this; setAuthor(author: string): this; setKeywords(keywords: string): this; setUseMetadataFrom(index: number): this; addAttachment(attachment: string): this; setPageLayout(layout: string): this; setPageMode(mode: string): this; setInitialZoomType(zoomType: string): this; setInitialPage(page: number): this; setInitialZoom(zoom: number): this; setHideToolbar(value: boolean): this; setHideMenubar(value: boolean): this; setHideWindowUi(value: boolean): this; setFitWindow(value: boolean): this; setCenterWindow(value: boolean): this; setDisplayTitle(value: boolean): this; setRightToLeft(value: boolean): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getPageCount(): number; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setConverterVersion(version: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class ImageToPdfClient { constructor(userName: string, apiKey: string); convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertRawData(data: Buffer | string, callbacks?: undefined): Promise; convertRawData(data: Buffer | string, callbacks: Callbacks): void; convertRawDataToStream(data: Buffer | string): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback?: undefined): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setResize(resize: string): this; setRotate(rotate: string): this; setCropAreaX(x: string): this; setCropAreaY(y: string): this; setCropAreaWidth(width: string): this; setCropAreaHeight(height: string): this; setCropArea(x: string, y: string, width: string, height: string): this; setRemoveBorders(value: boolean): this; setPageSize(size: string): this; setPageWidth(width: string): this; setPageHeight(height: string): this; setPageDimensions(width: string, height: string): this; setOrientation(orientation: string): this; setPosition(position: string): this; setPrintPageMode(mode: string): this; setMarginTop(top: string): this; setMarginRight(right: string): this; setMarginBottom(bottom: string): this; setMarginLeft(left: string): this; setPageMargins(top: string, right: string, bottom: string, left: string): this; setPageBackgroundColor(color: string): this; setDpi(dpi: number): this; setPageWatermark(watermark: string): this; setPageWatermarkUrl(url: string): this; setMultipageWatermark(watermark: string): this; setMultipageWatermarkUrl(url: string): this; setPageBackground(background: string): this; setPageBackgroundUrl(url: string): this; setMultipageBackground(background: string): this; setMultipageBackgroundUrl(url: string): this; setLinearize(value: boolean): this; setEncrypt(value: boolean): this; setUserPassword(password: string): this; setOwnerPassword(password: string): this; setNoPrint(value: boolean): this; setNoModify(value: boolean): this; setNoCopy(value: boolean): this; setTitle(title: string): this; setSubject(subject: string): this; setAuthor(author: string): this; setKeywords(keywords: string): this; addAttachment(attachment: string): this; setPageLayout(layout: string): this; setPageMode(mode: string): this; setInitialZoomType(zoomType: string): this; setInitialPage(page: number): this; setInitialZoom(zoom: number): this; setHideToolbar(value: boolean): this; setHideMenubar(value: boolean): this; setHideWindowUi(value: boolean): this; setFitWindow(value: boolean): this; setCenterWindow(value: boolean): this; setDisplayTitle(value: boolean): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setConverterVersion(version: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class PdfToHtmlClient { constructor(userName: string, apiKey: string); convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertRawData(data: Buffer | string, callbacks?: undefined): Promise; convertRawData(data: Buffer | string, callbacks: Callbacks): void; convertRawDataToStream(data: Buffer | string): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback?: undefined): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setPdfPassword(password: string): this; setScaleFactor(factor: number): this; setPrintPageRange(pages: string): this; setDpi(dpi: number): this; setImageMode(mode: string): this; setImageFormat(imageFormat: string): this; setCssMode(mode: string): this; setFontMode(mode: string): this; setType3Mode(mode: string): this; setSplitLigatures(value: boolean): this; setCustomCss(css: string): this; setHtmlNamespace(prefix: string): this; isZippedOutput(): boolean; setForceZip(value: boolean): this; setTitle(title: string): this; setSubject(subject: string): this; setAuthor(author: string): this; setKeywords(keywords: string): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getPageCount(): number; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setConverterVersion(version: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class PdfToTextClient { constructor(userName: string, apiKey: string); convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertRawData(data: Buffer | string, callbacks?: undefined): Promise; convertRawData(data: Buffer | string, callbacks: Callbacks): void; convertRawDataToStream(data: Buffer | string): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback?: undefined): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setPdfPassword(password: string): this; setPrintPageRange(pages: string): this; setNoLayout(value: boolean): this; setEol(eol: string): this; setPageBreakMode(mode: string): this; setCustomPageBreak(pageBreak: string): this; setParagraphMode(mode: string): this; setLineSpacingThreshold(threshold: string): this; setRemoveHyphenation(value: boolean): this; setRemoveEmptyLines(value: boolean): this; setCropAreaX(x: number): this; setCropAreaY(y: number): this; setCropAreaWidth(width: number): this; setCropAreaHeight(height: number): this; setCropArea(x: number, y: number, width: number, height: number): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getPageCount(): number; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } class PdfToImageClient { constructor(userName: string, apiKey: string); convertUrl(url: string, callbacks?: undefined): Promise; convertUrl(url: string, callbacks: Callbacks): void; convertUrlToStream(url: string): Promise; convertUrlToFile(url: string, filePath: string, callback?: undefined): Promise; convertUrlToFile(url: string, filePath: string, callback: FileCallback): void; convertFile(file: string, callbacks?: undefined): Promise; convertFile(file: string, callbacks: Callbacks): void; convertFileToStream(file: string): Promise; convertFileToFile(file: string, filePath: string, callback?: undefined): Promise; convertFileToFile(file: string, filePath: string, callback: FileCallback): void; convertRawData(data: Buffer | string, callbacks?: undefined): Promise; convertRawData(data: Buffer | string, callbacks: Callbacks): void; convertRawDataToStream(data: Buffer | string): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback?: undefined): Promise; convertRawDataToFile(data: Buffer | string, filePath: string, callback: FileCallback): void; convertStream(inStream: Readable, callbacks?: undefined): Promise; convertStream(inStream: Readable, callbacks: Callbacks): void; convertStreamToStream(inStream: Readable): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback?: undefined): Promise; convertStreamToFile(inStream: Readable, filePath: string, callback: FileCallback): void; setOutputFormat(outputFormat: string): this; setPdfPassword(password: string): this; setPrintPageRange(pages: string): this; setDpi(dpi: number): this; isZippedOutput(): boolean; setForceZip(value: boolean): this; setUseCropbox(value: boolean): this; setCropAreaX(x: number): this; setCropAreaY(y: number): this; setCropAreaWidth(width: number): this; setCropAreaHeight(height: number): this; setCropArea(x: number, y: number, width: number, height: number): this; setUseGrayscale(value: boolean): this; setDebugLog(value: boolean): this; getDebugLogUrl(): string | null; getRemainingCreditCount(): number; getConsumedCreditCount(): number; getJobId(): string; getPageCount(): number; getOutputSize(): number; getVersion(): string; setTag(tag: string): this; setHttpProxy(proxy: string): this; setHttpsProxy(proxy: string): this; setUseHttp(value: boolean): this; setClientUserAgent(agent: string): this; setProxy(host: string, port: number, userName: string, password: string): this; setRetryCount(count: number): this; } } export = pdfcrowd;