Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exportComponentAsPDF creates corrupted JPEG file in Chrome and Safari, Firefox works fine #76

Open
guerchen opened this issue Jun 11, 2023 · 0 comments

Comments

@guerchen
Copy link

Greetings!

I've come across a weird bug that, when using exportComponentAsPDF , my component is exported in jpeg format and the file is corrupted. As far as I've tested, this behavior happens in all browsers except for Firefox. My implementation is as following:

import { exportComponentAsPDF } from 'react-component-export-image';
...
<Button
                    className='DownloadBtn'
                    onClick={()=>{exportComponentAsPDF(stickerRef,{fileName: `${id}.jpeg`,pdfOptions:{pdfFormat: 'a6',w:105,h:148,unit:'mm'}})}}>
                Baixar etiqueta
                </Button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant