Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

img-pdf-viewer

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

img-pdf-viewer

Angular Image & PDF Viewer

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52
increased by62.5%
Maintainers
1
Weekly downloads
 
Created
Source

Description

Angular Image & PDF Viewer

Installation

Use node package manager npm to install package.

npm i img-pdf-viewer

Way to use

  1. import the package in app.module.ts like below and add it to imports array.

import { ImgPdfViewerModule } from 'img-pdf-viewer';

@NgModule({ imports: [ImgPdfViewerModule], })

export class AppModule {}

  1. Import ng2-pdfviewer like above and add it to imports section because it depends on this package. ng2-pdfviewer

  2. To pass config in app.component.ts you have to import DocPreviewConfig like below.

import { DocPreviewConfig } from 'img-pdf-viewer';

docPreviewConfig: DocPreviewConfig = {
    zoomIn: true,
    zoomOut: true,
    rotate: true,
    pageIndicator: true,
    download: true,
    openModal: true,
    close: false,
    docScreenWidth: '100%',
    modalSize: 'md',
    customStyle: '',

  };

  1. in you html (app.component.html)
<ngx-imgPdf-viewer
        [documentURL]="url"
        [docPreviewConfig]="docPreviewConfig"
      >
</ngx-imgPdf-viewer>

  1. Install bootstrap,ng-bootstrap and fontawesome
a).  ng add @ng-bootstrap/ng-bootstrap

b). fontawesome link

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css"
integrity="sha512-10/jx2EXwxxWqCLX/hHth/vu2KY3jCF70dCQB8TSgNjbCVAC/8vai53GfMDrO2Emgwccf2pJqxct9ehpzG+MTw=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>

c). bootstrap link

<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous"
/>
  1. Have a look at Demo
  2. sometimes if your file is not viewable try to enable CORS.

Keywords

FAQs

Package last updated on 21 Mar 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc