React PDF viewer
v1.6.0

Example: Replace the canvas with SVG layer

By default, each page is constructed by canvas, text, and annotation layers.

The sample code below replace the canvas with SVG layer:

import Viewer, { RenderPageProps } from '@phuocng/react-pdf-viewer';

const renderPage = (props: RenderPageProps) => {
    return (
        <>
            {props.svgLayer.children}
            {props.textLayer.children}
            {props.annotationLayer.children}
        </>
    );
};

<Viewer
    fileUrl="/path/to/document.pdf"
    renderPage={renderPage}
/>

(The sample code)

/ 8
90%

bbcParameters for Opening PDF FilesAdobe® Acrobat® SDK April 2007Version 8.1