0.4.21 • Published 10 days ago

@evilflowers/evilflowersviewer v0.4.21

Weekly downloads
-
License
-
Repository
-
Last release
10 days ago

EvilFlowersViewer

PDF Viewer based on pdf.js

Introduction

EvilFlowersViewer is a PDF viewer based on pdf.js library that allows users to view and interact with PDF documents directly in the browser. This project is being developed by a university team, and aims to provide a reliable and efficient PDF viewer that is easy to use and customize.

Features

  • PDF document rendering directly in the browser
  • Zoom in and out of documents
  • Page navigation through a page thumbnail view
  • Text search within documents
  • Share the entire document or with selected pages
    • Select wanted pages (1, 3-5, 10) or none (means whole document)
    • Choose lifespan expectancy (1 day, 7 days, 30 days)
    • Click on share where your function will take care of given inputs
    • Your function returns link for your shared document
    • Our viewer will generate QR Code of given link
  • Citation export in BibTeX, BibLaTeX, RIS and bibliography
  • Changing themes

Features Under Development

  • Annotation tools for highlighting and commenting on text
  • Editing with pen
  • and more...

Getting started

To get started with EvilFlowersViewer, follow these steps:

  1. Install EvilFLowersViewerPackage:
npm install @evilflowers/evilflowersviewer
  1. Update your project architecture (.json)
"architect": {
    "build": {
        "options": {
            "assets": [
                {
                    "glob": "**/*",
                    "input": "node_modules/@evilflowers/evilflowersviewer/dist/assets/",
                    "output": "/assets/"
                }
            ],
            "styles": [
                "node_modules/@evilflowers/evilflowersviewer/dist/style.css"
            ]
        }
    }
}
  1. Import the renderViewer function into your project:
import { renderViewer } from '@evilflowers/evilflowersviewer'
  1. Use renderViewer function:
renderViewer(rootId, base64, options)
InputDescription
rootIdid of your component where you use renderViewer func
base64string that contains base64 formatt of pdf
optionsnot required object consisting of theme, lang, citationBib, shareFunction
options.theme'dark' or 'light'
options.lang'sk' or 'en'
options.citationBibstring containing bib citation of given document examaple: '@article{name,\n ....}'
options.shareFunctiontype: (pages: string / null, expaireDate: string) => Promise
options.homeFunctiontype: () => void
shareFunction.pagesstring containing selected pages (1,3-6,10) or null (means it's empty)
shareFunction.expaireDatestring containing lifespan of shared document, the end. ISO
shareFunction => returnlink for your shared document as string

Examples

Examples of functions shareFunction and homeFunction

  1. shareFunction:
private shareFunction = async (pages: string | null, expireDate: string) => {
    // creat whatever object
    const yourObject = {
      range: pages,
      expires_at: expireDate,
    };
    let link = '';

    // yout endpoint
    await this.yourService
      .yourFunction(yourObject)
      .toPromise()
      .then((res) => {
        link = res.url;
      })
      .catch((err) => {
        console.log('Error:', err);
      });

    // returned your link
    return link;
  };
  1. homeFunction:
private homeFunction = () => {
    this.router.navigateByUrl('/path-to/whatever-you-want');
};

Contributing

We welcome contributions from the community to help make EvilFlowersViewer even better. To contribute, please follow these steps:

  1. Fork the EvilFlowersViewer repository
  2. Create a new branch for your changes
  3. Make your changes and commit them with a clear commit message
  4. Push your changes to your forked repository
  5. Create a pull request to merge your changes into the main EvilFlowersViewer repository

Acknowledgment

This open-source project is maintained by students and PhD candidates of the Faculty of Informatics and Information Technologies at the Slovak University of Technology. The software is utilized by the university, aligning with its educational and research activities. We appreciate the faculty's support of our work and their contribution to the open-source community.

npm.io

0.4.20

10 days ago

0.4.21

10 days ago

0.4.19

10 days ago

0.4.18

3 months ago

0.4.9

7 months ago

0.4.8

7 months ago

0.3.9

7 months ago

0.4.10

7 months ago

0.4.17

6 months ago

0.4.15

6 months ago

0.4.16

6 months ago

0.4.13

6 months ago

0.4.14

6 months ago

0.4.11

7 months ago

0.4.12

6 months ago

0.3.0

8 months ago

0.2.0

8 months ago

0.4.5

7 months ago

0.3.6

8 months ago

0.4.4

7 months ago

0.3.5

8 months ago

0.4.7

7 months ago

0.3.8

7 months ago

0.4.6

7 months ago

0.3.7

7 months ago

0.4.1

7 months ago

0.3.2

8 months ago

0.4.0

7 months ago

0.3.1

8 months ago

0.4.3

7 months ago

0.3.4

8 months ago

0.4.2

7 months ago

0.3.3

8 months ago

0.1.3

11 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.0

1 year ago