0.5.15 • Published 2 months ago

@evilflowers/evilflowersviewer v0.5.15

Weekly downloads
-
License
-
Repository
-
Last release
2 months 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.5.14

2 months ago

0.5.15

2 months ago

0.5.12

3 months ago

0.5.13

3 months ago

0.5.4

5 months ago

0.5.3

5 months ago

0.5.6

5 months ago

0.5.5

5 months ago

0.5.0

5 months ago

0.5.2

5 months ago

0.5.1

5 months ago

0.5.8

4 months ago

0.5.7

4 months ago

0.5.9

4 months ago

0.4.24

7 months ago

0.4.25

7 months ago

0.4.20

8 months ago

0.4.21

8 months ago

0.4.19

8 months ago

0.4.18

10 months ago

0.4.9

1 year ago

0.4.8

1 year ago

0.3.9

1 year ago

0.4.10

1 year ago

0.4.17

1 year ago

0.4.15

1 year ago

0.4.16

1 year ago

0.4.13

1 year ago

0.4.14

1 year ago

0.4.11

1 year ago

0.4.12

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.4.5

1 year ago

0.3.6

1 year ago

0.4.4

1 year ago

0.3.5

1 year ago

0.4.7

1 year ago

0.3.8

1 year ago

0.4.6

1 year ago

0.3.7

1 year ago

0.4.1

1 year ago

0.3.2

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.4.3

1 year ago

0.3.4

1 year ago

0.4.2

1 year ago

0.3.3

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.0

2 years ago