HI
I want to get an image from the system clipboard (Windows/Mac) and paste it into
can it be done in javascript?
No, JavaScript would not be able to paste image data into a web page. There are no HTML elements that can display pasted image data.
If there's a way to grab the data URI (I can't figure out how, can you? it seems only text is available from the clipboard) then you could append <img src="data:image/png;base64,9A8SDF7ADSF9=="> to a wysiwyg field where the gobbledygook is the data URI. Then assuming you want to save that, you'd have to do some parsing on submit, write the image to a file and do with it as you will, or store as a blob or something.
Related
I try to convert a pdf as base64 string. I converted it and saving it to text file. Iam able to download the text file. But i dont want to download it instead of download it i want to display it in a html page. While clicking that text file i should be able to view the content of the text file. Is there any possible way to do it in javascript.
I have attached the below Link
https://codesandbox.io/s/nervous-flower-nxmtw?from-embed
You can use a iframe and put the text file link to src
Note* - the above solution is with the limited information i have understood .
Using NativeScript + VueJS, I'm trying to find a way to take a dynamic template that's rendered based on props and route data, and tap a button to save the "view" as a PDF to the filesystem.
I found this tutorial here which gives me a start: https://medium.com/#kumarandena/pdf-generation-in-nativescript-using-javascript-libraries-864ecf4e9a3a
This generates a Base64 which you then copy to clipboard and open in a browser. In iOS for example if I choose to save the page as a file it's just unknown.pdf. So my goal is to reference an html element, like a div, and save all the contents exactly as they appear into a folder of my choice in the native file system.
There's little to find on this so wondering if someone has accomplished this.
I use domtoimage to convert any dom element to an image, and it works well. Then you can probably insert that image to a pdf using jsPDF or pdfMake.
I see in the pdfMake playground that you can insert an image with a dataurl format.
I'm trying to retrieve text that is loaded dynamically from a web page using golang.
The text to retrieve is on this page :
https://www.protectedtext.com/testretrieve?1234
This text is encrypted by a password and then decrypted on client side and loaded dynamically on the page.
I already tried with goquery by selecting 'textarea' object, but I can't get the text cause it's loaded dynamically.
How can I achieve this ? By executing JS in Go ? It's working in my chrome console, but no ideas on how to do that in Go.
A lightweight solution is the best for my project. Or any other website that can store and edit same text without modifying the URL ?
You may need a headless browser to load the javascript like for example phantomgo
However looking at the page source code we can see that they use sha512 for the tab title and aes for the textarea field.
The page which you shared contains https://www.protectedtext.com/testretrieve?1234, only one element of class textarea-contents
simple get class documents using goquery and get 0th part
I've created a text editor, using a contenteditable div. The user can copy and paste text from word to the website. Only the images aren't working, because the src points to a local path.
I think I should encode the image to base64, before it is displayed, but the problem is, that the images cant be displayed, because they are local files.
Try using some remote server to hold the photos so that they can be utilized. Try something like picpaste.com, however they only hold files temporarily I presume.
I need your help to grab the source code of the page & can save it in a text file.
What actually i want!!
Instead of doing the lot of work like, right click on the page then click on view source code then to copy & paste it in a text file...
I want to make a short, i want to put a link on the page, in which i need to grab a source code, so when i just click on that link let say "Download Code" it grabs the current page source code & save it in a .txt format.
Kindly help me how can i do this?? it would be great if i can achieve this by using a java script, i don't want to use server side programming language.
I tried data URI but dont get the exact what i need
I find some thing on the below link:
http://css-tricks.com/examples/ViewSourceButton/#