Skip to content

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

@guerchen

Description

@guerchen

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions