0

Currently have this code in my react app that allows the user to export to PDF some html code

const PrintButton = ({button, children, showPreview, filename}) => {
    const ref = useRef(null);
    const exportPDFWithComponent = () => {
        if (ref.current) {
            ref.current.save();
        }
    };

    return (
        <div>
            <AccessibleDivButton onClick={exportPDFWithComponent}>{button}</AccessibleDivButton>

            <PDFExport
                ref={ref}
                forcePageBreak={"." + styles.pageBreak}
                paperSize="auto"
                fileName={filename}
            >
                <div className={classNames(styles.container, { [styles.showPreview]: showPreview})}>
                    {children}
                </div>
            </PDFExport>

        </div>
    )
}

However, the code doesnt work in mobile (iOs safari). I read here : https://www.telerik.com/kendo-react-ui/components/drawing/limitations-browser-support/ that it is not supposed to work in mobile due to some reasons, however, the demo in the getting started page : https://www.telerik.com/kendo-react-ui/components/pdfprocessing/get-started/ works fine on my Iphone. Am I doing something wrong? Any help is appreciated

0 Answers0