kendo-react-pdf-viewer : make pdf FitToWidth on load

1 Answer 208 Views
PDF Viewer
Surender
Top achievements
Rank 1
Surender asked on 25 Apr 2023, 07:54 AM | edited on 25 Apr 2023, 10:12 AM

I just want to set the default page width to 'fitToWidth' instead of 100% on page load. Below is the reference code:


import * as React from "react";
import { PDFViewer, PDFViewerTool } from "@progress/kendo-react-pdf-viewer";
import { SampleFileBase64 } from "./base64Sample";
export const DocumentViewer = (props: any) => {
    const pdfViewerTools: PDFViewerTool[] = ["pager", "spacer", "zoomInOut", "zoom", "selection", "search", "open", "download", "print"];
   
    return (
        <>
            <div>
                {<PDFViewer
                        data={SampleFileBase64}
                        defaultZoom={1}
                        style={{ height: 500 }}
                        tools={pdfViewerTools}
                    />
                }
            </div>
        </>
    )
}

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 26 Apr 2023, 11:13 AM

Hello, Surender,

Setting FitToWidth, ActualWidth, and FitToPage values to the `defaultZoom` prop is not possible at the moment, but we have an already logged enhancement for this feature, you can track its progress here: 

If we find a possible workaround, or if there is any progress on the issue, the GitHub item linked above will be directly updated.

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Surender
Top achievements
Rank 1
commented on 27 Apr 2023, 05:57 AM

Thanks Vessy, I will definitely track the progress.
Vessy
Telerik team
commented on 27 Apr 2023, 01:49 PM

You are welcome, Surender.
Tags
PDF Viewer
Asked by
Surender
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or