0.1.1 • Published 1 year ago

ui5-cc-pdfviewer v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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

  1. Install Control
npm install "ui5-cc-pdfviewer"
  1. Configure the manifest.json
    "resourceRoots": {
      "cc.pdfviewer": "./thirdparty/cc/pdfviewer",
      "pdfjs-dist": "./thirdparty/cc/pdfviewer/pdfjs-dist/build"
    },
  1. 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>
0.1.1

1 year ago

0.1.0

1 year ago

0.0.1

1 year ago