


APIs for embedded viewing and manipulation of PDFs
From the company that invented the standard
Adobe PDF Embed API
Leverage the free JavaScript API to embed PDFs without the need for end users to download additional plugins.
Provide a rich PDF viewing experience and easily enable digital collaboration and document analytics.
Adobe PDF Tools API
Use the PDF Tools API to quickly solve specific challenges or power multi-step document workflows, with SDKs for Node.js, Java, and .NET.
Apply OCR to enable searching, easily convert files (HTML to PDF, PDF to Microsoft Word and more), or combine actions to automate workflows.
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
Sample multi-step PDF workflow
-
Create PDF from Word
Create PDF from Word
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 Documentation -
Combine multiple PDFs
Combine multiple PDFs
Combine multiple PDFs from a variety of formats, including static and dynamic HTML; Microsoft Word, PowerPoint, and Excel; as well as text, image, and, Zip
See Documentation -
Password protect the PDF
Password protect the PDF
Password protect the PDF, including static and dynamic HTML; Microsoft Word, PowerPoint, and Excel; as well as text, image, and, Zip
See Documentation -
Embed PDF for viewing and analytics
Embed PDF for viewing and analytics
Embed PDF for viewing and analytics, including static and dynamic HTML; Microsoft Word, PowerPoint, and Excel; as well as text, image, and, Zip
See Documentation
// 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");
// 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");
// 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>
“Our clients wanted to create PDFs of our reports and the open source solution we tried was difficult to work with and unreliable. We switched to the Adobe Services SDK because it produced higher quality PDFs and also let our clients convert to PowerPoint to customize reports for their audience.”
– Tim Hill, CEO & Co-Founder, Social Status
“We are committed to building superior collaboration and user experiences on our platform, and with PDF APIs from Adobe, we enabled the world’s best document experiences with ease— right within the Acumatica ERP solution.”
– John Roskill, CEO, Acumatica Cloud ERP
“Adobe Document Services helped us extend K2’s intelligent process automation solution to enable integrated PDF document creation with a rich, interactive web experience for document review, approval, and e-signature processes with Adobe Sign. Our developers were able to easily extend K2 workflows that collect information from multiple data sources using Adobe Document Services APIs, enabling us to quickly deliver a solution for our customers to automate their document -oriented business processes in a more secure and scalable way.”
– Alex Cobb, VP Product Management, K2
“With the 99U Conference shifting to an all-virtual format this year, we wanted to make all aspects of the event accessible to our attendees — especially The Creative Self Workbook, a workbook offering a chance for deep self-discovery and exploration. The Adobe PDF Embed API allowed us to create an accessible, seamless PDF experience with live form filling, notes, drawing, downloading, and printing options with just a few lines of code.”
– Andrea Rosen, Head of 99U
“InfoDesk provides AI-driven technology and tools that enable organizations to make the smartest decisions confidently. This involves delivering highly relevant insights to our customers in a format that suits them best so they can harness the value of their information. By using Adobe’s Document Service API, our customers can easily convert PDF reports to PowerPoint for use in client presentations and internal stakeholder meetings. At InfoDesk, we are always looking for ways to add value for our clients and Adobe enables us to do exactly that.”
– Lynn Epstein, COO, InfoDesk



