简体   繁体   English

救 <img> 标记为PNG / PDF

[英]Save <img>-tag as PNG/PDF

How would I go if I wanted to save an entire <img>-tag as a image, or PDF. 如果我想将整个<img>标签保存为图像或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! 如果要更改其大小,则可能必须获得图像编辑软件,例如Photo shop,gimp甚至油漆!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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