Export PDF
Export a source PDF file into doc, docx, jpeg, png, pptx, rtf, xlsx.
Rest API
See our public API Reference for :
Export a PDF
The sample below converts a PDF file into a number of supported formats such as:
- Microsoft Office file formats
- Text files
Please refer the API usage guide to understand how to use our APIs.
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_java_samples2// Run the sample:3// mvn -f pom.xml exec:java -Dexec.mainClass=com.adobe.pdfservices.operation.samples.exportpdf.ExportPDFToDOCX45public class ExportPDFToDOCX {67 // Initialize the logger.8 private static final Logger LOGGER = LoggerFactory.getLogger(ExportPDFToDOCX.class);910 public static void main(String[] args) {1112 try {13 // Initial setup, create credentials instance.14 Credentials credentials = Credentials.servicePrincipalCredentialsBuilder()15 .withClientId("PDF_SERVICES_CLIENT_ID")16 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")17 .build();18 //Create an ExecutionContext using credentials and create a new operation instance.19 ExecutionContext executionContext = ExecutionContext.create(credentials);20 ExportPDFOperation exportPdfOperation = ExportPDFOperation.createNew(ExportPDFTargetFormat.DOCX);2122 // Set operation input from a local PDF file23 FileRef sourceFileRef = FileRef.createFromLocalFile("src/main/resources/exportPDFInput.pdf");24 exportPdfOperation.setInput(sourceFileRef);2526 // Execute the operation.27 FileRef result = exportPdfOperation.execute(executionContext);2829 // Save the result to the specified location.30 result.saveAs("output/exportPdfOutput.docx");3132 } catch (ServiceApiException | IOException | SdkException | ServiceUsageException ex) {33 LOGGER.error("Exception encountered while executing operation", ex);34 }35 }36 }37
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples2// Run the sample:3// cd ExportPDFToDocx/4// dotnet run ExportPDFToDocx.csproj56 namespace ExportPDFToDocx7 {8 class Program9 {10 private static readonly ILog log = LogManager.GetLogger(typeof(Program));11 static void Main()12 {13 //Configure the logging14 ConfigureLogging();15 try16 {17 // Initial setup, create credentials instance.18 Credentials credentials = Credentials.ServicePrincipalCredentialsBuilder()19 .WithClientId("PDF_SERVICES_CLIENT_ID")20 .WithClientSecret("PDF_SERVICES_CLIENT_SECRET")21 .Build();2223 //Create an ExecutionContext using credentials and create a new operation instance.24 ExecutionContext executionContext = ExecutionContext.Create(credentials);25 ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.DOCX);2627 // Set operation input from a local PDF file28 FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"exportPdfInput.pdf");29 exportPdfOperation.SetInput(sourceFileRef);3031 // Execute the operation.32 FileRef result = exportPdfOperation.Execute(executionContext);3334 // Save the result to the specified location.35 result.SaveAs(Directory.GetCurrentDirectory() + "/output/exportPdfOutput.docx");36 }37 catch (ServiceUsageException ex)38 {39 log.Error("Exception encountered while executing operation", ex);40 }41 // Catch more errors here. . .42 }4344 static void ConfigureLogging()45 {46 ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());47 XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));48 }49 }50 }
Copied to your clipboard1// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample2// Run the sample:3// node src/exportpdf/export-pdf-to-docx.js45const PDFServicesSdk = require('@adobe/pdfservices-node-sdk');67 try {8 // Initial setup, create credentials instance.9 const credentials = PDFServicesSdk.Credentials10 .servicePrincipalCredentialsBuilder()11 .withClientId("PDF_SERVICES_CLIENT_ID")12 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")13 .build();1415 //Create an ExecutionContext using credentials and create a new operation instance.16 const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),17 exportPDF = PDFServicesSdk.ExportPDF,18 exportPdfOperation = exportPDF.Operation.createNew(exportPDF.SupportedTargetFormats.DOCX);1920 // Set operation input from a source file21 const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/exportPDFInput.pdf');22 exportPdfOperation.setInput(input);2324 // Execute the operation and Save the result to the specified location.25 exportPdfOperation.execute(executionContext)26 .then(result => result.saveAsFile('output/exportPdfOutput.docx'))27 .catch(err => {28 if(err instanceof PDFServicesSdk.Error.ServiceApiError29 || err instanceof PDFServicesSdk.Error.ServiceUsageError) {30 console.log('Exception encountered while executing operation', err);31 } else {32 console.log('Exception encountered while executing operation', err);33 }34 });35 } catch (err) {36 console.log('Exception encountered while executing operation', err);37 }
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://developer.adobe.com/document-services/docs/apis/#tag/Export-PDF34curl --location --request POST 'https://pdf-services.adobe.io/operation/exportpdf' \5--header 'x-api-key: {{Placeholder for client_id}}' \6--header 'Content-Type: application/json' \7--header 'Authorization: Bearer {{Placeholder for token}}' \8--data-raw '{9 "assetID": "urn:aaid:AS:UE1:23c30ee0-2e4d-46d6-87f2-087832fca718",10 "targetFormat": "docx"11}'1213// Legacy API can be found here14// https://documentcloud.adobe.com/document-services/index.html#post-exportPDF
Export a PDF file to a DOCX file (apply OCR on the PDF file)
The sample below converts a PDF file into a number of supported formats such as:
- Microsoft Office file formats
- Text files
OCR processing is also performed on the input PDF file to extract text from images in the document.
Please refer the API usage guide to understand how to use our APIs.
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_java_samples2// Run the sample:3// mvn -f pom.xml exec:java -Dexec.mainClass=com.adobe.pdfservices.operation.samples.exportpdf.ExportPDFToDOCXWithOCROption45public class ExportPDFToDOCXWithOCROption {67 // Initialize the logger.8 private static final Logger LOGGER = LoggerFactory.getLogger(ExportPDFToDOCXWithOCROption.class);910 public static void main(String[] args) {1112 try {1314 // Initial setup, create credentials instance.15 Credentials credentials = Credentials.servicePrincipalCredentialsBuilder()16 .withClientId("PDF_SERVICES_CLIENT_ID")17 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")18 .build();19 //Create an ExecutionContext using credentials and create a new operation instance.20 ExecutionContext executionContext = ExecutionContext.create(credentials);21 ExportPDFOperation exportPDFOperation = ExportPDFOperation.createNew(ExportPDFTargetFormat.DOCX);2223 // Set operation input from a source file.24 FileRef sourceFileRef = FileRef.createFromLocalFile("src/main/resources/exportPDFInput.pdf");25 exportPDFOperation.setInput(sourceFileRef);2627 // Create a new ExportPDFOptions instance from the specified OCR locale and set it into the operation.28 ExportPDFOptions exportPDFOptions = new ExportPDFOptions(ExportOCRLocale.EN_US);29 exportPDFOperation.setOptions(exportPDFOptions);3031 // Create a new ExportPDFOptions instance from the specified OCR locale and set it into the operation.32 ExportPDFOptions exportPDFOptions = new ExportPDFOptions(ExportOCRLocale.EN_US);33 exportPDFOperation.setOptions(exportPDFOptions);3435 // Execute the operation.36 FileRef result = exportPDFOperation.execute(executionContext);3738 // Save the result to the specified location.39 result.saveAs("output/exportPDFWithOCROptionsOutput.docx");4041 } catch (ServiceApiException | IOException | SdkException | ServiceUsageException ex) {42 LOGGER.error("Exception encountered while executing operation", ex);43 }44 }45}
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples2// Run the sample:3// cd ExportPDFToDocx/4// dotnet run ExportPDFToDocxWithOCROption.csproj56 namespace ExportPDFToDocxWithOCROption7 {8 class Program9 {10 private static readonly ILog log = LogManager.GetLogger(typeof(Program));11 static void Main()12 {13 //Configure the logging14 ConfigureLogging();15 try16 {17 // Initial setup, create credentials instance.18 Credentials credentials = Credentials.ServicePrincipalCredentialsBuilder()19 .WithClientId("PDF_SERVICES_CLIENT_ID")20 .WithClientSecret("PDF_SERVICES_CLIENT_SECRET")21 .Build();2223 //Create an ExecutionContext using credentials and create a new operation instance.24 ExecutionContext executionContext = ExecutionContext.Create(credentials);25 ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.DOCX);2627 // Set operation input from a local PDF file28 FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"exportPdfInput.pdf");29 exportPdfOperation.SetInput(sourceFileRef);3031 // Create a new ExportPDFOptions instance from the specified OCR locale and set it into the operation.32 ExportPDFOptions exportPdfOptions = new ExportPDFOptions(ExportOCRLocale.EN_US);33 exportPdfOperation.SetOptions(exportPdfOptions);3435 // Execute the operation.36 FileRef result = exportPdfOperation.Execute(executionContext);3738 // Save the result to the specified location.39 result.SaveAs(Directory.GetCurrentDirectory() + "/output/ExportPDFToDOCXWithOCROption.docx");40 }41 catch (ServiceUsageException ex)42 {43 log.Error("Exception encountered while executing operation", ex);44 }45 // Catch more errors here. . .46 }4748 static void ConfigureLogging()49 {50 ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());51 XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));52 }53 }54 }
Copied to your clipboard1// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample2// Run the sample:3// node src/exportpdf/export-docx-to-pdf-with-ocr-options.js45const PDFServicesSdk = require('@adobe/pdfservices-node-sdk');67 try {8 // Initial setup, create credentials instance.9 const credentials = PDFServicesSdk.Credentials10 .servicePrincipalCredentialsBuilder()11 .withClientId("PDF_SERVICES_CLIENT_ID")12 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")13 .build();1415 //Create an ExecutionContext using credentials and create a new operation instance.16 const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),17 exportPDF = PDFServicesSdk.ExportPDF,18 exportPdfOperation = exportPDF.Operation.createNew(exportPDF.SupportedTargetFormats.DOCX);1920 // Set operation input from a source file21 const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/exportPDFInput.pdf');22 exportPdfOperation.setInput(input);2324 // Create a new ExportPDFOptions instance from the specified OCR locale and set it into the operation.25 const options = new exportPDF.options.ExportPDFOptions(exportPDF.options.ExportPDFOptions.OCRSupportedLocale.EN_US);26 exportPdfOperation.setOptions(options);2728 // Execute the operation and Save the result to the specified location.29 exportPdfOperation.execute(executionContext)30 .then(result => result.saveAsFile('output/exportPdfWithOCROptionsOutput.docx'))31 .catch(err => {32 if(err instanceof PDFServicesSdk.Error.ServiceApiError33 || err instanceof PDFServicesSdk.Error.ServiceUsageError) {34 console.log('Exception encountered while executing operation', err);35 } else {36 console.log('Exception encountered while executing operation', err);37 }38 });39 } catch (err) {40 console.log('Exception encountered while executing operation', err);41 }
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://developer.adobe.com/document-services/docs/apis/#tag/Export-PDF34curl --location --request POST 'https://pdf-services.adobe.io/operation/exportpdf' \5--header 'x-api-key: {{Placeholder for client_id}}' \6--header 'Content-Type: application/json' \7--header 'Authorization: Bearer {{Placeholder for token}}' \8--data-raw '{9 "assetID": "urn:aaid:AS:UE1:23c30ee0-2e4d-46d6-87f2-087832fca718",10 "targetFormat": "docx",11 "ocrLang": "en-US"12}'1314// Legacy API can be found here15// https://documentcloud.adobe.com/document-services/index.html#post-exportPDF
Export a PDF to images
The sample below converts a PDF file's pages to a list of JPEG images. Each image file name ends with "_\<unpadded_page_index_number>". For example, a PDF file with 15 pages will generate 15 image files. The first file's name ends with "_1" and the last file's name ends with "_15".
Please refer the API usage guide to understand how to use our APIs.
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_java_samples2// Run the sample:3// mvn -f pom.xml exec:java -Dexec.mainClass=com.adobe.pdfservices.operation.samples.exportpdftoimages.ExportPDFToJPEG45 public class ExportPDFToJPEG {67 // Initialize the logger.8 private static final Logger LOGGER = LoggerFactory.getLogger(ExportPDFToJPEG.class);910 public static void main(String[] args) {11 try {1213 // Initial setup, create credentials instance.14 Credentials credentials = Credentials.servicePrincipalCredentialsBuilder()15 .withClientId("PDF_SERVICES_CLIENT_ID")16 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")17 .build();1819 // Create an ExecutionContext using credentials and create a new operation instance.20 ExecutionContext executionContext = ExecutionContext.create(credentials);21 ExportPDFOperation exportPdfOperation = ExportPDFOperation.createNew(ExportPDFTargetFormat.JPEG);2223 // Set operation input from a source file.24 FileRef sourceFileRef = FileRef.createFromLocalFile("src/main/resources/exportPDFToImageInput.pdf");25 exportPdfOperation.setInput(sourceFileRef);2627 // Execute the operation.28 List<FileRef> results = exportPDFToImagesOperation.execute(executionContext);2930 // Save the result to the specified location.31 int index = 0;32 for(FileRef result : results) {33 result.saveAs("output/exportPDFToImagesOutput_" + index + ".jpeg");34 index++;35 }3637 } catch (ServiceApiException | IOException | SdkException | ServiceUsageException ex) {38 LOGGER.error("Exception encountered while executing operation", ex);39 }40 }41 }42
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples2// Run the sample:3// cd ExportPDFToJPEG/4// dotnet run ExportPDFToJPEG.csproj56 namespace ExportPDFToJPEG7 {8 class Program9 {10 private static readonly ILog log = LogManager.GetLogger(typeof(Program));11 static void Main()12 {13 //Configure the logging14 ConfigureLogging();15 try16 {17 // Initial setup, create credentials instance.18 Credentials credentials = Credentials.ServicePrincipalCredentialsBuilder()19 .WithClientId("PDF_SERVICES_CLIENT_ID")20 .WithClientSecret("PDF_SERVICES_CLIENT_SECRET")21 .Build();2223 //Create an ExecutionContext using credentials and create a new operation instance.24 ExecutionContext executionContext = ExecutionContext.Create(credentials);25 ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.JPEG);2627 // Set operation input from a source file.28 FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"exportPdfToImageInput.pdf");29 exportPdfOperation.SetInput(sourceFileRef);3031 // Execute the operation.32 List<FileRef> result = exportPDFToImagesOperation.Execute(executionContext);3334 // Save the result to the specified location.35 int index = 0;36 foreach (FileRef fileRef in result)37 {38 fileRef.SaveAs(Directory.GetCurrentDirectory() + "/output/exportPDFToImagesOutput_" + index + ".jpeg");39 index++;40 }41 }4243 catch (ServiceUsageException ex)44 {45 log.Error("Exception encountered while executing operation", ex);46 }47 // Catch more errors here. . .48 }4950 static void ConfigureLogging()51 {52 ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());53 XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));54 }55 }56 }
Copied to your clipboard1// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample2// Run the sample:3// node src/exportpdftoimages/export-pdf-to-jpeg.js45 const PDFServicesSdk = require('@adobe/pdfservices-node-sdk');6 try {7 // Initial setup, create credentials instance.8 const credentials = PDFServicesSdk.Credentials9 .servicePrincipalCredentialsBuilder()10 .withClientId("PDF_SERVICES_CLIENT_ID")11 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")12 .build();1314 // Create an ExecutionContext using credentials and create a new operation instance.15 const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),16 exportPDFToImages = PDFServicesSdk.ExportPDFToImages,17 exportPDFToImagesOperation = exportPDFToImages.Operation.createNew(exportPDFToImages.SupportedTargetFormats.JPEG);1819 // Set operation input from a source file.20 const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/exportPDFToImageInput.pdf');21 exportPDFToImagesOperation.setInput(input);2223 // Execute the operation and Save the result to the specified location.24 exportPDFToImagesOperation.execute(executionContext)25 .then(result => {26 let saveFilesPromises = [];27 for(let i = 0; i < result.length; i++){28 saveFilesPromises.push(result[i].saveAsFile(`output/exportPDFToImagesOutput_${i}.jpeg`));29 }30 return Promise.all(saveFilesPromises);31 })32 .catch(err => {33 if(err instanceof PDFServicesSdk.Error.ServiceApiError34 || err instanceof PDFServicesSdk.Error.ServiceUsageError) {35 console.log('Exception encountered while executing operation', err);36 } else {37 console.log('Exception encountered while executing operation', err);38 }39 });40} catch (err) {41 console.log('Exception encountered while executing operation', err);42}43
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://developer.adobe.com/document-services/docs/apis/#tag/PDF-To-Images34curl --location --request POST 'https://pdf-services.adobe.io/operation/pdftoimages' \5--header 'x-api-key: {{Placeholder for client_id}}' \6--header 'Content-Type: application/json' \7--header 'Authorization: Bearer {{Placeholder for token}}' \8--data-raw '{9 "assetID": "urn:aaid:AS:UE1:23c30ee0-2e4d-46d6-87f2-087832fca718",10 "targetFormat": "jpeg",11 "outputType": "listOfPageImages"12}'1314// Legacy API can be found here15// https://documentcloud.adobe.com/document-services/index.html#post-exportPDF
Export a PDF to zip of page images
The sample below converts a PDF file to one or more jpeg or png images. The resulting file is a ZIP archive containing one image per page of the source PDF file.
Please refer the API usage guide to understand how to use our APIs.
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_java_samples2// Run the sample:3// mvn -f pom.xml exec:java -Dexec.mainClass=com.adobe.pdfservices.operation.samples.exportpdftoimages.ExportPDFToJPEGZip45 public class ExportPDFToJPEGZip {67 // Initialize the logger.8 private static final Logger LOGGER = LoggerFactory.getLogger(ExportPDFToJPEGZip.class);910 public static void main(String[] args) {11 try {1213 // Initial setup, create credentials instance.14 Credentials credentials = Credentials.servicePrincipalCredentialsBuilder()15 .withClientId("PDF_SERVICES_CLIENT_ID")16 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")17 .build();1819 //Create an ExecutionContext using credentials and create a new operation instance.20 ExecutionContext executionContext = ExecutionContext.create(credentials);21 ExportPDFToImagesOperation exportPDFToImagesOperation = ExportPDFToImagesOperation.createNew(ExportPDFToImagesTargetFormat.JPEG);2223 // Set operation input from a source file.24 FileRef sourceFileRef = FileRef.createFromLocalFile("src/main/resources/exportPDFToImageInput.pdf");25 exportPDFToImagesOperation.setInput(sourceFileRef);2627 // Set the output type to create zip of images.28 exportPDFToImagesOperation.setOutputType(OutputType.ZIP_OF_PAGE_IMAGES);2930 // Execute the operation.31 List<FileRef> results = exportPDFToImagesOperation.execute(executionContext);3233 // Save the result to the specified location.34 results.get(0).saveAs("output/exportPDFToJPEGOutput.zip");35 } catch (ServiceApiException | IOException | SdkException | ServiceUsageException ex) {36 LOGGER.error("Exception encountered while executing operation", ex);37 }38 }39 }
Copied to your clipboard1// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples2// Run the sample:3// cd ExportPDFToJPEGZip/4// dotnet run ExportPDFToJPEGZip.csproj56namespace7{8 class Program ExportPDFToJPEGZip9 {10 private static readonly ILog log = LogManager.GetLogger(typeof(Program));11 static void Main()12 {13 //Configure the logging14 ConfigureLogging();15 try16 {17 // Initial setup, create credentials instance.18 Credentials credentials = Credentials.ServicePrincipalCredentialsBuilder()19 .WithClientId("PDF_SERVICES_CLIENT_ID")20 .WithClientSecret("PDF_SERVICES_CLIENT_SECRET")21 .Build();2223 //Create an ExecutionContext using credentials and create a new operation instance.24 ExecutionContext executionContext = ExecutionContext.Create(credentials);25 ExportPDFToImagesOperation exportPDFToImagesOperation = ExportPDFToImagesOperation.CreateNew(ExportPDFToImagesTargetFormat.JPEG);2627 // Set operation input from a source file.28 FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"exportPDFToImagesInput.pdf");29 exportPDFToImagesOperation.SetInput(sourceFileRef);3031 // Set the output type to create zip of images.32 exportPDFToImagesOperation.SetOutputType(ExportPDFToImagesOutputType.ZIP_OF_IMAGES);3334 // Execute the operation.35 List<FileRef> result = exportPDFToImagesOperation.Execute(executionContext);3637 // Save the result to the specified location.38 results[0].SaveAs(Directory.GetCurrentDirectory() + "/output/exportPDFToJPEGOutput.zip");39 }40 catch (ServiceUsageException ex)41 {42 log.Error("Exception encountered while executing operation", ex);43 }44 // Catch more errors here. . .45 }4647 static void ConfigureLogging()48 {49 ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());50 XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));51 }52 }53}
Copied to your clipboard1// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample2// Run the sample:3// node src/exportpdftoimages/export-pdf-to-jpeg-zip.js45const PDFServicesSdk = require('@adobe/pdfservices-node-sdk');67try {8 // Initial setup, create credentials instance.9 const credentials = PDFServicesSdk.Credentials10 .servicePrincipalCredentialsBuilder()11 .withClientId("PDF_SERVICES_CLIENT_ID")12 .withClientSecret("PDF_SERVICES_CLIENT_SECRET")13 .build();1415 //Create an ExecutionContext using credentials and create a new operation instance.16 const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),17 exportPDF = PDFServicesSdk.ExportPDF,18 exportPdfToImagesOperation = exportPDFToImages.Operation.createNew(exportPDFToImages.SupportedTargetFormats.JPEG);1920 // Set the output type to create zip of images.21 exportPDFToImagesOperation.setOutputType(exportPDFToImages.OutputType.ZIP_OF_PAGE_IMAGES);2223 // Set operation input from a source file24 const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/exportPDFToImageInput.pdf');25 exportPdfToImagesOperation.setInput(input);2627 // Execute the operation and Save the result to the specified location.28 exportPdfToImagesOperation.execute(executionContext)29 .then(result => result[0].saveAsFile('output/exportPDFToJPEG.zip'))30 .catch(err => {31 if(err instanceof PDFServicesSdk.Error.ServiceApiError32 || err instanceof PDFServicesSdk.Error.ServiceUsageError) {33 console.log('Exception encountered while executing operation', err);34 } else {35 console.log('Exception encountered while executing operation', err);36 }37 });38} catch (err) {39 console.log('Exception encountered while executing operation', err);40}
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://developer.adobe.com/document-services/docs/apis/#tag/PDF-To-Images34curl --location --request POST 'https://pdf-services.adobe.io/operation/pdftoimages' \5--header 'x-api-key: {{Placeholder for client_id}}' \6--header 'Content-Type: application/json' \7--header 'Authorization: Bearer {{Placeholder for token}}' \8--data-raw '{9 "assetID": "urn:aaid:AS:UE1:23c30ee0-2e4d-46d6-87f2-087832fca718",10 "targetFormat": "jpeg",11 "outputType": "zipOfPageImages"12}'1314// Legacy API can be found here15// https://documentcloud.adobe.com/document-services/index.html#post-exportPDF