Use our PDF Tools API for creating, combining,
exporting PDFs and more
REST API with SDKs for popular languages such as Node.js, Java, and .NET Contact Us
Contact UsCreate, secure, and export PDF documents
Create a PDF from Microsoft Office documents, protect the content, and export 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

AWS Marketplace Partnership

Microsoft Power Automate Integration
Key Features of Adobe PDF Tools API
-
Create
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, and, Zip
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Export
Export
Convert existing PDFs to popular formats, such as Microsoft Word, Excel, and PowerPoint, as well as text and image
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
OCR
OCR
Use built-in optical character recognition (OCR) to convert images to text and enable document searching
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Protect
Protect
Protect a PDF file with password(s) for encrypting the PDF document and setting the restriction on certain features like printing, editing and copying in the PDF document.
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Remove Password
Remove Password
Remove password security from a PDF document. This can only be accomplished using the owner password of the document which must be passed in the operation.
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Split
Split
Split a PDF document into multiple smaller documents by simply specifying either the number of files, pages per file, or page ranges.
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Combine
Combine
Combine two or more documents into a single PDF
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Compress
Compress
Reduce the size of PDFs while determining the quality of images and graphics
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Reorder
Reorder
Reorder the pages of an existing document
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Linearize
Linearize
Optimize PDFs for quick viewing on the web, especially for mobile clients
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Insert
Insert
Insert one or more pages into an existing document
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Replace
Replace
Replace one or more pages with another page
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Delete
Delete
Delete one or more pages from a document
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation -
Rotate
Rotate
Rotate a page in an existing document
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation
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, and, Zip
See our public API Reference and quickly try our APIs using the Postman collections
See Documentation
curl --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' \
--header 'Authorization: Bearer ' \
--header 'Accept: application/json, text/plain, */*' \
--header 'x-api-key: ' \
--header 'Prefer: respond-async,wait=0' \
--form 'contentAnalyzerRequests="{
\"cpf:inputs\": {
\"documentIn\": {
\"cpf:location\": \"InputFile0\",
\"dc:format\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"
}
},
\"cpf:engine\": {
\"repo:assetId\": \"urn:aaid:cpf:Service-1538ece812254acaac2a07799503a430\"
},
\"cpf:outputs\": {
\"documentOut\": {
\"cpf:location\": \"multipartLabelOut\",
\"dc:format\": \"application/pdf\"
}
}
}"' \
--form 'InputFile0=@""'
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
createPdfOperation = PDFToolsSdk.CreatePDF.Operation.createNew();
// Set operation input from a source file.
const input = PDFToolsSdk.FileRef.createFromLocalFile('resources/createPDFInput.docx');
createPdfOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
createPdfOperation.execute(executionContext)
.then(result => result.saveAsFile('output/createPDFFromDOCX.pdf'))
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
CreatePDFOperation createPdfOperation = CreatePDFOperation.CreateNew();
// Set operation input from a source file.
FileRef source = FileRef.CreateFromLocalFile(@"createPdfInput.docx");
createPdfOperation.SetInput(source);
// Execute the operation.
FileRef result = createPdfOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() + "/output/createPdfOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
CreatePDFOperation createPdfOperation = CreatePDFOperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile("src/main/resources/createPDFInput.docx");
createPdfOperation.setInput(source);
// Execute the operation.
FileRef result = createPdfOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/createPDFFromDOCX.pdf");
// Create an ExecutionContext using
// credentials and create a new
// operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
exportPDF = PDFToolsSdk.ExportPDF,
exportPdfOperation = exportPDF.Operation.createNew(exportPDF.SupportedTargetFormats.DOCX);
// Set operation input from a source file
const input = PDFToolsSdk.FileRef.createFromLocalFile('resources/exportPDFInput.pdf');
exportPdfOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
exportPdfOperation.execute(executionContext)
.then(result => result.saveAsFile('output/exportPdfOutput.docx'))
// Create an ExecutionContext using
// credentials and create a new
// operation instance.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew( ExportPDFTargetFormat.DOCX );
// Set operation input from a local PDF file
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"exportPdfInput.pdf");
exportPdfOperation.SetInput(sourceFileRef);
// Execute the operation.
FileRef result = exportPdfOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory()
+ "/output/exportPdfOutput.docx");
// Create an ExecutionContext using
// credentials and create a new
// operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
ExportPDFOperation exportPdfOperation = ExportPDFOperation
.createNew(ExportPDFTargetFormat.DOCX);
// Set operation input from a local PDF file
FileRef sourceFileRef = FileRef
.createFromLocalFile(
"src/main/resources/exportPDFInput.pdf"
);
exportPdfOperation.setInput(sourceFileRef);
// Execute the operation.
FileRef result = exportPdfOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/exportPdfOutput.docx");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
ocrOperation = PDFToolsSdk.OCR.Operation.createNew();
// Set operation input from a source file.
const input = PDFToolsSdk.FileRef.createFromLocalFile( 'resources/ocrInput.pdf', PDFToolsSdk.OCR.SupportedMediaTypes.pdf );
ocrOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
ocrOperation.execute(executionContext).then(result => result.saveAsFile('output/ocrOutput.pdf'));
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
OCROperation ocrOperation = OCROperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"ocrInput.pdf");
ocrOperation.SetInput(sourceFileRef);
// Execute the operation.
FileRef result = ocrOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() + "/output/ocrOperationOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
OCROperation ocrOperation = OCROperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile( "src/main/resources/ocrInput.pdf" );
ocrOperation.setInput(source);
// Execute the operation
FileRef result = ocrOperation.execute(executionContext);
// Save the result at the specified location
result.saveAs("output/ocrOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
rotatePagesOperation = PDFToolsSdk.RotatePages.Operation.createNew();
// Set operation input from a source file.
const input = PDFToolsSdk.FileRef
.createFromLocalFile(
'resources/rotatePagesInput.pdf'
);
rotatePagesOperation.setInput(input);
// Sets angle by 90 degrees (in clockwise direction) for rotating the specified pages of the input PDF file.
const firstPageRange = getFirstPageRangeForRotation();
rotatePagesOperation.setAngleToRotatePagesBy(
PDFToolsSdk.RotatePages.Angle._90, firstPageRange
);
// Sets angle by 180 degrees (in clockwise direction) for rotating the specified pages of the input PDF file.
const secondPageRange = getSecondPageRangeForRotation();
rotatePagesOperation
.setAngleToRotatePagesBy(
PDFToolsSdk.RotatePages.Angle._180,secondPageRange
);
// Execute the operation and Save the result to the specified location.
rotatePagesOperation.execute(executionContext)
.then(result =>
result.saveAsFile(
'output/rotatePagesOutput.pdf'
));
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
RotatePagesOperation rotatePagesOperation = RotatePagesOperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(
@"rotatePagesInput.pdf"
);
rotatePagesOperation.SetInput(sourceFileRef);
// Sets angle by 90 degrees (in clockwise direction) for rotating the specified pages of the input PDF file.
PageRanges firstPageRange = GetFirstPageRangeForRotation();
rotatePagesOperation.SetAngleToRotatePagesBy(
Angle._90, firstPageRange
);
// Sets angle by 180 degrees (in clockwise direction) for rotating the specified pages of the input PDF file.
PageRanges secondPageRange = GetSecondPageRangeForRotation();
rotatePagesOperation
.SetAngleToRotatePagesBy(Angle._180, secondPageRange);
// Execute the operation.
FileRef result = rotatePagesOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() +
"/output/rotatePagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
RotatePagesOperation rotatePagesOperation = RotatePagesOperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile(
"src/main/resources/rotatePagesInput.pdf"
);
rotatePagesOperation.setInput(source);
// Sets angle by 90 degrees (in clockwise direction) for rotating the specified pages of the input PDF file.
PageRanges firstPageRange = getFirstPageRangeForRotation();
rotatePagesOperation.setAngleToRotatePagesBy(
Angle._90, firstPageRange
);
// Sets angle by 180 degrees (in clockwise direction) for rotating the specified pages of the input PDF file.
PageRanges secondPageRange = getSecondPageRangeForRotation();
rotatePagesOperation
.setAngleToRotatePagesBy(
Angle._180, secondPageRange
);
// Execute the operation.
FileRef result = rotatePagesOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/rotatePagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
deletePagesOperation = PDFToolsSdk.DeletePages.Operation.createNew();
// Set operation input from a source file.
const input = PDFToolsSdk.FileRef
.createFromLocalFile(
'resources/deletePagesInput.pdf'
);
deletePagesOperation.setInput(input);
// Delete pages of the document (as specified by PageRanges).
const pageRangesForDeletion = getPageRangesForDeletion();
deletePagesOperation
.setPageRanges(pageRangesForDeletion);
// Execute the operation and Save the result to the specified location.
deletePagesOperation.execute(executionContext)
.then(result =>
result.saveAsFile(
'output/deletePagesOutput.pdf'
))
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
DeletePagesOperation deletePagesOperation = DeletePagesOperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(
@"deletePagesInput.pdf"
);
deletePagesOperation.SetInput(sourceFileRef);
// Delete pages of the document
// (as specified by PageRanges).
PageRanges pageRangeForDeletion = GetPageRangeForDeletion();
deletePagesOperation
.SetPageRanges(pageRangeForDeletion);
// Execute the operation.
FileRef result = deletePagesOperation
.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() +
"/output/deletePagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
DeletePagesOperation deletePagesOperation = DeletePagesOperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile(
"src/main/resources/deletePagesInput.pdf"
);
deletePagesOperation.setInput(source);
// Delete pages of the document (as specified by PageRanges).
PageRanges pageRangeForDeletion = getPageRangeForDeletion();
deletePagesOperation.setPageRanges(pageRangeForDeletion);
// Execute the operation.
FileRef result = deletePagesOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/deletePagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
replacePagesOperation = PDFToolsSdk.ReplacePages.Operation.createNew();
// Set operation base input from a source file.
const baseInputFile = PDFToolsSdk.FileRef
.createFromLocalFile('resources/baseInput.pdf');
replacePagesOperation.setBaseInput(baseInputFile);
// Create a FileRef instance using a local file.
const firstInputFile = PDFToolsSdk.FileRef
.createFromLocalFile(
'resources/replacePagesInput1.pdf'
),
pageRanges = getPageRangesForFirstFile();
// Adds the pages (specified by the page ranges) of the input PDF file for replacing the page of the base PDF file.
replacePagesOperation.addPagesForReplace(
1, firstInputFile, pageRanges
);
// Create a FileRef instance using a local file.
const secondInputFile = PDFToolsSdk.FileRef
.createFromLocalFile(
'resources/replacePagesInput2.pdf'
);
// Adds all the pages of the input PDF file for replacing the page of the base PDF file.
replacePagesOperation.addPagesForReplace(3, secondInputFile);
// Execute the operation and Save the result to the specified location.
replacePagesOperation.execute(executionContext)
.then(result => result.saveAsFile('output/replacePagesOutput.pdf'))
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
ReplacePagesOperation replacePagesOperation = ReplacePagesOperation.CreateNew();
// Set operation base input from a source file.
FileRef baseSourceFile = FileRef.CreateFromLocalFile(@"baseInput.pdf");
replacePagesOperation.SetBaseInput(baseSourceFile);
// Create a FileRef instance using a local file.
FileRef firstInputFile = FileRef.CreateFromLocalFile(
@"replacePagesInput1.pdf"
);
PageRanges pageRanges = GetPageRangeForFirstFile();
// Adds the pages (specified by the page ranges) of the input PDF file for replacing the page of the base PDF file.
replacePagesOperation
.AddPagesForReplace(firstInputFile, pageRanges, 1);
// Create a FileRef instance using a local file.
FileRef secondInputFile = FileRef.CreateFromLocalFile(
@"replacePagesInput2.pdf"
);
// Adds all the pages of the input PDF file for replacing the page of the base PDF file.
replacePagesOperation
.AddPagesForReplace(secondInputFile, 3);
// Execute the operation.
FileRef result = replacePagesOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() +
"/output/replacePagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
ReplacePagesOperation replacePagesOperation = ReplacePagesOperation.createNew();
// Set operation base input from a source file.
FileRef baseSourceFile = FileRef.createFromLocalFile(
"src/main/resources/baseInput.pdf"
);
replacePagesOperation.setBaseInput(baseSourceFile);
// Create a FileRef instance using a local file.
FileRef firstInputFile = FileRef.createFromLocalFile(
"src/main/resources/replacePagesInput1.pdf"
);
PageRanges pageRanges = getPageRangeForFirstFile();
// Adds the pages (specified by the page ranges) of the input PDF file for replacing the page of the base PDF file.
replacePagesOperation.addPagesForReplace(
firstInputFile, pageRanges, 1
);
// Create a FileRef instance using a local file.
FileRef secondInputFile = FileRef.createFromLocalFile(
"src/main/resources/replacePagesInput2.pdf"
);
// Adds all the pages of the input PDF file for replacing the page of the base PDF file.
replacePagesOperation
.addPagesForReplace(secondInputFile, 3);
// Execute the operation
FileRef result = replacePagesOperation.execute(executionContext);
// Save the result at the specified location
result.saveAs("output/replacePagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
linearizePDF = PDFToolsSdk.LinearizePDF,
linearizePDFOperation = linearizePDF.Operation.createNew();
// Set operation input from a source file.
const input = PDFToolsSdk.FileRef
.createFromLocalFile('resources/linearizePDFInput.pdf');
linearizePDFOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
linearizePDFOperation.execute(executionContext)
.then(result => result.saveAsFile('output/linearizePDFOutput.pdf'))
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
LinearizePDFOperation linearizePDFOperation = LinearizePDFOperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(
@"linearizePDFInput.pdf"
);
linearizePDFOperation.SetInput(sourceFileRef);
// Execute the operation.
FileRef result = linearizePDFOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() +
"/output/linearizePDFOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
LinearizePDFOperation linearizePDFOperation = LinearizePDFOperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile(
"src/main/resources/linearizePDFInput.pdf" );
linearizePDFOperation.setInput(source);
// Execute the operation
FileRef result = linearizePDFOperation.execute(executionContext);
// Save the result at the specified location
result.saveAs("output/linearizePDFOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext =
PDFToolsSdk
.ExecutionContext
.create(credentials),
compressPDF =
PDFToolsSdk.CompressPDF,
compressPDFOperation =
compressPDF.Operation.createNew();
// Set operation input from a source file.
const input = PDFToolsSdk
.FileRef
.createFromLocalFile(
'resources/compressPDFInput.pdf');
compressPDFOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
compressPDFOperation
.execute(executionContext)
.then(result =>
result
.saveAsFile(
'output/compressPDFOutput.pdf'
))
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext =
ExecutionContext.Create(credentials);
CompressPDFOperation compressPDFOperation =
CompressPDFOperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef =
FileRef.CreateFromLocalFile(
@"compressPDFInput.pdf"
);
compressPDFOperation.SetInput(sourceFileRef);
// Execute the operation.
FileRef result = compressPDFOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory
.GetCurrentDirectory()
+ "/output/compressPDFOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext =
ExecutionContext.create(credentials);
CompressPDFOperation compressPDFOperation = CompressPDFOperation.createNew();
// Set operation input from a source file.
FileRef source =
FileRef.createFromLocalFile(
"src/main/resources/compressPDFInput.pdf
");
compressPDFOperation.setInput(source);
// Execute the operation
FileRef result = compressPDFOperation.execute(executionContext);
// Save the result at the specified location
result.saveAs("output/compressPDFOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
reorderPagesOperation = PDFToolsSdk
.ReorderPages
.Operation
.createNew();
// Set operation input from a source file, along with specifying the order of the pages for rearranging the pages in a PDF file.
const input = PDFToolsSdk.FileRef
.createFromLocalFile(
'resources/reorderPagesInput.pdf'
);
const pageRanges = getPageRangeForReorder();
reorderPagesOperation.setInput(input);
reorderPagesOperation.setPagesOrder(pageRanges);
// Execute the operation and Save the result to the specified location.
reorderPagesOperation
.execute(executionContext)
.then(result =>
result.saveAsFile(
'output/reorderPagesOutput.pdf'
));
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
ReorderPagesOperation reorderPagesOperation = ReorderPagesOperation.CreateNew();
// Set operation input from a source file, along with specifying the order of the pages for rearranging the pages in a PDF file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"reorderPagesInput.pdf");
reorderPagesOperation.SetInput(sourceFileRef);
PageRanges pageRanges = GetPageRangeForReorder();
reorderPagesOperation.SetPagesOrder(pageRanges);
// Execute the operation.
FileRef result = reorderPagesOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() +
"/output/reorderPagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
ReorderPagesOperation reorderPagesOperation = ReorderPagesOperation.createNew();
// Set operation input from a source file, along with specifying the order of the pages for rearranging the pages in a PDF file.
FileRef source =
FileRef.createFromLocalFile( "src/main/resources/reorderPagesInput.pdf" );
PageRanges pageRanges = getPageRangeForReorder();
reorderPagesOperation.setInput(source);
reorderPagesOperation.setPagesOrder(pageRanges);
// Execute the operation.
FileRef result = reorderPagesOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/reorderPagesOutput.pdf");
curl --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' \
--header 'Authorization: Bearer ' \
--header 'Accept: application/json, text/plain, */*' \
--header 'x-api-key: ' \
--header 'Prefer: respond-async,wait=0' \
--form 'contentAnalyzerRequests="{
\"cpf:inputs\": {
\"documentsIn\": [{
\"pageRanges\": {
\"cpf:inline\": [{
\"start\": 1,
\"end\": 4
}]
},
\"documentIn\": {
\"cpf:location\": \"InputFile0\",
\"dc:format\": \"application/pdf\"
}
}, {
\"pageRanges\": {
\"cpf:inline\": [{
\"start\": 1,
\"end\": 25
}]
},
\"documentIn\": {
\"cpf:location\": \"InputFile1\",
\"dc:format\": \"application/pdf\"
}
}, {
\"pageRanges\": {
\"cpf:inline\": [{
\"start\": 1
}, {
\"end\": 25
}, {
\"start\": 1,
\"end\": 25
}]
},
\"documentIn\": {
\"cpf:location\": \"InputFile2\",
\"dc:format\": \"application/pdf\"
}
}]
},
\"cpf:engine\": {
\"repo:assetId\": \"urn:aaid:cpf:Service-916ee91c156b42349a7847a7d564fb13\"
},
\"cpf:outputs\": {
\"documentOut\": {
\"cpf:location\": \"OutputFile\",
\"dc:format\": \"application/pdf\"
}
}
}"' \
--form 'InputFile0=@""' \
--form 'InputFile1=@""' \
--form 'InputFile2=@""'
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create( credentials ),
combineFilesOperation = PDFToolsSdk.CombineFiles.Operation.createNew();
// Set operation input from a source file.
const combineSource1 = PDFToolsSdk.FileRef
.createFromLocalFile( 'resources/combineFilesInput1.pdf' ),
combineSource2 = PDFToolsSdk.FileRef
.createFromLocalFile( 'resources/combineFilesInput2.pdf' );
combineFilesOperation.addInput( combineSource1 );
combineFilesOperation.addInput( combineSource2 );
// Execute the operation and Save the result to the specified location.
combineFilesOperation
.execute( executionContext )
.then(result => result.saveAsFile( 'output/combineFilesOutput.pdf' ));
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.Create( credentials );
CombineFilesOperation combineFilesOperation = CombineFilesOperation.CreateNew();
// Add operation input from source files.
FileRef combineSource1 = FileRef
.CreateFromLocalFile( @"combineFilesInput1.pdf" );
FileRef combineSource2 = FileRef
.CreateFromLocalFile( @"combineFilesInput2.pdf" );
combineFilesOperation.AddInput( combineSource1 );
combineFilesOperation.AddInput( combineSource2 );
// Execute the operation.
FileRef result = combineFilesOperation.Execute( executionContext );
// Save the result to the specified location.
result.SaveAs( Directory.GetCurrentDirectory() +
"/output/combineFilesOutput.pdf" );
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create( credentials );
CombineFilesOperation combineFilesOperation = CombineFilesOperation.createNew();
// Add operation input from source files.
FileRef combineSource1 = FileRef
.createFromLocalFile( "src/main/resources/combineFilesInput1.pdf" );
FileRef combineSource2 = FileRef
.createFromLocalFile( "src/main/resources/combineFilesInput2.pdf" );
combineFilesOperation.addInput( combineSource1 );
combineFilesOperation.addInput( combineSource2 );
// Execute the operation.
FileRef result = combineFilesOperation.execute( executionContext );
// Save the result to the specified location.
result.saveAs( "output/combineFilesOutput.pdf" );
// Create an ExecutionContext using credentials
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials);
// Create a new operation instance.
const splitPDFOperation = PDFToolsSdk.SplitPDF.Operation.createNew(),
input = PDFToolsSdk.FileRef.createFromLocalFile('resources/splitPDFInput.pdf',
PDFToolsSdk.SplitPDF.SupportedSourceFormat.pdf
);
// Set operation input from a source file.
splitPDFOperation.setInput(input);
// Set the number of documents to split the input PDF file into.
splitPDFOperation.setFileCount(2);
// Execute the operation and Save the result to the specified location.
splitPDFOperation.execute(executionContext)
.then(result => {
let saveFilesPromises = [];
for(let i = 0; i < result.length; i++){
saveFilesPromises.push(result[i].saveAsFile(`output/splitPDFOutput_${i}.pdf`));
}
return Promise.all(saveFilesPromises);
});
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
SplitPDFOperation splitPDFOperation = SplitPDFOperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"splitPDFInput.pdf");
splitPDFOperation.SetInput(sourceFileRef);
// Set the number of documents to split the input PDF file into.
splitPDFOperation.SetFileCount(2);
// Execute the operation.
List result = splitPDFOperation.Execute(executionContext);
// Save the result to the specified location.
int index = 0;
foreach (FileRef fileRef in result)
{
fileRef.SaveAs(Directory.GetCurrentDirectory() + "/output/splitPDFOutput_" +
index + ".pdf");
index++;
}
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
SplitPDFOperation splitPDFOperation = SplitPDFOperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile("src/main/resources/splitPDFInput.pdf");
splitPDFOperation.setInput(source);
// Set the number of documents to split the input PDF file into.
splitPDFOperation.setFileCount(2);
// Execute the operation.
List result = splitPDFOperation.execute(executionContext);
// Save the result to the specified location.
int index = 0;
for (FileRef fileRef : result) {
fileRef.saveAs("output/splitPDFOutput_" + index + ".pdf");
index++;
}
// Create an ExecutionContext using credentials and create a new operation instance.
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials),
insertPagesOperation = PDFToolsSdk.InsertPages.Operation.createNew();
// Set operation base input from a source file.
const baseInputFile = PDFToolsSdk.FileRef
.createFromLocalFile('resources/baseInput.pdf');
insertPagesOperation.setBaseInput(baseInputFile);
// Create a FileRef instance using a local file.
const firstFileToInsert = PDFToolsSdk.FileRef
.createFromLocalFile(
'resources/firstFileToInsertInput.pdf'
),
pageRanges = getPageRangesForFirstFile();
// Adds the pages (specified by the page ranges)
// of the input PDF file to be
// inserted at the specified page of the base PDF file.
insertPagesOperation.addPagesToInsertAt(
2, firstFileToInsert, pageRanges);
// Create a FileRef instance using a local file.
const secondFileToInsert = PDFToolsSdk
.FileRef.createFromLocalFile(
'resources/secondFileToInsertInput.pdf'
);
// Adds all the pages of the input PDF file
// to be inserted at the specified
// page of the base PDF file.
insertPagesOperation.addPagesToInsertAt(3, secondFileToInsert);
// Execute the operation and Save the
// result to the specified location.
insertPagesOperation.execute(executionContext)
.then(result => result.saveAsFile(
'output/insertPagesOutput.pdf'
))
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
InsertPagesOperation insertPagesOperation = InsertPagesOperation.CreateNew();
// Set operation base input from a source file.
FileRef baseSourceFile = FileRef.CreateFromLocalFile(@"baseInput.pdf");
insertPagesOperation.SetBaseInput(baseSourceFile);
// Create a FileRef instance using a local file.
FileRef firstFileToInsert =
FileRef.CreateFromLocalFile(
@"firstFileToInsertInput.pdf"
);
PageRanges pageRanges = GetPageRangeForFirstFile();
// Adds the pages (specified by the page ranges) of the input PDF file to be inserted at the specified page of the base PDF file.
insertPagesOperation.AddPagesToInsertAt(
firstFileToInsert, pageRanges, 2
);
// Create a FileRef instance using a local file.
FileRef secondFileToInsert = FileRef
.CreateFromLocalFile(
@"secondFileToInsertInput.pdf"
);
// Adds all the pages of the input PDF file to be inserted at the specified page of the base PDF file.
insertPagesOperation
.AddPagesToInsertAt(secondFileToInsert, 3);
// Execute the operation.
FileRef result = insertPagesOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory()
+ "/output/insertPagesOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
InsertPagesOperation insertPagesOperation = InsertPagesOperation.createNew();
// Set operation base input from a source file.
FileRef baseSourceFile = FileRef.createFromLocalFile(
"src/main/resources/baseInput.pdf"
);
insertPagesOperation.setBaseInput(baseSourceFile);
// Create a FileRef instance using a local file.
FileRef firstFileToInsert =
FileRef.createFromLocalFile(
"src/main/resources/firstFileToInsertInput.pdf"
);
PageRanges pageRanges =
getPageRangeForFirstFile ();
// Adds the pages (specified by the page ranges) of the input PDF file to be inserted at the specified page of the base PDF file.
insertPagesOperation
.addPagesToInsertAt(firstFileToInsert, pageRanges, 2);
// Create a FileRef instance using a local file.
FileRef secondFileToInsert = FileRef.createFromLocalFile(
"src/main/resources/secondFileToInsertInput.pdf"
);
// Adds all the pages of the input PDF file to be inserted at the specified page of the base PDF file.
insertPagesOperation
.addPagesToInsertAt(secondFileToInsert, 3);
// Execute the operation.
FileRef result = insertPagesOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/insertPagesOutput.pdf");
curl --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' \
--header 'Authorization: Bearer ' \
--header 'Accept: application/json, text/plain, */*' \
--header 'x-api-key: ' \
--header 'Prefer: respond-async,wait=0' \
--form 'contentAnalyzerRequests="{
\"cpf:engine\":{
\"repo:assetId\":\"urn:aaid:cpf:Service-52d5db6097ed436ebb96f13a4c7bf8fb\"
},
\"cpf:inputs\":{
\"documentIn\":{
\"cpf:location\":\"InputFile0\",
\"dc:format\":\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"
},
\"params\":{
\"cpf:inline\":{
\"outputFormat\": \"pdf\",
\"jsonDataForMerge\": {
\"customerName\": \"Kane Miller\",
\"customerVisits\": 100,
\"itemsBought\": [
{
\"name\": \"Sprays\",
\"quantity\": 50,
\"amount\": 100
},
{
\"name\": \"Chemicals\",
\"quantity\": 100,
\"amount\": 200
}
],
\"totalAmount\": 300,
\"previousBalance\": 50,
\"lastThreeBillings\": [100, 200, 300],
\"photograph\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88h8AAu0B9XNPCQQAAAAASUVORK5CYII=\"
}
}
}
},
\"cpf:outputs\":{
\"documentOut\":{
\"cpf:location\":\"OutputFile\",
\"dc:format\":\"application/pdf\"
}
}
}"' \
--form 'InputFile0=@""'
// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample
const PDFToolsSdk = require('@dcloud/documentservices-pdftools-node-sdk'),
fs = require('fs');
try {
// Initial setup, create credentials instance.
const credentials = PDFToolsSdk.Credentials
.serviceAccountCredentialsBuilder()
.fromFile("pdftools-api-credentials.json")
.build();
// Setup input data for the document merge process
const jsonString = fs.readFileSync('resources/salesOrder.json'),
jsonDataForMerge = JSON.parse(jsonString);
// Create an ExecutionContext using credentials
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials);
// Create a new DocumentMerge options instance
const documentMerge = PDFToolsSdk.DocumentMerge,
documentMergeOptions = documentMerge.options,
options = new documentMergeOptions
.DocumentMergeOptions(jsonDataForMerge, documentMergeOptions.OutputFormat.PDF);
// Create a new operation instance using the options instance
const documentMergeOperation = documentMerge.Operation.createNew(options)
// Set operation input document template from a source file.
const input = PDFToolsSdk
.FileRef.createFromLocalFile('resources/salesOrderTemplate.docx');
documentMergeOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
documentMergeOperation.execute(executionContext)
.then(result => result.saveAsFile('output/salesOrderOutput.pdf'))
.catch(err => {
if(err instanceof PDFToolsSdk.Error.ServiceApiError
|| err instanceof PDFToolsSdk.Error.ServiceUsageError) {
console.log('Exception encountered while executing operation', err);
} else {
console.log('Exception encountered while executing operation', err);
}
});
} catch (err) {
console.log('Exception encountered while executing operation', err);
}
// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples
namespace MergeDocumentToPDF
{
class Program
{
private static readonly ILog log = LogManager.GetLogger(typeof(Program));
static void Main()
{
//Configure the logging
ConfigureLogging();
try
{
// Initial setup, create credentials instance.
Credentials credentials = Credentials.ServiceAccountCredentialsBuilder()
.FromFile(Directory.GetCurrentDirectory() + "/pdftools-api-credentials.json")
.Build();
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Setup input data for the document merge process
var content = File.ReadAllText(@"salesOrder.json");
JObject jsonDataForMerge = JObject.Parse(content);
// Create a new DocumentMerge Options instance
DocumentMergeOptions documentMergeOptions =
new DocumentMergeOptions(jsonDataForMerge, OutputFormat.PDF);
// Create a new DocumentMerge Operation instance with the DocumentMerge Options instance
DocumentMergeOperation documentMergeOperation =
DocumentMergeOperation.CreateNew(documentMergeOptions);
// Set the operation input document template from a source file.
documentMergeOperation
.SetInput(FileRef.CreateFromLocalFile(@"salesOrderTemplate.docx"));
// Execute the operation.
FileRef result = documentMergeOperation.Execute(executionContext);
// Save the result to the specified location
result.SaveAs(Directory.GetCurrentDirectory() + "/output/salesOrderOutput.pdf");
}
catch (ServiceUsageException ex)
{
log.Error("Exception encountered while executing operation", ex);
}
// Catch more errors here. . .
}
static void ConfigureLogging()
{
ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
}
}
}
// Get the samples from https://www.adobe.com/go/pdftoolsapi_java_samples
public class MergeDocumentToPDF {
// Initialize the logger.
private static final Logger LOGGER = LoggerFactory.getLogger(MergeDocumentToPDF.class);
public static void main(String[] args) {
try {
// Initial setup, create credentials instance.
Credentials credentials = Credentials.serviceAccountCredentialsBuilder()
.fromFile("pdftools-api-credentials.json")
.build();
// Setup input data for the document merge process
String content = new String(Files.readAllBytes(
Paths.get("src/main/resources/salesOrder.json")));
JSONObject jsonDataForMerge=new JSONObject(content);
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.create(credentials);
//Create a new DocumentMergeOptions instance
DocumentMergeOptions documentMergeOptions =
new DocumentMergeOptions(jsonDataForMerge, OutputFormat.PDF);
// Create a new DocumentMergeOperation instance with the DocumentMergeOptions instance
DocumentMergeOperation documentMergeOperation =
DocumentMergeOperation.createNew(documentMergeOptions);
// Set the operation input document template from a source file.
FileRef documentTemplate =
FileRef.createFromLocalFile("src/main/resources/salesOrderTemplate.docx");
documentMergeOperation.setInput(documentTemplate);
// Execute the operation
FileRef result = documentMergeOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/salesOrderOutput.pdf");
} catch (ServiceApiException | IOException | ServiceUsageException e) {
System.out.println(e);
}
}
}
// Create an ExecutionContext using credentials
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials);
// Create new permissions instance and add the required permissions
const protectPDF = PDFToolsSdk.ProtectPDF,
protectPDFOptions = protectPDF.options,
permissions = protectPDFOptions.Permissions.createNew();
permissions.addPermission(protectPDFOptions.Permission.PRINT_LOW_QUALITY);
permissions.addPermission
(protectPDFOptions.Permission.EDIT_DOCUMENT_ASSEMBLY);
permissions.addPermission(protectPDFOptions.Permission.COPY_CONTENT);
// Build ProtectPDF options by setting a User as well as an Owner/Permissions Password, Permissions,
// Encryption Algorithm (used for encrypting the PDF file) and specifying the type of content to encrypt.
const options = new protectPDFOptions.PasswordProtectOptions.Builder()
.setUserPassword("openpassword")
.setOwnerPassword("permissionspassword")
.setPermissions(permissions)
.setEncryptionAlgorithm(protectPDFOptions.EncryptionAlgorithm.AES_256)
.setContentEncryption
(protectPDFOptions.ContentEncryption.ALL_CONTENT_EXCEPT_METADATA)
.build();
// Create a new operation instance.
const protectPDFOperation = protectPDF.Operation.createNew(options);
// Set operation input from a source file.
const input = PDFToolsSdk.FileRef.createFromLocalFile('resources/protectPDFInput.pdf');
protectPDFOperation.setInput(input);
// Execute the operation and Save the result to the specified location.
protectPDFOperation.execute(executionContext)
.then(result => result.saveAsFile('output/protectPDFOutput.pdf'))
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create new permissions instance and add the required permissions
Permissions permissions = Permissions.CreateNew();
permissions.AddPermission(Permission.PRINT_LOW_QUALITY);
permissions.AddPermission(Permission.EDIT_DOCUMENT_ASSEMBLY);
permissions.AddPermission(Permission.COPY_CONTENT);
// Build ProtectPDF options by setting a User as well as Owner/Permissions Password, Permissions,
// Encryption Algorithm (used for encrypting the PDF file) and specifying the type of content to encrypt.
ProtectPDFOptions protectPDFOptions = ProtectPDFOptions.PasswordProtectOptionsBuilder()
.SetUserPassword("openpassword")
.SetOwnerPassword("permissionspassword")
.SetPermissions(permissions)
.SetEncryptionAlgorithm(EncryptionAlgorithm.AES_256)
.SetContentEncryption(ContentEncryption.ALL_CONTENT_EXCEPT_METADATA)
.Build();
// Create a new operation instance
ProtectPDFOperation protectPDFOperation = ProtectPDFOperation.CreateNew(protectPDFOptions);
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"protectPDFInput.pdf");
protectPDFOperation.SetInput(sourceFileRef);
// Execute the operation.
FileRef result = protectPDFOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() + "/output/protectPDFOutput.pdf");
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.create(credentials);
// Create new permissions instance and add the required permissions
Permissions permissions = Permissions.createNew();
permissions.addPermission(Permission.PRINT_LOW_QUALITY);
permissions.addPermission(Permission.EDIT_DOCUMENT_ASSEMBLY);
permissions.addPermission(Permission.COPY_CONTENT);
// Build ProtectPDF options by setting a User as well as Owner/Permissions Password, Permissions,
// Encryption Algorithm (used for encrypting the PDF file) and specifying the type of content to encrypt.
ProtectPDFOptions protectPDFOptions = ProtectPDFOptions.passwordProtectOptionsBuilder()
.setOwnerPassword("openpassword")
.setUserPassword("permissionspassword")
.setPermissions(permissions)
.setEncryptionAlgorithm(EncryptionAlgorithm.AES_256)
.setContentEncryption(ContentEncryption.ALL_CONTENT_EXCEPT_METADATA)
.build();
// Create a new operation instance.
ProtectPDFOperation protectPDFOperation = ProtectPDFOperation.createNew(protectPDFOptions);
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile("src/main/resources/protectPDFInput.pdf");
protectPDFOperation.setInput(source);
// Execute the operation
FileRef result = protectPDFOperation.execute(executionContext);
// Save the result at the specified location
result.saveAs("output/protectPDFOutput.pdf");
// Create an ExecutionContext using credentials
const executionContext = PDFToolsSdk.ExecutionContext.create(credentials);
// Create a new operation instance.
const removeProtectionOperation = PDFToolsSdk.RemoveProtection.Operation.createNew(),
input = PDFToolsSdk.FileRef.createFromLocalFile(
'resources/removeProtectionInput.pdf',
PDFToolsSdk.RemoveProtection.SupportedSourceFormat.pdf
);
// Set operation input from a source file.
removeProtectionOperation.setInput(input);
// Set the password for removing security from a PDF document.
removeProtectionOperation.setPassword("password");
// Execute the operation and Save the result to the specified location.
removeProtectionOperation.execute(executionContext)
.then(result => result.saveAsFile('output/removeProtectionOutput.pdf'))
// Create an ExecutionContext using credentials.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
// Create a new operation instance
RemoveProtectionOperation removeProtectionOperation = RemoveProtectionOperation.CreateNew();
// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"removeProtectionInput.pdf");
removeProtectionOperation.SetInput(sourceFileRef);
// Set the password for removing security from a PDF document.
removeProtectionOperation.SetPassword("password");
// Execute the operation.
FileRef result = removeProtectionOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(Directory.GetCurrentDirectory() +
"/output/removeProtectionOutput.pdf");
// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.create(credentials);
RemoveProtectionOperation removeProtectionOperation = RemoveProtectionOperation.createNew();
// Set operation input from a source file.
FileRef source = FileRef.createFromLocalFile("src/main/resources/removeProtectionInput.pdf");
removeProtectionOperation.setInput(source);
// Set the password for removing security from a PDF document.
removeProtectionOperation.setPassword("password");
// Execute the operation.
FileRef result = removeProtectionOperation.execute(executionContext);
// Save the result to the specified location.
result.saveAs("output/removeProtectionOutput.pdf");
<div id="adobe-dc-view" style="height: 360px; width: 500px;"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "<YOUR_CLIENT_ID>", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{ location:
{ url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea%20Brochure.pdf"}},
metaData:{fileName: "Bodea Brochure.pdf"}
},
{
embedMode: "SIZED_CONTAINER"
});
});
</script>
document.addEventListener("adobe_dc_view_sdk.ready", function() {
var adobeDCView = new AdobeDC.View({clientId: "<YOUR_CLIENT_ID>", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content: {location: {url: "(path to your PDF)/yourfilename.pdf"}},
metaData: {fileName: "yourfilename.pdf"}
},
{showAnnotationTools: true});
});
adobeDCView.registerCallback(
/* Type of call back */
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
/* call back function */
function(event) {
console.log(event);
},
{ enablePDFAnalytics: true }
);
const profile = {
userProfile: {
name: '',
firstName: '',
lastName: '',
email: ''
}
};
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.GET_USER_PROFILE_API,
function() {
return new Promise((resolve, reject) => {
resolve({
code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS,
data: profile
});
});
}
);
const saveOptions = {
autoSaveFrequency: <Number, default=0>,
enableFocusPolling: <Boolean, default=false>,
showSaveButton: <Boolean, default=true>
}
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.SAVE_API,
function(metadata, content, options) {
return new Promise((resolve, reject) => {
resolve({
code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS,
data: {
metaData: <File MetaData>
}
});
});
},
saveOptions);
<div id="adobe-dc-view"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function () {
var adobeDCView = new AdobeDC.View({clientId: "<YOUR_CLIENT_ID>", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf"}},
metaData:{fileName: "Bodea Brochure.pdf"}
}, {"showLeftHandPanel": true, "showPageControls": false});
});
</script>
Adobe PDF Extract API
A new web service that allows you to unlock content structure and table data from any PDF document with machine learning
-
Leverage Adobe Sensei for a rich understanding of content structure with higher quality input to other systems
-
Easily Extract content to JSON format for further processing into other applications or databases
-
Identify more document elements than OCR with extraction of headings, paragraphs, lists, and more
Get Started in Minutes
-
Obtain credentials
-
Add credentials to your code and run!
API Reference
Use Cases for PDF Tools API
Document Management
Programmatically manage document workflows through high performance, cloud-based APIs:
- Create PDF documents from dynamic or static html content, such as web forms, charts
- Secure PDF documents in the embedded PDF viewer and disable printing, downloading, and document manipulation
Common use cases: Manufacturing operations, government workflows
Business Process Automation
Eliminate manual processes with automated workflows through powerful PDF APIs:
- Automate document workflows through programmatic creation and manipulation of PDF files from digital assets
- Streamline sharing of attachments and consumption of PDF documents for fast web viewing
Common use cases: Retail sales and invoicing, eLearning systems
Learn about our PDF Embed API to embed high-fidelity PDFs and control appearance, enable collaboration, and see analytics