Copy link to clipboard
Copied
Hello community. Hope you are all fine.
I need your help because i'm keeping gettting "Promise { <state>: "rejected", <reason>: "Annotation APIs not enabled." }" .
My script aimed to retreive updated data from fillable PDF file. This is my scricpt.
<script src="https://acrobatservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function() {
let res=null;
var adobeDCView = new AdobeDC.View({clientId: "d146718832cf4e97afcd8b6e27fb967b", divId: "adobe-dc-view"});
adobeDCView.previewFile(
{
content: {location: {url: "pdf.pdf"}},
metaData: {fileName: "Bulletin d'adhésion ",id: "aeef47fe-c473-4a6c-9e78-ec23d7790837"}
},
{
embedMode: "FULL_WINDOW",
defaultViewMode: "FIT_PAGE",
enableLinearization: true,
showDownloadPDF: true,
showPrintPDF: true,
showLeftHandPanel: false,
showAnnotationTools: false,
enableFormFilling: true,
enableAnnotationAPIs: true,
includePDFAnnotations: true,
showPageControls: false,
showZoomControl: true,
showRotateControl: false,
disableTextSelection: true,
annotationManagerEditMode: "READ",
showBookmarks:false,
showThumbnails:false,
}
).then((r)=>{
r.getAnnotationManager().then(function(a) {
console.log(a);
a.getFormFields().then(function(f) {
console.log('Form Fields:', f);
const d = {};
f.forEach(r => {d[r.name] = r.value;});
console.log(d);
});
});
}).catch((e)=>{
// Here i got error Promise { <state>: "rejected", <reason>: "Annotation APIs not enabled." }
console.log('res',e);
});
document.getElementById('save-button').addEventListener('click', function() {
//Here i got adobeDCView.getAnnotationManager() is not a function
adobeDCView.getAnnotationManager().then(function(a) {
a.getFormFields().then(function(f) {
const d = {};
f.forEach(r => {d[r.name] = r.value;});
}).catch((e)=>{
console.log('e',e);
});
});
});
</script>
Copy link to clipboard
Copied
While I don't think it is being run - where do you see getFormFields() documented? I don't believe we expose that functionality.
Copy link to clipboard
Copied
Hello Raymond.
Thanks you for response.
So can you guide me to the right documentation ?
In my web application, user access a fillable PDF from your viewer. He fills the field then click on a button. The button action is to retreive all user's entered data and send it to our database.
Best regards !
Copy link to clipboard
Copied
We don't support that with Embed. We have APIs that let you set and read form fields, but that's not part of Embed.
Copy link to clipboard
Copied
Please can you guide me toward the right API and documentation ?
Copy link to clipboard
Copied
Shoot, forgot it is still in beta. You can see it documented here https://developer.adobe.com/document-services/docs/apis/#tag/Export-PDF-Form-Data and here - https://developer.adobe.com/document-services/docs/apis/#tag/Import-PDF-Form-Data. You can request access to these APIs here: https://developer.adobe.com/document-services/pricing/contact/sales/form-data-api/