Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Imagine you could convert all kind of things to all kind of different things, e.g. taking a screenshot of a dom element or converting another website to a screenshot. Forks & comments much appreciated! #nobackend #dreamcode
// convert a dom element to a PDF and download it
convert( $('.invoice') ).to( 'invoice.pdf' ).download()
// alternatively
download( convert( $('.invoice') ).to( 'invoice.pdf' ) )
// convert another website to a png and show it on the page
convert( 'http://exam.pl/page' ).toImage().then( $('.screenshots').append )
// attach a file to an email
sendEmail({
subject: "Hello, World!",
text: "This mail has been sent from the frontend",
to: "joe@exam.pl",
attachments: [
convert( 'http://exam.pl/page' ).to("screenshot.png")
]
})
@kishaningithub
Copy link

kishaningithub commented Oct 8, 2015

I would suggest https://www.filepicker.com for file format conversions and anything to do with pictures and files. All the above functional abstractions are covered using REST API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment