Hi there,
I use pdf.js viewer.
Detailed description of issue
The PDF file is displayed without respecting the defined width:
style={{“width”:“1024px”,“height”:“600px”,“margin”:“0 auto”}}
Expected behaviour
Click here for the PHP page with PDF.JS snippet.
Does your issue happen with every document, or just one?
This happens for all PDF files.
Link to document
“Sorry, new users can only put 2 links in a post.”
emozioni.ch/assets/art/202203007.pdf
Code snippet
<div class="row">
<div class="col-sm-2">
<a href='<?php echo $NrPdf ?>' target="_blank">
<img src='<?php echo $Immagine ?>' style="width:100%">
</a>
</div>
<div class="col-sm-8">
<p>
<div id='articolo' style={{"width":"1024px","height":"600px","margin":"0 auto"}}></div>
<script>
WebViewer({
path: 'assets/z-js-pdf-viewer/lib',
licenseKey: 'arVby9MhRLuYsJFEjhf8',
initialDoc: '<?php echo $Articolo ?>',
}, document.getElementById('articolo'))
.then(instance => {
const docViewer = instance.docViewer;
const annotManager = instance.annotManager;
docViewer.on('documentLoaded', () => {
});
});
</script>
<br/>
<br/>
</p>
</div>
<div class="col-sm-2"></div>
<?php include 'assets/php/space.html';?>
<?php include 'assets/php/space-emozioni-violet.html';?>
<?php include 'assets/php/space.html';?>
</div>
Thanks a lot!
Marco