ovvn/dom-to-pdf

Image is not displaying in PDF

nagoorbilal opened this issue · 5 comments

<div id="divPdfReport" ref={pdfref} className='pdfPaged1' > <img src={ClientRight} style={{width:'160px'}}/> </div>

var element = document.getElementById('divPdfReport');

         domToPdf(element, function(pdf) {
         console.log('done');
      });

imgnotdisplaying.pdf

The Image is showing in browser but not showing in pdf

ovvn commented

How does the image source look like, is ClientRight a path to image? Is the image stored on a different domain? Do you see CORS errors in a browser console when downloading a pdf?

There is no console error while downloading pdf ,i have import ClientRight image as well
The issue is still there can you give any solution...

ovvn commented

Try to specify a path to the image (e.g. http://your-domain.com/image.jpg) or base64 encoded string as the image source.

yes, it's working on base64 format , Thanks @ovvn