Why PDF Services API?
Create, secure, and convert PDF documents
Create a PDF from Microsoft Office documents, protect the content, and convert to other formats.
Modify PDFs and optimize output
Programmatically alter a document, such as reordering, inserting, and rotating pages, as well as compressing the file.
Leverage Adobe's cloud-based services
Access the same cloud-based APIs that power Adobe's end user applications to quickly deliver scalable, secure solutions.
Key features of Adobe PDF Services API
PDF content extraction
Extract text, images, tables, and more from native and scanned PDFs into a structured JSON file. PDF Extract API leverages AI technology to accurately identify text objects and understand the natural reading order of different elements such as headings, lists, and paragraphs spanning multiple columns or pages. Extract font styles with identification of metadata such as bold and italic text and their position within your PDF. Extracted content is output in a structured JSON file format with tables in CSV or XLSX and images saved as PNG.
See our public API Reference and quickly try our APIs using the Postman collections
Copied to your clipboard1curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create' \2--header 'Accept: application/json, text/plain, /' \3--header 'Authorization: Bearer ' \4--header 'x-api-key: ' \5--form 'contentAnalyzerRequests={6 \"cpf:engine\": {7 \"repo:assetId\": \"urn:aaid:cpf:58af6e2c-1f0c-400d-9188-078000185695\"8 },9 \"cpf:inputs\": {10 \"documentIn\": {11 \"cpf:location\": \"fileInput1\",12 \"dc:format\": \"application/pdf\"13 },14 \"params\": {15 \"cpf:inline\": {16 \"elementsToExtract\": [17 \"text\", \"tables\"18 ],19 \"renditionsToExtract\": [ \"tables\", \"figures\"]20 }21 }22 },23 \"cpf:outputs\": {24 \"elementsInfo\": {25 \"cpf:location\": \"jsonoutput\",26 \"dc:format\": \"application/json\"27 },28 \"elementsRenditions\": {29 \"cpf:location\": \"fileoutpart\",30 \"dc:format\": \"text/directory\"31 }32 }33}' \34--form 'fileInput1=@""'
Copied to your clipboard1// Create an ExecutionContext using credentials2const executionContext = PDFServicesSdk.ExecutionContext.create(credentials);34// Create a new operation instance.5const extractPDFOperation = PDFServicesSdk.ExtractPDF.Operation.createNew(),6 input = PDFServicesSdk.FileRef.createFromLocalFile(7 'resources/extractPDFInput.pdf',8 PDFServicesSdk.ExtractPDF.SupportedSourceFormat.pdf9 );1011// Set operation input from a source file.12extractPDFOperation.setInput(input);1314// Build and set extractPDF options15const options = new PDFServicesSdk.ExtractPDF.options.ExtractPdfOptions.Builder()16 .addElementsToExtract(17 PDFServicesSdk.ExtractPDF.options.ExtractElementType.TEXT)18 .addElementsToExtractRenditions(19 PDFServicesSdk.ExtractPDF.options.ExtractRenditionsElementType.FIGURES)20 .addCharInfo(true)21 .build()22extractPDFOperation.setOptions(options);2324// Execute the operation and Save the result to the specified location.25extractPDFOperation.execute(executionContext)26 .then(result => result.saveAsFile('output/extractPdf.zip'))
Copied to your clipboard1//Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.Create(credentials);3ExtractPDFOperation extractPdfOperation = ExtractPDFOperation.CreateNew();45// Set operation input from a source file.6FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"extractPDFInput.pdf");7extractPdfOperation.SetInputFile(sourceFileRef);89// Build ExtractPDF options and set them into the operation10ExtractPDFOptions extractPdfOptions = ExtractPDFOptions.ExtractPDFOptionsBuilder()11 .AddElementsToExtract(new List<ExtractElementType>(new []{ExtractElementType.TEXT, ExtractElementType.TABLES}))12 .AddElementsToExtractRenditions(new List<ExtractRenditionsElementType> (new []{ExtractRenditionsElementType.TABLES, ExtractRenditionsElementType.FIGURES}))13 .AddCharsInfo(true)14 .Build();15extractPdfOperation.SetOptions(extractPdfOptions);1617// Execute the operation.18FileRef result = extractPdfOperation.Execute(executionContext);1920// Save the result to the specified location.21result.SaveAs(Directory.GetCurrentDirectory() + "/output/extractPdf.zip");
Copied to your clipboard1// Create an ExecutionContext using credentials and create a new operation instance2ExecutionContext executionContext = ExecutionContext.create(credentials);3ExtractPDFOperation extractPDFOperation = ExtractPDFOperation.createNew();45// Set operation input from a source file6FileRef source = FileRef.createFromLocalFile("src/test/resources/extractPdfInput.pdf");7extractPDFOperation.setInputFile(source);89// Build ExtractPDF options and set them into the operation10ExtractPDFOptions extractPDFOptions = ExtractPDFOptions.extractPdfOptionsBuilder()11 .addElementsToExtract(Arrays.asList(PDFElementType.TEXT, PDFElementType.TABLES))12 .addElementsToExtractRenditions(Arrays.asList(PDFElementType.TABLES, PDFElementType.FIGURES))13 .addCharInfo(Boolean.TRUE)14 .build();15extractPDFOperation.setOptions(extractPDFOptions);1617// Execute the operation18FileRef result = extractPDFOperation.execute(executionContext);1920// Save the result at the specified location21result.saveAs("output/extractPdf.zip");
Copied to your clipboard1#Create an ExecutionContext using credentials and create a new operation instance.2execution_context = ExecutionContext.create(credentials)3extract_pdf_operation = ExtractPDFOperation.create_new()45#Set operation input from a source file.6source = FileRef.create_from_local_file(base_path + "/resources/extractPdfInput.pdf")7extract_pdf_operation.set_input(source)89# Build ExtractPDF options and set them into the operation10extract_pdf_options: ExtractPDFOptions = ExtractPDFOptions.builder() \11 .with_elements_to_extract([PDFElementType.TEXT, PDFElementType.TABLES]) \12 .with_elements_to_extract_renditions([PDFElementType.TABLES, PDFElementType.FIGURES]) \13 .with_get_char_info(True) \14 .build()15extract_pdf_operation.set_options(extract_pdf_options)1617#Execute the operation.18result: FileRef = extract_pdf_operation.execute(execution_context)1920# Save the result to the specified location.21result.save_as(base_path + "/output/extractPdf.zip")
Create a PDF file
Create PDFs from a variety of formats, including static and dynamic HTML; Microsoft Word, PowerPoint, and Excel; as well as text, image, Zip, and URL. Support for HTML to PDF, DOC to PDF, DOCX to PDF, PPT to PDF, PPTX to PDF, XLS to PDF, XLSX to PDF, TXT to PDF, RTF to PDF, BMP to PDF, JPEG to PDF, GIF to PDF, TIFF to PDF, PNG to PDF
See our public API Reference and quickly try our APIs using the Postman collections
Copied to your clipboard1curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create?respondWith=%7B%22reltype%22%3A%20%22http%3A%2F%2Fns.adobe.com%2Frel%2Fprimary%22%7D' \2 --header 'Authorization: Bearer ' \3 --header 'Accept: application/json, text/plain, */*' \4 --header 'x-api-key: ' \5 --header 'Prefer: respond-async,wait=0' \6 --form 'contentAnalyzerRequests="{7 \"cpf:inputs\": {8 \"documentIn\": {9 \"cpf:location\": \"InputFile0\",10 \"dc:format\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"11 }12 },13 \"cpf:engine\": {14 \"repo:assetId\": \"urn:aaid:cpf:Service-1538ece812254acaac2a07799503a430\"15 },16 \"cpf:outputs\": {17 \"documentOut\": {18 \"cpf:location\": \"multipartLabelOut\",19 \"dc:format\": \"application/pdf\"20 }21 }22 }"' \23 --form 'InputFile0=@""'
Copied to your clipboard1// Create an ExecutionContext using credentials and create a new operation instance.2const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),3 createPdfOperation = PDFServicesSdk.CreatePDF.Operation.createNew();45// Set operation input from a source file.6const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/createPDFInput.docx');7createPdfOperation.setInput(input);89// Execute the operation and Save the result to the specified location.10createPdfOperation.execute(executionContext)11 .then(result => result.saveAsFile('output/createPDFFromDOCX.pdf'))12
Copied to your clipboard1//Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.Create(credentials);3CreatePDFOperation createPdfOperation = CreatePDFOperation.CreateNew();45// Set operation input from a source file.6FileRef source = FileRef.CreateFromLocalFile(@"createPdfInput.docx");7createPdfOperation.SetInput(source);89// Execute the operation.10FileRef result = createPdfOperation.Execute(executionContext);1112// Save the result to the specified location.13result.SaveAs(Directory.GetCurrentDirectory() + "/output/createPdfOutput.pdf");
Copied to your clipboard1//Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.create(credentials);3CreatePDFOperation createPdfOperation = CreatePDFOperation.createNew();45// Set operation input from a source file.6FileRef source = FileRef.createFromLocalFile("src/main/resources/createPDFInput.docx");7createPdfOperation.setInput(source);89// Execute the operation.10FileRef result = createPdfOperation.execute(executionContext);1112// Save the result to the specified location.13result.saveAs("output/createPDFFromDOCX.pdf");
Create a PDF file from HTML
Create PDFs from static and dynamic HTML, Zip, and URL.
See our public API Reference and quickly try our APIs using the Postman collections
Copied to your clipboard1curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create?respondWith=%7B%22reltype%22%3A%20%22http%3A%2F%2Fns.adobe.com%2Frel%2Fprimary%22%7D' \2 --header 'Authorization: Bearer ' \3 --header 'Accept: application/json, text/plain, */*' \4 --header 'x-api-key: ' \5 --header 'Prefer: respond-async,wait=0' \6 --form 'contentAnalyzerRequests="{7 \"cpf:inputs\": {8 \"documentIn\": {9 \"cpf:location\": \"InputFile0\",10 \"dc:format\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"11 }12 },13 \"cpf:engine\": {14 \"repo:assetId\": \"urn:aaid:cpf:Service-1538ece812254acaac2a07799503a430\"15 },16 \"cpf:outputs\": {17 \"documentOut\": {18 \"cpf:location\": \"multipartLabelOut\",19 \"dc:format\": \"application/pdf\"20 }21 }22 }"' \23 --form 'InputFile0=@""'
Copied to your clipboard1// Create an ExecutionContext using credentials and create a new operation instance2const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),3 createPDF = PDFServicesSdk.CreatePDF,4 htmlToPDFOperation = createPDF.Operation.createNew();56// Set operation input from a source URL.7const input = PDFServicesSdk.FileRef.createFromURL(8 "https://www.adobe.io"9);10htmlToPDFOperation.setInput(input);1112// Provide any custom configuration options for the operation.13setCustomOptions(htmlToPDFOperation);1415// Execute the operation and Save the result to the specified location.16htmlToPDFOperation.execute(executionContext)17 .then(result => result.saveAsFile('output/createPdfFromURLOutput.pdf'))
Copied to your clipboard1//Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.Create(credentials);3CreatePDFOperation htmlToPDFOperation = CreatePDFOperation.CreateNew();45// Set operation input from a source URL.6FileRef source = FileRef.CreateFromURI(new Uri("https://www.adobe.io"));7htmlToPDFOperation.SetInput(source);89// Provide any custom configuration options for the operation.10SetCustomOptions(htmlToPDFOperation);1112// Execute the operation.13FileRef result = htmlToPDFOperation.Execute(executionContext);1415// Save the result to the specified location.16result.SaveAs(Directory.GetCurrentDirectory() + "/output/createPdfFromURLOutput.pdf");
Copied to your clipboard1//Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.create(credentials);3CreatePDFOperation htmlToPDFOperation = CreatePDFOperation.createNew();45// Set operation input from a source file.6FileRef source = FileRef.createFromURL(new URL("https://www.adobe.io"));7htmlToPDFOperation.setInput(source);89// Provide any custom configuration options for the operation.10CreatePDFOptions htmlToPdfOptions = CreatePDFOptions.htmlOptionsBuilder()11 .includeHeaderFooter(true)12 .build();13htmlToPDFOperation.setOptions(htmlToPdfOptions);1415// Provide any custom configuration options for the operation.16setCustomOptions(htmlToPDFOperation);1718// Execute the operation.19FileRef result = htmlToPDFOperation.execute(executionContext);2021// Save the result to the specified location.22result.saveAs("output/createPDFFromURLOutput.pdf");
Copied to your clipboard1curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create?respondWith=%7B%22reltype%22%3A%20%22http%3A%2F%2Fns.adobe.com%2Frel%2Fprimary%22%7D' \2 --header 'Authorization: Bearer ' \3 --header 'Accept: application/json, text/plain, */*' \4 --header 'x-api-key: ' \5 --header 'Prefer: respond-async,wait=0' \6 --form 'contentAnalyzerRequests="{7 \"cpf:engine\":{8 \"repo:assetId\":\"urn:aaid:cpf:Service-52d5db6097ed436ebb96f13a4c7bf8fb\"9 },10 \"cpf:inputs\":{11 \"documentIn\":{12 \"cpf:location\":\"InputFile0\",13 \"dc:format\":\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"14 },15 \"params\":{16 \"cpf:inline\":{17 \"outputFormat\": \"pdf\",18 \"jsonDataForMerge\": {19 \"customerName\": \"Kane Miller\",20 \"customerVisits\": 100,21 \"itemsBought\": [22 {23 \"name\": \"Sprays\",24 \"quantity\": 50,25 \"amount\": 10026 },27 {28 \"name\": \"Chemicals\",29 \"quantity\": 100,30 \"amount\": 20031 }32 ],33 \"totalAmount\": 300,34 \"previousBalance\": 50,35 \"lastThreeBillings\": [100, 200, 300],36 \"photograph\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88h8AAu0B9XNPCQQAAAAASUVORK5CYII=\"37 }38 }39 }40 },41 \"cpf:outputs\":{42 \"documentOut\":{43 \"cpf:location\":\"OutputFile\",44 \"dc:format\":\"application/pdf\"45 }46 }47 }"' \48 --form 'InputFile0=@""'
Copied to your clipboard1// Setup input data for the document merge process2const jsonString = fs.readFileSync('resources/salesOrder.json'),3 jsonDataForMerge = JSON.parse(jsonString);45// Create an ExecutionContext using credentials6const executionContext = PDFToolsSdk.ExecutionContext.create(credentials);78// Create a new DocumentMerge options instance9const documentMerge = PDFToolsSdk.DocumentMerge,10 documentMergeOptions = documentMerge.options,11 options = new documentMergeOptions.DocumentMergeOptions(jsonDataForMerge, documentMergeOptions.OutputFormat.PDF);1213// Create a new operation instance using the options instance14const documentMergeOperation = documentMerge.Operation.createNew(options)1516// Set operation input document template from a source file.17const input = PDFToolsSdk.FileRef.createFromLocalFile('resources/salesOrderTemplate.docx');18documentMergeOperation.setInput(input);1920// Execute the operation and Save the result to the specified location.21documentMergeOperation.execute(executionContext)22 .then(result => result.saveAsFile('output/salesOrderOutput.pdf'))
Copied to your clipboard1// Create an ExecutionContext using credentials.2ExecutionContext executionContext = ExecutionContext.Create(credentials);34// Setup input data for the document merge process5var content = File.ReadAllText(@"salesOrder.json");6JObject jsonDataForMerge = JObject.Parse(content);78// Create a new DocumentMerge Options instance9DocumentMergeOptions documentMergeOptions = new DocumentMergeOptions(jsonDataForMerge, OutputFormat.PDF);1011// Create a new DocumentMerge Operation instance with the DocumentMerge Options instance12DocumentMergeOperation documentMergeOperation = DocumentMergeOperation.CreateNew(documentMergeOptions);1314// Set the operation input document template from a source file.15documentMergeOperation.SetInput(FileRef.CreateFromLocalFile(@"salesOrderTemplate.docx"));1617// Execute the operation.18FileRef result = documentMergeOperation.Execute(executionContext);1920// Save the result to the specified location21result.SaveAs(Directory.GetCurrentDirectory() + "/output/salesOrderOutput.pdf");
Copied to your clipboard1// Setup input data for the document merge process2String content = new String(Files.readAllBytes(Paths.get("src/main/resources/salesOrder.json")));3JSONObject jsonDataForMerge = new JSONObject(content);45// Create an ExecutionContext using credentials.6ExecutionContext executionContext = ExecutionContext.create(credentials);78//Create a new DocumentMergeOptions instance9DocumentMergeOptions documentMergeOptions = new DocumentMergeOptions(jsonDataForMerge, OutputFormat.PDF);1011// Create a new DocumentMergeOperation instance with the DocumentMergeOptions instance12DocumentMergeOperation documentMergeOperation = DocumentMergeOperation.createNew(documentMergeOptions);1314// Set the operation input document template from a source file.15FileRef documentTemplate = FileRef.createFromLocalFile("src/main/resources/salesOrderTemplate.docx");16documentMergeOperation.setInput(documentTemplate);1718// Execute the operation19FileRef result = documentMergeOperation.execute(executionContext);2021// Save the result to the specified location.22result.saveAs("output/salesOrderOutput.pdf");23
Convert a PDF file to other formats
Convert existing PDFs to popular formats, such as Microsoft Word, Excel, and PowerPoint, as well as text and image
Support for PDF to DOC, PDF to DOCX, PDF to JPEG, PDF to PNG, PDF to PPTX, PDF to RTF, PDF to XLSX
See our public API Reference and quickly try our APIs using the Postman collections
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://documentcloud.adobe.com/document-services/index.html#post-exportPDF34curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create?respondWith=%7B%22reltype%22%3A%20%22http%3A%2F%2Fns.adobe.com%2Frel%2Fprimary%22%7D' \5--header 'Authorization: Bearer {{Placeholder for token}}' \6--header 'Accept: application/json, text/plain, */*' \7--header 'x-api-key: {{Placeholder for client_id}}' \8--header 'Prefer: respond-async,wait=0' \9--form 'contentAnalyzerRequests="{10 \"cpf:inputs\": {11 \"params\": {12 \"cpf:inline\": {13 \"targetFormat\": \"docx\"14 }15 },16 \"documentIn\": {17 \"cpf:location\": \"InputFile0\",18 \"dc:format\": \"application/pdf\"19 }20 },21 \"cpf:engine\": {22 \"repo:assetId\": \"urn:aaid:cpf:Service-26c7fda2890b44ad9a82714682e35888\"23 },24 \"cpf:outputs\": {25 \"documentOut\": {26 \"cpf:location\": \"multipartLabelOut\",27 \"dc:format\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"28 }29 }30}"' \31--form 'InputFile0=@"{{Placeholder for input file (absolute path)}}"'
Copied to your clipboard1// Create an ExecutionContext using2// credentials and create a new3// operation instance.4const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),5exportPDF = PDFServicesSdk.ExportPDF,6exportPdfOperation = exportPDF.Operation.createNew(exportPDF.SupportedTargetFormats.DOCX);78// Set operation input from a source file9const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/exportPDFInput.pdf');10exportPdfOperation.setInput(input);1112// Execute the operation and Save the result to the specified location.13exportPdfOperation.execute(executionContext)14.then(result => result.saveAsFile('output/exportPdfOutput.docx'))
Copied to your clipboard1// Create an ExecutionContext using2// credentials and create a new3// operation instance.4ExecutionContext executionContext = ExecutionContext.Create(credentials);5ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew( ExportPDFTargetFormat.DOCX );67// Set operation input from a local PDF file8FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"exportPdfInput.pdf");9exportPdfOperation.SetInput(sourceFileRef);1011// Execute the operation.12FileRef result = exportPdfOperation.Execute(executionContext);1314// Save the result to the specified location.15result.SaveAs(Directory.GetCurrentDirectory()16 + "/output/exportPdfOutput.docx");
Copied to your clipboard1// Create an ExecutionContext using2// credentials and create a new3// operation instance.4ExecutionContext executionContext = ExecutionContext.create(credentials);5ExportPDFOperation exportPdfOperation = ExportPDFOperation6 .createNew(ExportPDFTargetFormat.DOCX);78// Set operation input from a local PDF file9FileRef sourceFileRef = FileRef10 .createFromLocalFile(11 "src/main/resources/exportPDFInput.pdf"12 );13exportPdfOperation.setInput(sourceFileRef);1415// Execute the operation.16FileRef result = exportPdfOperation.execute(executionContext);1718// Save the result to the specified location.19result.saveAs("output/exportPdfOutput.docx");
OCR a PDF file
Use built-in optical character recognition (OCR) to convert images to text and enable fully text searchable documents for archiving and creation of searchable indexes.
See our public API Reference and quickly try our APIs using the Postman collections
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://documentcloud.adobe.com/document-services/index.html#post-ocr34curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create?respondWith=%7B%22reltype%22%3A%20%22http%3A%2F%2Fns.adobe.com%2Frel%2Fprimary%22%7D' \5--header 'Authorization: Bearer {{Placeholder for token}}' \6--header 'Accept: application/json, text/plain, */*' \7--header 'x-api-key: {{Placeholder for client_id}}' \8--header 'Prefer: respond-async,wait=0' \9--form 'contentAnalyzerRequests="{10 \"cpf:inputs\": {11 \"documentIn\": {12 \"cpf:location\": \"InputFile0\",13 \"dc:format\": \"application/pdf\"14 }15 },16 \"cpf:engine\": {17 \"repo:assetId\": \"urn:aaid:cpf:Service-7e6a5d2b6bb141d7832398076914a07b\"18 },19 \"cpf:outputs\": {20 \"documentOut\": {21 \"cpf:location\": \"multipartLabelOut\",22 \"dc:format\": \"application/pdf\"23 }24 }25}"' \26--form 'InputFile0=@"{{Placeholder for input file (absolute path)}}"'
Copied to your clipboard1// Create an ExecutionContext using credentials and create a new operation instance.2const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),3 ocrOperation = PDFServicesSdk.OCR.Operation.createNew();45// Set operation input from a source file.6const input = PDFServicesSdk.FileRef.createFromLocalFile( 'resources/ocrInput.pdf', PDFServicesSdk.OCR.SupportedMediaTypes.pdf );7ocrOperation.setInput(input);89// Execute the operation and Save the result to the specified location.10ocrOperation.execute(executionContext)11 .then(result => result.saveAsFile('output/ocrOutput.pdf'));
Copied to your clipboard1// Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.Create(credentials);3OCROperation ocrOperation = OCROperation.CreateNew();45// Set operation input from a source file.6FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"ocrInput.pdf");7ocrOperation.SetInput(sourceFileRef);89// Execute the operation.10FileRef result = ocrOperation.Execute(executionContext);1112// Save the result to the specified location.13result.SaveAs(Directory.GetCurrentDirectory() + "/output/ocrOperationOutput.pdf");
Copied to your clipboard1// Create an ExecutionContext using credentials and create a new operation instance.2ExecutionContext executionContext = ExecutionContext.create(credentials);3OCROperation ocrOperation = OCROperation.createNew();45// Set operation input from a source file.6FileRef source = FileRef.createFromLocalFile( "src/main/resources/ocrInput.pdf" );7ocrOperation.setInput(source);89// Execute the operation10FileRef result = ocrOperation.execute(executionContext);1112// Save the result at the specified location13result.saveAs("output/ocrOutput.pdf");
Secure a PDf file and set restrictions
Secure a PDF file with a password encrypt the document. Set an owner password and restrictions on certain features like printing, editing and copying in the PDF document to prevent end users from modifying it.
Support for AES-128 and AES-256 encryption on PDF files, with granular permissions for high and low quality printing and fill and sign form field restrictions.
See our public API Reference and quickly try our APIs using the Postman collections
Copied to your clipboard1// Please refer our Rest API docs for more information2// https://documentcloud.adobe.com/document-services/index.html#post-protectPDF34curl --location --request POST 'https://cpf-ue1.adobe.io/ops/:create?respondWith=%7B%22reltype%22%3A%20%22http%3A%2F%2Fns.adobe.com%2Frel%2Fprimary%22%7D' \5--header 'Authorization: Bearer {{Placeholder for token}}' \6--header 'Accept: application/json, text/plain, */*' \7--header 'x-api-key: {{Placeholder for client_id}}' \8--header 'Prefer: respond-async,wait=0' \9--form 'contentAnalyzerRequests="{10 \"cpf:inputs\": {11 \"params\": {12 \"cpf:inline\": {13 \"passwordProtection\": {14