I am working on a website that has a need for a file uploader that integrates well with forms and potentially S3. Fine-uploader looks like a great fit for us. We will be, however, adding a PDF splitter/merger so users can drop one or more PDF files and pull specific pages out and send them as one document. I may need to find a separate JS library to render the PDF pages as image/thumbnails for interaction, but wondering/hoping fine-uploader could handle the page thumbnail rendering similarly to how it does so for image file, but giving a thumbnail for each PDF page.
Fine Uploader does not natively preview PDFs. If you'd like to generate previews for PDFs client-side, consider using a library specifically for that purpose. One possible choice is pdf.js. You can use Fine Uploader's API to get a handle on the PDF file (uploader.getFile(id)) and then pass this file off to pdf.js. Note that you may have to convert this file into a typed array first using FileReader.
Related
I have uploaded and downloaded files using PHP, I want to preview different types of files (images, videos, pdf, power point...)
Is there any free API like this http://filepreviews.io? And could I code it by myself?
You can use standard PHP mime_content_type function.
Look for its documentation here: http://php.net/manual/en/function.mime-content-type.php
It will NOT read the file itself, but will just return its mime-type based on file extension. I hope that will work for you.
I'm dealing with an IOS Ipad cordova app, it's a survey type app.
Once the user submits the survey, there are multiple images that I want to upload.
I'm using the ngcordova camera plugin to capture the images, I store the images as base64 DATA_URLS on $scope for the view to
I'm sending the server a HTML string for it to then create me a PDF of the HTML, including the images and then send it back to me as a base64 string.
This works for a small number of images, but there could potentially be 50-60 images uploaded when the survey is submitted, the base64 DATA_URLs of the images makes output HTML MASSIVE (as you'd expect).
This had led me to look at storing the captured images as FILE_URIs, it seems after researching that uploading multiple images as files isn't straightforward. I can't find any articles that solve the issue.
I've seen an approach that uses promises, to me this doesn't seem a good idea (due to the number of HTTP requests that would be fired), but I can't seem to find an alternative.
So how would I go about uploading the image files to my API?
I have since used a workaround for this using the HTML5 Canvas element.
I simply iterate over the image files captured from cordova, convert them to blobs using the canvas API, then POST the collection of blobs to my API.
Is it possible to use PDF.js without having the website online? I'm trying to do a simple offline website that reads pdf using pdf.js but it won't work without being online.
Anyone could help?
Yes absolutely you can use it offline. Download the latest version here.
Now extract the zip file and put it on a server(use xampp/wamp/lamp or any other localhost) because the worker is not enabled for file:// urls.
To show the pdf files traverse to web/viewer.html from the localhost and it should load its default pdf.
As to the question about how to show your pdf's use: viewer.html?file=relative/path/to/your/pdf
Say for example inside the web folder(the one in which viewer.html is there) of your pdf.js you create a directory say named pdfFiles and in it you add a pdf named say mypdf.pdf in it then to display it use: viewer.html?file=pdfFiles/mypdf.pdf and it will display it.
Look here for more details on how to dynamically assign PDF file paths to the viewer. If you have any other queries let me know. I have used pdf.js offline and it works wonderfully on almost all the browsers I know.
I created a webpage that fetches image urls using an external api and then displays them on the page. Now i want the end user to be able to download these images all at once. Since these images do not exist on my sites server, i am looking for a way to do this via javascript/jquery.
I was able to do this in chrome using this and would like a way to prompt firefox and other browsers to do the same.
Thanks!
I want to integrate some kind of web based PDF viewer so that user can not download the PDF files but they can View them. This is for securing the PDF files from downloads. Something like scribd.com
See example here : ref link
I used FlexPaper: flexpaper.devaldi.com
This compile PDF in SWF, so is more protected.
I think you need something like pdftohtml.
It is a tool based on the Xpdf package which translates PDF documents into HTML format.
You could use Flexpaper, too, but it's free of charge only for open source projects...