Git Product home page Git Product logo

filepond-plugin-pdf-preview's People

Contributors

adri-glez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

filepond-plugin-pdf-preview's Issues

IE / Firefox / Chrome compatibility

Hi guys,

Not really an issue but more a question regarding pdfComponentExtraParams correct usage.

I'm trying to display PDF in a filepond instance.
I'm working on Vue2 with the following dependencies

"filepond": "^4.30.4"
"filepond-plugin-pdf-preview": "^1.0.4"

In a page component I setup the filepond as follows :

<setup>
    ...

    // Import FilePond component 
    import vueFilePond, { setOptions } from "vue-filepond";
    // Import FilePond styles
    import "filepond/dist/filepond.min.css";
    // Import FilePond plugins
    import "filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.css";

    // Create filepond 
    const FilePond = vueFilePond(FilePondPluginPdfPreview);
    setOptions({
         allowPdfPreview: true,
         pdfComponentExtraParams: 'toolbar=0&view=fit&page=1'
    });

    ...
</setup>

Also I want 3 PDF inlines so :

<style>
    .filepond--item {width: calc(33% - 0.5em);}
</style>

Now the problem I'm having is the following with Firefox and Internet Explorer : the view=fit doesn't work.
Firefox (don't see the bottom of the PDF)
Firefox
Microsoft Edge (I don't see much of the PDF)
MicrosoftEdge
And what I'd like is to have the exact same result as the one obtained in Chrome
chrome

Am I doing something wrong ?

Could not read from remote repository

$ npm install adriglez/filepond-plugin-pdf-preview

npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://[email protected]/adriglez/filepond-plugin-pdf-preview.git
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.

Firefox Display Issue

I am running your demo on a Windows 10 machine using Firefox version 92.0 (64 Bit) and am having issues with the following overlay appearing:

image

Can your plugin disable this overlay?

Thanks,

Scott

Uncaught TypeError: Cannot read property 'file' of null

Describe the bug
Using vue-filepond with the pdf preview plugin, sometimes the stacktraced error occurs on route change.

To Reproduce

  1. Uploading an image
  2. Waiting for it to succeed
  3. Navigating away from the current route
  4. Going back to upload view
  5. Remove current image
  6. Upload new image
  7. Navigate away from current route

Expected behavior
No console TypeError.

Stacktraces

Uncaught TypeError: Cannot read property 'file' of null
    at filepond-plugin-pdf-preview.js:181
    at filepond.js:1445
    at filepond.js:1096
    at Array.forEach (<anonymous>)
    at Object._write (filepond.js:1095)
    at filepond.js:1125
    at Array.forEach (<anonymous>)
    at Object._write (filepond.js:1123)
    at filepond.js:1125
    at Array.forEach (<anonymous>)

Information about your project:
Windows 10
Google Chrome - Version 89.0.4389.90 (64-Bit)

"filepond": "^4.21.1"
"filepond-plugin-file-encode": "^2.1.9"
"filepond-plugin-image-preview": "^4.6.4"
"filepond-plugin-file-validate-type": "^1.2.6"
"filepond-plugin-image-transform": "^3.7.6"
"filepond-plugin-pdf-preview": "^1.0.2"
"filepond-plugin-file-validate-size": "^2.2.4"
"vue-filepond": "^6.0.3"

Additional context
I tried "resolving/catching" this error in the beforeDestroy() life-cycle hook of the component holding vue-filepond, but the this.$refs is already undefined at that point.

How to display the full screen on PDF HTML

Hello @Adri-Glez , thank you for sharing this plugin!

I'm glad I read the README document and started using it and it worked, but I have a problem:
my PDF preview page does not show the full-screen button, unlike your recDemoPdfFullPage2.gif in the README document.
image

How do I set the full-screen button to show?

My operating environment: macOS,Chrome lasted Version

Looking forward to your reply, thank you!

Typescript definition?

Hi,

Any way you could add the typescript definition to the package?

It should be very straightforward with rollup

Upload Complete not turning green

When using the default minified css style (from the CDN), the preview seems to work fine, and also the name of the file and the "Uploading xx%" and later the "Upload complete" messages. But the green overlay that appears when a file is correctly uploaded does not appear in the previewed PDF, even though it seems to work fine on the image preview.

Screen Shot 2021-09-13 at 08 36 39

Here is my CSS section:

<!-- Filepond -->

       <link href="https://unpkg.com/filepond@^4/dist/filepond.css" rel="stylesheet" />
       <link
       href="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css"
       rel="stylesheet"
   />
       <link href="https://unpkg.com/filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.min.css" rel="stylesheet">

<style>
       /**
       * FilePond Custom Styles
       */
      .filepond--drop-label {
          color: #4c4e53;
      }

      .filepond--label-action {
          text-decoration-color: #babdc0;
      }

      .filepond--panel-root {
          border-radius: 2em;
          background-color: #edf0f4;
          height: 1em;
      }

      .filepond--item-panel {
          background-color: #595e68;
      }

      .filepond--drip-blob {
          background-color: #7f8a9a;
      }


      /**
       * Page Styles
       */
      html {
          padding:30vh 0 0;
      }

      body {
          max-width: 20em;
          margin: 0 auto;
      }
</style>

I have these Javascripts:

       <script src="https://unpkg.com/filepond@^4/dist/filepond.js"></script>
        <script src="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.js"></script>
        <script src="https://unpkg.com/filepond-plugin-file-encode/dist/filepond-plugin-file-encode.js"></script>
        <script src="https://unpkg.com/filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.js"></script>
        <script src="https://unpkg.com/filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.js"></script>
        <script src="https://unpkg.com/filepond-plugin-file-rename/dist/filepond-plugin-file-rename.js"></script>
        <script src="https://unpkg.com/filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.js"></script>
        <script src="https://unpkg.com/filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.min.js"></script>

This is the input component being called

<input type="file"
    class="filepond"
    name="filepond"
    multiple
    data-allow-reorder="true"
    data-max-file-size="100MB"
    data-max-files="20"
    credits="false" />

And this is FilePond being initialized:

<script>

FilePond.registerPlugin(

	// encodes the file as base64 data
  FilePondPluginFileEncode,

	// validates the size of the file
	FilePondPluginFileValidateSize,

	// corrects mobile image orientation
	FilePondPluginImageExifOrientation,

	// previews dropped images
  FilePondPluginImagePreview,

  // renames
  FilePondPluginFileRename,

  // Validates filetypes
  FilePondPluginFileValidateType,

  // Preview PDFs
  FilePondPluginPdfPreview
);

FilePond.setOptions(
    {
// FIXME Chunked upload are resulting in a HTTP 400 error
//        chunkUploads: true,
//            chunkSize: 50000,
	    	server: {
	    		url: 'http://localhost:8000/fp',
	    		process: '/process/',
	    		patch: '/patch/',
	    		revert: '/revert/',
	    		fetch: '/fetch/?target='
	    	}
    }


);

    // Get a reference to the file input element
    const inputElement = document.querySelector('input[type="file"]');

    // Create a FilePond instance
    const pond = FilePond.create(inputElement);

</script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.