I am trying to find a library that can help me implement a document viewer for Node Js as my backend and Angular Js for my frontend web application. Basically this document viewer should be able to support pdf and tiff file formats. It should also help me edit the documents like rotate a page, move a page or delete the page and then submit the edited document. Most of the document viewer libraries i found were for asp.net and paid. Most of the libraries I found for Node JS were just for viewing purposes but not editing them. I would welcome any suggestions or help that can put me in the right direction.
Thank you!
For PDF editing: https://github.com/galkahana/HummusJS
For Tiff editing: http://aheckmann.github.io/gm/
For PDF rendering on the client: https://github.com/mozilla/pdf.js
For Tiff rendering: convert it into jpg/png
Related
I am making a application which gets its data from Alfresco and i want to show a document (which is in Alfresco) on my page with controls like going to the previous and next page.
I found the jQuery Media library, but it only opens PDF files. So my question is, what is the best way of showing .doc, .docx, .ppt, .pptx, etc. files without going to Alfresco itself?
I've tried Prism Viewer and the Google Docs viewer but they both cant open files from Alfresco for some reason.
Thanks!
You should take a look at pdf.js - pdf.js is a browser-side PDF viewer.
If you're using the current HEAD of Alfresco community, then Alfresco transforms your content automatically to PDF and stores the PDF as rendition (as new new Alfresco Share Viewer uses pdf.js internally).
There is a community addon for Alfresco Share 4.2 that uses pdf.js as document viewer & also contains the pdf rendition configs. That should be a good starting point:
https://github.com/share-extras/media-viewers
Or checkout the current HEAD: https://github.com/Alfresco/community-edition
Here is the current thumbnail-service-context.xml where the pdf rendition is defined:
https://github.com/Alfresco/community-edition/blob/master/projects/repository/config/alfresco/thumbnail-service-context.xml#L219
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...
Using Javascript, I'm trying to establish an appropriate method to display a PDF file in a new browser tab. If the browser doesn't have an in-built PDF viewer, I'd like the user to have the option to download the file. My research has led me to John Culviner's jQuery plugin jquery.fileDownload.js here, and that looks a great fit. The issue I have however is that I don't have access to the web server hosting the site in order to upload the plugin. I've also been unable to find a CDN that hosts the plugin and which I could link to.
Does anyone have a few 'best practice' suggestions to achieve my goals that I can research further? Thank you.
There is no need to involve JS. Just link to the PDF. Use the target attribute to trigger a new tab.
<a href="foo.pdf" target="_blank">
If the server lies about the content-type of the PDF or sends a header that indicates it should be downloaded instead of rendered, then you are out of luck.
If you really want to use JS, then:
window.open('foo.pdf');
On click of a button, without doing a round trip to the server, can we save a HTML5 page on clients machine as PDF.
Check out PDF.js. This lib can create pdf in the browser (or serverside on node.js).
Using chrome you can print the page to a pdf file.
You need something like this, maybe server-side you can start a browser and print the content to a pdf file and send this to the client.
Disclaimer: i work for ByteScout
If you have simple HTML formatting and want to generate PDF on client side and if you have non-commercial project, check BytescoutPDF.js - it supports simple HTML formatting for text (font name, size, color) plus simple drawings and images, should be enough for simple reports
i'm creating a web application to generate images according to user's input, more precisely a barcode generator. i'm using javascript to process the data input by user. In the end, i want to have my output barcode as an jpg or png. What other tools do i need? I know that javascript cannot create the .jpg or .png file for me. What other tools can help me generate an image file?
Its possible using Canvas element in HTML5
http://blog.nihilogic.dk/2008/04/saving-canvas-data-to-image-file.html
I dont know i there any free script is out there but you can try this one:
http://www.java4less.com/barcodesjavascript/barcodesjavascript.php?info=intro
Hope its help,
Karls
I have created previews of user driveways after pavement using PHP GD with a picture submitted by the user.
It's done with PHP so you would POST the data to a PHP script on the server side and create the image from there.
I went as far as having the user click and make a path of the section to remove (the old driveway) and use that to cut out the driveway and replace it with a background layer.
You can set up PHP locally with Apache or IIS. PHP is pretty much standard on all hosting services.
You could build an image editor with it.
https://www.php.net/manual/en/book.image.php