Copy link to clipboard
Copied
Hello guys.
I have a little problem with height of embed PDF. I mean the section of document is low, like on this image:
Could You help me and explain what's wrong with the code, which i inserted by "my own HTML" block on my wordpress site?
<title>Adobe Document Services PDF Embed API Sample</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1">
<div style="id="adobe-dc-view"></div>
<script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "5119059d51ba4d56b273cd92f50bde39", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://documentservices.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf"}},
metaData:{fileName: "Aktualne wydanie"}
}, {defaultViewMode: "FIT_WIDTH", showAnnotationTools: false, showDownloadPDF: false,
showPrintPDF: false});
});
</script>
Thank You.
Best Regards.
Copy link to clipboard
Copied
Can you use CSS to set the height of the DIV?
Copy link to clipboard
Copied
Hello. There is a problem with embed in elementor only, and nothing help to improve viewing, include CSS styles. Thank You for Your help.
Copy link to clipboard
Copied
Can you explain what Elementor is?
Copy link to clipboard
Copied
Elementor is a third party editor used along with Wordpress.
Copy link to clipboard
Copied
I guess don't use Elementor? If it prevents you from applying CSS to a div, then it's getting in the way.
Copy link to clipboard
Copied
I am also having this problem - can anyone help?
Copy link to clipboard
Copied
As I said before, this can be done with CSS. If you can't edit the CSS for some reason, try adding an inline style.
Copy link to clipboard
Copied
That doesn't make sense that Adobe would make everyone do that instead of having code that adjusted to the page of the PDF. I don't know how to add inline style for the correct size.
Copy link to clipboard
Copied
Using the sizing features of the web platform itself makes perfect sense. The web already has robust ways to control the size of elements built in - it wouldn't make sense for us to rebuild that. If you put a large PDF in an element sized smaller, it's not going to look good, but it doesn't make sense to just "grow" the div as that could break other parts of the page. You could consider getting the properties of the PDF and resizing then.
Copy link to clipboard
Copied
As a reminder, don't forget the Embed viewer has a button to go full screen, and we have the Lightbox mode. Also, In-Line mode will stretch the height automatically.
You've got many options here.