Copy link to clipboard
Copied
How get page width and height?
const view100ProcentWidth =(viewWidth/zoom) + (viewWidth/zoom)/3 + scrollbarWidth;
and get a real 100% zoom.
Code that takes width and sets 100% width:
document.querySelector("#adobe-dc-view").style.setProperty("height
...
Copy link to clipboard
Copied
You can't currently get the page dimensions with Embed API. What exactly are you trying to accomplish? There might be a work around.
Copy link to clipboard
Copied
I want do this:
https://community.adobe.com/t5/document-services-apis/how-set-zoom-100/m-p/11442696#M683
and ultimately this:
Then I could calculate the zoom and height to know how to position the container so that the document has a 100% zoom.
Copy link to clipboard
Copied
const view100ProcentWidth =(viewWidth/zoom) + (viewWidth/zoom)/3 + scrollbarWidth;
and get a real 100% zoom.
Code that takes width and sets 100% width:
document.querySelector("#adobe-dc-view").style.setProperty("height", "50px");
const zoom = await apis.getPageZoom(1);
document.querySelector("#adobe-dc-view").style.removeProperty("height");
const viewWidth = document.querySelector("#adobe-dc-view").clientWidth-scrollbarWidth;
const view100ProcentWidth = (viewWidth/zoom)+scrollbarWidth;
console.log("view100ProcentWidth",view100ProcentWidth);
document.querySelector("#adobe-dc-view").style.width = `${view100ProcentWidth}px`;