Creating preview image/thumbnail of url in Node/Express - node.js

I'm wondering if anyone had experience creating a thumbnail-like preview of pdfs without saving images in a db. I'm storing url links to music pdfs and am trying to create a small preview of the pages so that clients can see some of the first page of the music in advance. I'm looking to see if it's possible without saving images of the page in the db and instead generate the preview on the page load.

Related

Preloading/saving images from a url on build

Im using react/next.js and a lot of the images are coming from a CMS in the form of a link - However this causes them to load really slowly (300ms+ even for 40kb images) so i want to prerender/preload/presave them every time on build.
Is there any way i can do this given the links to the images?

How to make an offline browser on ios?

I need to make an offline browser on ios, which should persistent the specified webpages to the disk with the media resource such as image,css,js. At the same time, the offline browser should be able to download mutiple levels of the website automaticly, for example, make it download the webpage and all the pages linked in this webpage.
I've tried the ASIWebpageRequest,but it is not satisfying, and can not download muti levels.
Are there any other way to implement this perfectly?Can AFNetworing or MKNetworkKit do this?
Thank you very very much!

Need to catalog a large web application

We have a web application with over 560 pages. I would like a way to catalog the site somehow so that I can review the pages (without having to find each on in the menu or enter the URL). Be very glad for ideas on the best way to go about this.
I'd be happy to end up with 560 image files or PDFs, or one large PDF or whatever. I can easily put together a script with all the URLs, but how to pull those up and take a snapshot of some sort and save that to a file or files is where I need help.
The site is written in Java (server) and javascript (client).
I found a great plugin for Firefox that made this relatively painless. The plugin is called Screenshot Pimp (hate the name, love what it does). It takes a snapshot of your browser contents and immediately saves it to a file on your hard drive.
So then I wrote a script that would pull each page up in an IFrame with the URL showing above that, and took snapshots of each page. It took a couple hours to cycle through the whole set of 560+ pages, but it worked great, and now I have a catalog of all the pages.

Download images for google chrome extension

i'm trying to build a batch image downloader in chrome. Basically, i will overlay a small download square to each image on the page and user clicks on it to download. Or the user can click to download all images on a page. I'm currently stuck on figuring out how to download the images. The best i can come up with is to use XHR to send the image to another server, the user can then retrieve it there.
If anyone have a solution for me. It would be much appreciated!
Jason
I believe you can XHR the images and using the File API you can store them locally.
Take a look at the following site http://www.html5rocks.com/features/file there are additional resources on the right column that has detailed examples and tutorials. Such as http://www.html5rocks.com/tutorials/file/filesystem/
Mohamed Mansour
This code will do the trick for you: https://gist.github.com/1049553
It's very simple usage of a 'feature' in chrome when you open an image in a new tab.

Using Google Docs from web app

We have a requirement for people to be able to look at documents people have uploaded to us (mainly word, possibly some rtf) via our web app. We want the user to be able to open the docs inside the browser, but keep the original formatting and not have the need for another application (like word, acrobat etc).
We thought about using google docs to do this, there appears to be some batch uploading options to get stuff in there but does anyone know if we can use the API's to keep the user on our site without them having to login to google docs themselves, and keep them still on our website with re-directing to google docs to view them.
Cheers
There's an option to make documents public (Somewhere in Share->Advanced Options).
Using api you can get list of documents in your google docs account, you can even search em. In your app you could make a link to the document in google docs which opens in a new window. That way your user will never navigate away from your page. An alternative would be to use an IFrame, but it's considered bad practice.
A completely different approach could be to automatically generate and host a pdf each time someone uploads a file. There are scripts/programs which can do that, just call them after you receive a file.

Resources