New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pdf-viewer-root

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf-viewer-root

a pdf reader can use for react or vue

latest
Source
npmnpm
Version
1.2.3
Version published
Maintainers
1
Created
Source

pdf-viewer-root

This library is based on @yangxuy/pdf-reader but has some new features

Setup:

yarn add pdf-viewer-root
npm i pdf-viewer-root

Usage

vue 2 / 3:


<template>
<pdf-viewer-root :url="url" />
</template>

<script>
import "pdf-viewer-root"
</script>

react:

import pdf from "./assets/1.pdf";
import "pdf-viewer-root";
import { useRef } from "react";
import React from "react";

function App() {
    const div = useRef<any>();

    return (
        <div className="App" ref={div}>
            {React.createElement("pdf-viewer-root", { url: pdf })}
        </div>
    );
}

export default App;

component attributes

attrdescriptiondefaultTypeNot working yet
urlLink to the file (you can send a blob)string
pagePage number, from 1 to infinity1number
modeDisplay mode if 1 shows by page. If 2 shows all pages at once1number
scalepdf size on screen. from 10 to 100100number-
dpiManages the quality300number-
onSuccessWhen the pdf is loaded, this event will be called-(pdf) => {}
onErrorWhen the pdf gives an error, this event will be called-(error) => {}
debugLog info in consolefalseboolean
loadingtextText in loadingComponent'loading'string

Keywords

shadow-root

FAQs

Package last updated on 20 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts