简体   繁体   中英

Save <img>-tag as PNG/PDF

How would I go if I wanted to save an entire <img>-tag as a image, or PDF. The attribute 'style' is dynamic, so that must be saved.

I tried making it into a canvas but it doesn't inherit the style. Any ideas?

I don't quite understand what you mean.

draws on image on your screen based off a source. You can right click and save the image from the rendered web page.

If I do this:

<img src='images/my_image.png' alt='' style='width:800px; height:600px' /> 

and save my image, it will always save at the image's actual size, not what you style it to.

Are you trying to get around this? The styling simply stretches the image when it renders. If you want to change it's size you probably have to get image editing software like photo shop, gimp, even paint!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM