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

Annotations on PDF Embed API not working on some tablets

Community Beginner ,
Feb 18, 2025 Feb 18, 2025

Hello, I'm trying to get annotations to work on a PDF Embed API implementation.  The documentation says that in FULL_WINDOW mode it should work on Chrome and Safari on Tablets.  I've tried on multiple Android tablets using Chrome, and none of them have the annotation tools pop up, however they pop up fine on a standard PC, on an iPad Pro, and on a Surface Tablet.  Am I doing something wrong?  Or is the documentation inaccurate, and Chrome on Android is not supported for annotations?

My script is below.  There are other things on the page as well, including the DIV called 'adobe-dc-view' which appears to be standard, but this is the relevant script for embedding the PDF with annotations capacity.

 

Any advice is welcome.

 

<script src="https://acrobatservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
	const previewConfig = {
			embedMode: "FULL_WINDOW",
			showDownloadPDF: false,
			showPrintPDF: false,
			showAnnotationTools: true,
			enableAnnotationAPIs: true,
			includePDFAnnotations: true,
			showFullScreenViewButton: true
		};
	const saveOptions = {
			autoSaveFrequency: 0,
			enableFocusPolling: false,
			showSaveButton: true
		};
	
	document.addEventListener("adobe_dc_view_sdk.ready", function(){ 
		var adobeDCView = new AdobeDC.View({clientId: "HIDDEN FOR SECURITY", divId: "adobe-dc-view"});
		adobeDCView.registerCallback(
			AdobeDC.View.Enum.CallbackType.SAVE_API,
			function(metaData, content, options) {
				var uint8Array = new Uint8Array(content);
				var blob = new Blob([uint8Array], { type: 'application/pdf' });
				formData = new FormData();
				<<FORM INFORMATION I SEND>>;
				fetch("https://my.url/i-use-for-saving",{
					method: 'POST',
					body: formData,
				})
					.then(
						function (response) {
							if (response.status == 200) {
								console.log(response.body);
							}
						}
					)

				return new Promise((resolve, reject) => {
					resolve({
						code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS,
						data: {
							metaData: {
								fileName: "PDFFILE.pdf",
								id: "fancy-id"
							}
						}
					});
				});
			},
			saveOptions
		);
		adobeDCView.previewFile({
			content:{location: {url: "https://originalpdffile.pdf"}},
			metaData: {
				fileName: "THEPDF.pdf",
				id: "fancy-id"
			}
		}, previewConfig)
			.then(adobeViewer => {
				adobeViewer.getAnnotationManager().then(annotationManager => {
					annotationManager.setConfig({downloadWithAnnotations: true})
					annotationManager.startAnnotationMode('shape',{
						defaultColor: "#000000",
						cursor: "crosshair",
						strokeWidth: 2
					});
					annotationManager.registerEventListener(
						function(event) {
							annotationManager.startAnnotationMode('shape',{
								defaultColor: "#000000",
								cursor: "crosshair"
							});
						}, {
							listenOn: [ AdobeDC.View.Enum.AnnotationEvents.ANNOTATION_MODE_ENDED ],
							enableAnnotationEvents: true
						}
					);
				});
			});
	});

</script>

 

TOPICS
PDF Embed API
82
Translate
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
Community Beginner ,
Feb 18, 2025 Feb 18, 2025
LATEST

For added context, I have also now tried with Chrome Beta and even Edge for Android, neither with success.  The Annotation tools simply do not appear.  Yet it works on an iPad.  The assertion that it would work on Chrome was a big reason I spent the hours necessary to learn how to use this API.  I'm really hopeful I've just missed something.

Translate
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