• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Annotation APIs not enabled.

New Here ,
Sep 23, 2024 Sep 23, 2024

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>

 

Views

310

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 23, 2024 Sep 23, 2024

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 23, 2024 Sep 23, 2024

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 !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 23, 2024 Sep 23, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 23, 2024 Sep 23, 2024

Copy link to clipboard

Copied

Please can you guide me toward the right API and documentation ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 23, 2024 Sep 23, 2024

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources