Skip to content

Instantly share code, notes, and snippets.

View benvanderberg's full-sized avatar

Ben Vanderberg benvanderberg

View GitHub Profile
var viewerOptions = {
embedMode: "FULL_WINDOW",
defaultViewMode: "FIT_PAGE",
showDownloadPDF: false,
showPrintPDF: false,
showLeftHandPanel: true,
showAnnotationTools: false,
enableSearchAPIs: true
};
{
"customer": {
"@context": "https://schema.org",
"@type": "Person",
"address": {
"@type": "PostalAddress",
"addressLocality": "Seattle",
"addressRegion": "WA",
"postalCode": "98052",
"streetAddress": "20341 Whitworth Institute 405 N. Whitworth"
{
"Order":{
"id": "002453",
"currency": "USD",
"renew": 4,
"taxRate":1.08,
"totalBill":459.99,
"products": [
{
"description": "Proof of Concept",
// 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
);
// 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
);
const list_of_annotations = [Annotation_1, Annotation_2];
previewFilePromise.then(adobeViewer => {
adobeViewer.getAnnotationManager().then(annotationManager => {
annotationManager.addAnnotations(list_of_annotations)
.then(() => console.log("Success"))
"metaData": {
"fileName": "Bodea Brochure.pdf",
"id": "3A5E36C8AA950DCDEBFBFE46FFCDE0A6"
}
"inkList": [
[554.407958984375, 81.8079833984375],
[553.75341796875, 81.8079833984375],
[553.75341796875, 82.4625244140625]
]
"quadPoints": [
144, 471.191986, 521.557983, 471.191986, 144, 455.220001, 521.557983, 455.220001,
144, 457.511993, 525.580017, 457.511993, 144, 441.540009, 525.580017, 441.540009,
144, 443.592010, 320.100006, 443.592010, 144, 427.619995, 320.100006, 427.619995
]
const allowTextSelection = false;
previewFilePromise.then(adobeViewer => {
adobeViewer.getAPIs().then(apis => {
apis.enableTextSelection(allowTextSelection)
.then(() => console.log("Success"))
.catch(error => console.log(error));
});
});