adobe / pdf-embed-api-samples Goto Github PK
View Code? Open in Web Editor NEWSamples for Adobe Document Services PDF Embed API
Home Page: https://documentcloud.adobe.com/view-sdk-demo/index.html
License: MIT License
Samples for Adobe Document Services PDF Embed API
Home Page: https://documentcloud.adobe.com/view-sdk-demo/index.html
License: MIT License
user should be restricted to modify (delete or edit) the comment of other users.
user can easily manipulate comments of other users.
adobe embed api February, 2023
It would be extremely useful to have the PDF form fields and values added as a JSON object to the metadata parameter when "Save" is clicked on the PDF. At present, the large size of some PDFs makes transmitting them to a server via javascript a substantial challenge. There are size issues, encoding issues, and then issues of actually pulling said form fields and values from the PDF once the BLOB reaches the server.
The use case of allowing consumers to use an actual PDF to enter form data on the internet instead of HTML forms without the document support (or some side-by-side amalgamation) would be incredibly well received.
The Adobe git hub examples : pdf-embed-api-samples/Viewer APIs/Search and Zoom APIs/index.js
If the search is done, it must call its callbacks. In this case, "searchCallback". However, this doesn't get called anymore.
It used to call, but at some point it doesn't. Can someone look at this problem?
Actual code looks like this
var search = function(searchTerm) {
viewerApis.search(searchTerm)
.then(function(sObj) {
searchObject = sObj;
searchObject.onResultsUpdate(searchCallback). // ==> This callback doesn't get called.
.then(function(result) {
console.log("Registered callback function with onResultsUpdate(): ", result) // ===> This is always false
})
.catch(function(error) {
console.log(error)
});
})
.catch(function(error) {
var errorMsg = "";
if(error.code === "FAIL") {
errorMsg = "No search result found";
} else if(error.code === "INVALID_INPUT") {
errorMsg = "Enter valid search term";
}
document.getElementById("search-result").style.display = "block";
document.getElementById("searchResult-num").innerText = errorMsg;
document.getElementById("search-result").querySelectorAll(".searchResult-btn").forEach(function(element) {
element.style.opacity = "0.2";
element.disabled = true;
});
})
}
//// CALLBACK. This used to called, but no longer gets called.
function searchCallback(searchResult) {
var currentResultIndex = searchResult.currentResult.index;
var totalResults = searchResult.totalResults;
var searchResultItem = document.getElementById("search-result");
searchResultItem.style.display = "block";
document.getElementById("searchResult-num").innerText = "Result " + currentResultIndex + " of " + totalResults;
searchResultItem.querySelectorAll(".searchResult-btn").forEach(function(element) {
element.style.opacity = "0.8";
element.disabled = false;
});
}
Expected Behaviour
It should make a callback call.
Actual Behaviour
It doesn't make callback.
APP_RENDERING_FAILED
event is fired if viewer fails to load a file. (corrupted pdf files, renamed non pdf files to .pdf
ext)
Viewer gives an error on the UI but the event is not fired at all.
Attach a non-pdf file, or a non-pdf file that you renamed to a pdf.
I have been using the API and providing a URL and not having any problems but when I switch to using the promise I am getting an error back in the console and the file doesn't load. It looks as if the error is in the viewer.js
I get the error:
"Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' use.typekit.net assets.adobedtm.com www.adobe.com/marketingtech/ prod.adobeccstatic.com/utilnav/ widget.uservoice.com by2.uservoice.com/t2/ assets.adobe.com api.demandbase.com/api/v2/ip.json commerce.adobe.com". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present."
Is there something I need to add to my CSP Header to prevent this?
To reproduce the error here's what I am doing using I am using https://documentservices.adobe.com/view-sdk/viewer.js
var adobeDCView = new AdobeDC.View({
clientId: {clientId},
divId: "adobe-dc-view",
});
adobeDCView.previewFile({
content: {
promise: readFile(buffer),
},
metaData: {
fileName: "FileName"
}
}, {});
}
Any help would be greatly appreciated.
Font size on each input in forms should be in auto. Image below is just default from Chrome browser.
Upload attached file to https://acrobatservices.adobe.com/view-sdk-demo/index.html#/customize/FULL_WINDOW to try.
I am trying to use the API with files hosted in azure blobstorage, the error it gives me is the following:
File preview error
File preview not available, please reload to try again.
regards.
Not sure this is the correct place, but as the Adobe forums are not responsive adding here.
We have a site where the Adobe Embed API has been working well for months, but in the last week started popping up with the error PREVIEW_RENDERING_FAILED, which fails to even show an error message, instead we get a completely blank screen, this is intermittent, sometimes it will show the PDF fine, other times it seems to timeout the promise.
The files are loaded from an API and using a fileReader we are creating an ArrayBuffer, which has not changed in any way, and the files sometimes load and then sometimes we receive a blank screen and the PREVIEW_RENDERING_FAILED error. The files are not large, max is currently around 2MB and the only way I can consistently show the error is if I 3G throttle the connection, just seems to time out even with small files, but it is intermittent even on a non throttled connection, it is as if the promise resolution even though the file has been received is timing out.
The error seems to be thrown in ViewSDKInterfaceApp.js on the line which gets the exposed APIs but that could just be the browser interpretation, its the last place on the stack trace, which shows:
previewFile(fileInfo, previewConfig) {
this._logExternal("Starting process to preview file.", fileInfo.metaData, previewConfig);
return this._embedModeHandlerService
.initialiseAction(fileInfo, previewConfig, IFrameMessageTypes.PREVIEW, hostAppStartTime)
.then(() => this._adobeViewer.getExposedAPIs({ previewConfig }));
}
There are also some XHR requests going to https://dc-api.adobe.io/system/log which seem to have some additional information:
{
"level": "error",
"message": "Error in preview, file rendering timeout",
"sessionId": "41188030-6b8f-47f9-9ab2-3b6dca66d104",
"viewSDKAppVersion": "REDACTED",
"tenantId": "REDACTED",
"callingApp": "dc-view-sdk",
"externalUserId": "REDACTED",,
"clientId": "REDACTED",
"client_timestamp": "2023-08-22T19:45:58.200Z",
"context": "AppStore"
}
And
{
"level": "error",
"message": "File preview blocked as preview failed to load REDACTED",
"sessionId": "REDACTED",
"viewSDKAppVersion": "3.2.4_3.2.0-bab76ff9",
"tenantId": "REDACTED",
"callingApp": "dc-view-sdk",
"externalUserId": "REDACTED",
"clientId": "REDACTED",
"client_timestamp": "2023-08-22T19:45:58.253Z",
"context": "App"
}
Our code is pretty standard I think based on the official documentation when dealing with a non url file, in our case from an API endpoint. the code has been working for months, its just started to happen this with no changes to the way this has been working.
Our fetch code looks like:
const fetchPDF = (id: string, title: string, pages: number) => {
fetch(`/api/pdf/${id}`)
.then((response) => response.blob())
.then((blob) => {
const reader = new FileReader();
reader.onloadend = (e) => {
const filePromise = Promise.resolve(e.target?.result)
previewPDF(filePromise, title, pages)
}
reader.readAsArrayBuffer(blob)
})
}
previewPDF function:
const previewPDF = (filePromise: any, title: string, pages: number) => {
const adobeDCView = new AdobeDC.View({
clientId: config.adobeApiKey,
divId: `adobe-dc-view-${props.id}`,
})
adobeDCView.previewFile(
{
content: {
promise: filePromise,
},
metaData: { fileName: title },
},
{
embedMode:
props.mode.toLowerCase() === 'lightbox' ? 'LIGHT_BOX' : 'IN_LINE',
exitPDFViewerType:
props.mode.toLowerCase() === 'lightbox' ? 'CLOSE' : 'RETURN',
showPrintPDF: true,
defaultViewMode: pages > 1 ? 'FIT_PAGE' : 'FIT_WIDTH',
}
)
}
I have a pdf file in version 1.4 that cannot copy the content (text) of the file when it is opened by the component. I have already opened the file locally (Adobe Reader DC) and there it is possible to copy the content (text), I also opened the file in the browser (Chrome) and also allows copying the content of the file (text).
This pdf is generated by pdf sharp core ( https://github.com/ststeiger/PdfSharpCore ) v1.3.32.
The uploaded document and pdf-emdeb viewer document should be same.
pdf-emded viewer document is not matching with uploaded document
Original Document Before uploading to pdf-emded viewer
Total number of pages is 38
maa_human_v1.19.0.2_Result.pdf
PDF Document after viewed in PDF-emdeb viewer and downloaded
Total no of pages is 28 pages
In Viewer content are getting overlap
Hello All
is there some documentation or example regarding Measurement tool?
I need to measure the distance between two (or more) points and measure the area.
Thanks.
Does Adobe Embed API have anyway of handling postMessage api requests?
Updating FreeText type of annotation
Disappearing FreeText annotation and got an error in console "Cannot read properties of undefined (reading 'color')"
download source code
$ git clone https://github.com/adobe/pdf-embed-api-samples.git
open index.html
$ cd pdf-embed-api-samples/More\ Samples/PDF\ Annotations\ APIs/CRUD\ APIs/
$ google-chrome index.html
Drag and drop FreeText or Change the color FreeText.
Tested a "I added a text annotation!" from page 2
Disappear FreeText and got an error in console "Cannot read properties of undefined (reading 'color')"
viewSDKAppVersion: 2.31.1_3.1.1-ef137c6f
[
{
"level": "error",
"message": "TypeError: Cannot read properties of undefined (reading 'color')\n at FreeTextCommentView.initializeValues (https://documentservices.adobe.com/dc-comments-dropin/2.31.1_1.940.0/bootstrap.js:2:2417979)\n at FreeTextCommentView.render (https://documentservices.adobe.com/dc-comments-dropin/2.31.1_1.940.0/bootstrap.js:2:2430391)\n at Object.allowStateChanges (https://documentservices.adobe.com/dc-core/2.31.1/dc-mobx.js:16:53236)\n at https://documentservices.adobe.com/dc-core/2.31.1/dc-mobx.js:1:10132\n at Yt (https://documentservices.adobe.com/dc-core/2.31.1/dc-mobx.js:16:45501)\n at e.track (https://documentservices.adobe.com/dc-core/2.31.1/dc-mobx.js:16:48113)\n at FreeTextCommentView.l [as render] (https://documentservices.adobe.com/dc-core/2.31.1/dc-mobx.js:1:10063)\n at gi (https://documentservices.adobe.com/dc-core/2.31.1/dc-core.js:2:71411)\n at fi (https://documentservices.adobe.com/dc-core/2.31.1/dc-core.js:2:71206)\n at uo (https://documentservices.adobe.com/dc-core/2.31.1/dc-core.js:2:107112) [object Object]",
"sessionId": "c6cacf76-6e70-4267-b22d-4d1c3213a38c",
"viewSDKAppVersion": "2.31.1_3.1.1-ef137c6f",
"tenantId": "http://localhost:8000",
"callingApp": "dc-view-sdk",
"externalUserId": "http://localhost:8000/xxxxx/xxxxx/xxx/xxxxx/xxx/xxxxxx",
"clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"client_timestamp": "2022-11-25T02:14:10.332Z",
"context": "ErrorBoundary",
"dropinId": "dc-comments",
"adb.event.context.AcrobatJS.isModernViewer": true
}
]
Hello
I'm from Vietnam. I want to translate adobe pdf embed api to vietnamese because my language dont support on locale setting
Do you have any solutions
Is it possible to allow the rotation of PDFs via a button? And if not are there any plans to support the addition of a rotate PDF button?
Could you please take some time in the next few days to make changes to some terminology in your repos and content as much as is possible:
If you cannot remove the term because the writing for example reflects the UI or the code, please make a note and send me an email to [email protected] so we can bring it that team’s attention. Thanks for your efforts in this matter.
Hello.
Is it possible to disable the download button?
if yes, How can we do that?
Hi, sorry my english is not perfect, not a web developper, only searching a solution to fix an iOS13+ browser change in behaviour regarding PDF file.
Application is Filemaker Go on iPhone/iPad, so it will use the Safari browser to view web document.
view the pdf file
error, can't preview
File preview error, not available reload to try again
Use a source file hosted by a Virtual File Service like HFS from Rejetto https://rejetto.com/hfs/
iOS14 Safari, Win10 Chrome
The demo code from https://www.adobe.io/document-services/apis/pdf-embed/
The demo file works,
I got my API key, test the demo file on my website.
Test the demo code and my key with a PDF hosted on my website, all work
The only probleme is the .js is not waiting or asking properly
The log show a request for data, the web page indicate error and the VFS never send the file.
Spoke with the dev of HFS and it as to do with request/answer/expectation of the .js that is the cause.
That same URL enter in any web browser will download the file right away, so the VFS is not the issue.
Thanks
Use jquery getScript() to load the API at run time when needed, the script is loaded and the adobe_dc_view_sdk.ready
event is fired.
An unhandled javascript exception occurs: TypeError: Cannot read properties of undefined (reading 'src') at loadSDKScript
https://jsfiddle.net/redtopia/o3m689sg/6/ (view the console to see the exception)
The following fiddle fixes the issue by loading the script with vanilla javascript
Since latest release today 13th of March using the pdfEmbedAPI using addAnnotationsInPDF function results in the annotation added twice on any given PDF, issue happening on all browsers and accross operating systems (tested on Macos, Linux, Windows)
Every type of PDF is causing the issue and its consistent on both our application and the example repository provided by Adobe https://github.com/adobe/pdf-embed-api-samples
Using addAnnotationsInPDF adds an annotation a single time
addAnnotationsInPDF is adding the annotation twice
Code to replicate:
Pull the latest release of the PDFEmbed api sample
On https://github.com/adobe/pdf-embed-api-samples/blob/master/More%20Samples/React%20Samples/src/sample... override this function to delete and all back all markers
onFileUpload = event => {
event.persist();
this.viewSDKClient.ready().then(() => {
const files = event.target.files;
if (files.length > 0 && this.isValidPDF(files[0])) {
const fileName = files[0].name;
const reader = new FileReader();
reader.onloadend = e => {
const filePromise = Promise.resolve(e.target.result);
/* Helper function to render the file using PDF Embed API. */
viewSDKClient
.previewFileUsingFilePromise(
"pdf-div",
filePromise,
fileName,
previewConfig
)
.then((adobeViewer) => {
adobeViewer.getAnnotationManager().then((annotationManager) => {
annotationManager
.removeAnnotationsFromPDF()
.then((result) => {
annotationManager
.addAnnotationsInPDF(result["annotations"])
.then((result) => {
console.log(result);
})
.catch((error) => console.log(error));
})
.catch((error) => console.log(error));
});
});
};
reader.readAsArrayBuffer(files[0]);
}
});
}
Upload the provided PDF
Make a simple change to trigger download
Download new PDF with duplicated annotations
Latest version all platforms and modern web browsers
None observerd
Open 1st pdf file via , passing the file as URL (URL.createObjectURL()) to
this.AdobeDCView.previewFile({content: {location}, metaData: {fileName, id}}, viewerConfig);
It render correctly.
Open 2nd pdf file via <input, same steps as above; it eventually calls AdobeDCView.previewFile with a different URL, expected to see the new pdf file rendered.
It's the 1st pdf rendered in iframe.
Is there a way to enforce refreshing the pdf files?
Hi,
Not sure where else to ask this, but I've searched the API extensively, and so far it doesn't seem like we can get the contents of an annotation? For example, if I highlight a text block, I can't access the raw text highlighted through the annotation manager. I can only get access to the bounding rectangle.
Is there something planned in the future that will enable this behaviour?
Unable to view the print and download buttons on Chrome using iPhone/iPad.
<!-- /.panel-heading -->
<div class="panel-body">
<div id="renderPDF">
<div id="adobe-dc-view" style="width: 100%;"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
</div>
</div>
<!-- /.panel-body -->
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function () {
var adobeDCView = new AdobeDC.View({ clientId: "<CLIENT_ID>", divId: "adobe-dc-view" });
adobeDCView.previewFile({
content: { location: { url: "example.pdf" } },
metaData: { fileName: "example" }
}, { embedMode: "IN_LINE", showDownloadPDF: true, showPrintPDF: true });
});
</script>
This application domain (https://xxxx) is not authorized to use the provided PDF Embed API Client ID.
For the given annotations to be added to a Document on preview file.
Annotations are not being added intermittently. Sometimes they are added and sometimes it fails. It fails most of the times.
I've encountered this error when using:
annotationManager.addAnnotations(annotations);
PDF Embed API
<script>
var document_data = [{
"@context": [
"https://www.w3.org/ns/anno.jsonld",
"https://comments.acrobat.com/ns/anno.jsonld"
],
"id": "408abbe1-7b68-8c17-19h1-5a7aba9c891",
"type": "Annotation",
"motivation": "commenting",
"bodyValue": "Hi",
"target": {
"source": "6d07d124-ac85-43b3-a867-36930f502ac6",
"selector": {
"node": {
"index": 0
},
"opacity": 0.4,
"subtype": "note",
"boundingBox": [
578.1040491761639,
825.4109275434271,
595.711279100311,
842.0399780273438
],
"strokeColor": "#fccb00",
"type": "AdobeAnnoSelector"
}
},
"creator": {
"id": "LMF-2",
"name": "LMF-2",
"type": "Person"
},
"created": "2022-09-27T13:11:27Z",
"modified": "2022-09-27T13:11:27Z"
},{
"@context": [
"https://www.w3.org/ns/anno.jsonld",
"https://comments.acrobat.com/ns/anno.jsonld"
],
"id": "8b9cb9db-e5a4-87ba-2ch7-6b18fabeba2",
"type": "Annotation",
"motivation": "commenting",
"bodyValue": "Test",
"target": {
"source": "6d07d124-ac85-43b3-a867-36930f502ac6",
"selector": {
"node": {
"index": 0
},
"opacity": 0.4,
"subtype": "note",
"boundingBox": [
384.42452001054556,
530.0007365938475,
402.0317499346927,
547.6079665179946
],
"strokeColor": "#fccb00",
"type": "AdobeAnnoSelector"
}
},
"creator": {
"id": "LMF-2",
"name": "LMF-2",
"type": "Person"
},
"created": "2022-09-27T13:12:04Z",
"modified": "2022-09-27T13:12:04Z"
},{
"@context": [
"https://www.w3.org/ns/anno.jsonld",
"https://comments.acrobat.com/ns/anno.jsonld"
],
"id": "0aa999a7-9f5e-841f-02h9-fa094884abd",
"type": "Annotation",
"motivation": "commenting",
"bodyValue": "",
"target": {
"source": "6d07d124-ac85-43b3-a867-36930f502ac6",
"selector": {
"node": {
"index": 0
},
"quadPoints": [
168.85789087681306,
485.1357995831707,
314.6897057249698,
485.1357995831707,
168.85789087681306,
476.5010210724246,
314.6897057249698,
476.5010210724246,
313.7302858904425,
485.1357995831707,
565.0982825366074,
485.1357995831707,
313.7302858904425,
476.5010210724246,
565.0982825366074,
476.5010210724246,
28.78259503582041,
476.5010210724246,
235.05785945920002,
476.5010210724246,
28.78259503582041,
468.82566239620576,
235.05785945920002,
468.82566239620576
],
"opacity": 0.4,
"subtype": "highlight",
"boundingBox": [
168.85789087681306,
485.1357995831707,
235.05785945920002,
468.82566239620576
],
"strokeColor": "#fccb00",
"type": "AdobeAnnoSelector"
}
},
"creator": {
"id": "LMF-2",
"name": "LMF-2",
"type": "Person"
},
"created": "2022-09-27T13:17:16Z",
"modified": "2022-09-27T13:17:16Z"
},{
"@context": [
"https://www.w3.org/ns/anno.jsonld",
"https://comments.acrobat.com/ns/anno.jsonld"
],
"id": "5298b8d4-3e27-85a3-92hc-3949dbbe8be",
"type": "Annotation",
"motivation": "commenting",
"bodyValue": "hi",
"target": {
"source": "6d07d124-ac85-43b3-a867-36930f502ac6",
"selector": {
"node": {
"index": 0
},
"opacity": 0.4,
"subtype": "note",
"boundingBox": [
578,
825.0399780273438,
595,
842.0399780273438
],
"strokeColor": "#fccb00",
"type": "AdobeAnnoSelector"
}
},
"creator": {
"id": "LMF-2",
"name": "LMF-2",
"type": "Person"
},
"created": "2022-09-27T13:34:59Z",
"modified": "2022-09-27T13:34:59Z"
},];
const annotations = document_data;
/*
Copyright 2020 Adobe
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in
accordance with the terms of the Adobe license agreement accompanying
it. If you have received this file from a source other than Adobe,
then your use, modification, or distribution of it requires the prior
written permission of Adobe.
*/
var viewerConfig = {
/* Enable commenting APIs */
enableAnnotationAPIs: true, /* Default value is false */
embedMode: "FULL_WINDOW",
};
/* Wait for Adobe Document Services PDF Embed API to be ready */
document.addEventListener("adobe_dc_view_sdk.ready", function () {
const eventOptions = {
listenOn: [
"ANNOTATION_ADDED", "ANNOTATION_CLICKED",
"ANNOTATION_UPDATED", "ANNOTATION_CLICKED",
"ANNOTATION_DELETED", "ANNOTATION_CLICKED",
]
}
const profile = {
userProfile: {
name: 'LMF-2',
}
};
/* Initialize the AdobeDC View object */
var adobeDCView = new AdobeDC.View({
/* Pass your registered client id */
clientId: "xxxx",
/* Pass the div id in which PDF should be rendered */
divId: "adobe-dc-view",
});
/* Invoke the file preview API on Adobe DC View object and return the Promise object */
var previewFilePromise = adobeDCView.previewFile({
/* Pass information on how to access the file */
content: {
/* Location of file where it is hosted */
location: {
url: "https://some.domain.com/public/somefile.pdf",
/*
If the file URL requires some additional headers, then it can be passed as follows:-
header: [
{
key: "<HEADER_KEY>",
value: "<HEADER_VALUE>",
}
]
*/
},
},
/* Pass meta data of file */
metaData: {
/* file name */
fileName: "somefile.pdf",
/* file ID */
id: "6d07d124-ac85-43b3-a867-36930f502ac6"
}
}, viewerConfig);
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
});
});
},
{});
/* Use the annotation manager interface to invoke the commenting APIs*/
previewFilePromise.then(function (adobeViewer) {
adobeViewer.getAnnotationManager().then(function (annotationManager) {
annotationManager.registerEventListener(
function(event) {
var status = true;
for (let i = 0; i < annotations.length; i++) {
if(annotations[i].id == event.data.id){
status = false;
}
}
if(event.type == "ANNOTATION_DELETED" || event.type == "ANNOTATION_UPDATED"){
status = true;
}
// "ANNOTATION_UPDATED", "ANNOTATION_CLICKED",
if(status) {
console.log(event);
console.log('qawsed');
var workflow_id = $('.workflow_id').val();
var document_data = JSON.stringify(event.data, null, 2);
// var document_data = event.data;
$.ajax({
url : base_url+'/correspondence/pdf-comment-save',
type : "post",
data: {
'_token' : csrf_token,
'data' : document_data,
'type' : event.type,
'workflow_id' : workflow_id
},
success : function(data){
var response = $.parseJSON(data);
if(response.status == true) {
showMessage('success',response.message);
} else {
showMessage('error',response.message);
}
}
});
}
},
eventOptions
);
/* API to add annotations */
annotationManager.addAnnotations(annotations)
.then(function () {
console.log("Annotations added through API successfully")
})
.catch(function (error) {
console.log(error)
// console.log('1');
});
/* API to get all annotations */
annotationManager.getAnnotations()
.then(function (result) {
console.log("GET all annotations", result)
})
.catch(function (error) {
console.log(error)
// console.log('2');
});
/* API to delete annotations based on annotation ID filter */
var filter = {
annotationIds: ["3adeae16-a868-4653-960e-613c048dddc5", "079d66a4-5ec2-4703-ae9d-30ccbb1aa84c"]
};
annotationManager.deleteAnnotations(filter)
.then(function () {
console.log("Deleted annotations based on annotation ID filter.")
})
.catch(function (error) {
console.log(error)
// console.log('3');
});
/* API to delete annotations based on page range filter */
filter = {
pageRange: {
startPage: 4,
endPage: 6
}
};
annotationManager.deleteAnnotations(filter)
.then(function () {
console.log("Deleted annotations based on page range filter")
})
.catch(function (error) {
console.log(error)
// console.log('4');
});
/* API to get annotations after deletion */
annotationManager.getAnnotations()
.then(function (result) {
console.log("GET annotations result after deleting annotations", result)
})
.catch(function (error) {
console.log(error)
// console.log('5');
});
});
});
});
</script>
I am trying to create a component and embed the pdf viewer inside it by passing the relevant pdf. However, all the examples using LINE_IN or SIZED_CONTAINER which seems appropriate to my use-case needs an element ID that is accessible from the main DOM. However, I would like it contained within my component viz. shadowDOM. Is there a way of specifying the DivId by a element instead of an Id? If so, I can pass the shadowDom element object to the AdobeDC class
Thanks
Any checkbox groups in a PDF select the entire group when one is clicked. Is this a problem with the design of the PDF, or an issue with the Full Window mode web viewer? Happens on mac with chromium based browser.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.