I'm facing a significant problem with the Adobe Embed PDF API on mobile devices. Despite setting the default view mode to "FIT_WIDTH" in the preview configuration, the PDF width appears too small on phone screens. This issue is not encountered on desktops.
Google and Edge browsers adjust the PDF width perfectly on mobile devices when using their built-in PDF viewer.
Could you please provide guidance on resolving this issue? here is my code
const previewConfig = {
defaultViewMode: "FIT_WIDTH",
showDownloadPDF: false,
showZoomControl: true,
showAnnotationTools: false
}
var adobeDCView = new AdobeDC.View({ clientId: "your_id", divId: "adobe-dc-view" });
adobeDCView.previewFile({
content: { location: { url: pdfUrl } },
metaData: { fileName: pdfUrl }
}, previewConfig);
// Use PDF.js to read the name from the PDF
var loadingTask = pdfjsLib.getDocument(pdfUrl);
loadingTask.promise.then(function (pdf) {
pdf.getPage(1).then(function (page) { // Assuming the name is on the first page
page.getTextContent().then(function (textContent) {
});
});
}, function (reason) {
console.error(reason);
});