🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ui5-cc-pdfviewer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ui5-cc-pdfviewer

A library with a PDF control that will show a PDF based on a base64 data uri

latest
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

UI5Lab Library PDFViewer

This is a fork of https://github.com/lemaiwo/UI5LabLibraryPDFViewer!

The PDFViewer is a custom UI5 control that enables you to view PDF's by using a base64 data uri instead of a file URL. This can be useful in case you want to preview a PDF that you want to upload without uploading it.

Demo

In folder test/pdfviewer, execute npm install and upload a PDF file. Then run npm start.

Usage

Include the library in your project

  • Install Control
npm install "ui5-cc-pdfviewer"
  • Configure the manifest.json
    "resourceRoots": {
      "cc.pdfviewer": "./thirdparty/cc/pdfviewer",
      "pdfjs-dist": "./thirdparty/cc/pdfviewer/pdfjs-dist/build"
    },
  • Use the PDF Control
<mvc:View controllerName="pdfviewer.controller.Main"
    xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
    xmlns="sap.m" xmlns:u="sap.ui.unified" xmlns:pdf ="cc.pdfviewer">
    <Page id="page" title="{i18n>title}">
        <content>
            <u:FileUploader id="upload" fileType="pdf" name="upload" tooltip="Upload your image" change="onFileChange" maximumFileSize="10" sameFilenameAllowed="true"></u:FileUploader>
            <Button text="Open PDF in dialog" press="onOpenPDFViewer"/>
            <pdf:PdfViewer id="pdfViewer" pdfSource="{/pdfsource}" height="700px"/>
        </content>
    </Page>
</mvc:View>

FAQs

Package last updated on 03 May 2023

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