• PdfViewer component is responsible for rendering a PDF document within a React application. It utilizes the pdfjs-dist library to handle PDF rendering and provides a customizable viewer.

    Parameters

    • props: PropsWithChildren<
          HTMLAttributes<HTMLDivElement> & {
              pdfDocument?: PDFDocumentProxy;
              pdfScaleValue?: string;
              pdfViewerOptions?: PDFViewerOptions;
          },
      >

      Component props.

      • pdfDocument

        The PDF document to be displayed.

      • pdfViewerOptions

        Options for configuring the PDF viewer.

      • pdfScaleValue

        The scale value for the PDF viewer.

      • onScroll

        Callback function for handling scroll events.

      • children

        Child components to be rendered within the PDF viewer.

    Returns Element

    • Rendered PDF viewer component.
    <PdfViewer pdfDocument={pdfDoc} pdfScaleValue="1.5" onScroll={handleScroll} className="custom-pdf-viewer">
    <CustomComponent />
    </PdfViewer>