有什么解决方案可以计算 HTML 中广告的英寸高度吗?

发布于 2024-08-20 06:24:01 字数 248 浏览 4 评论 0原文

我正在为一家报纸开发一个广告门户,我想为我的网站添加一个令人惊叹的功能。

这是我的想法: 我想添加一项功能,让用户在一个区域内编写自己的广告文本,然后让他按照他/她想要的方式对其进行定制,最后,程序自动为他计算广告的英寸高/她。

我知道如何提供在 HTML/javascript 中定制文本区域的能力,但问题是在我们的实际测量中(例如英寸或厘米)计算 ADV 的高度。

有什么解决方案或任何想法如何做到这一点?

问候。

I'm developing an advertisement portal for a newspaper and I want to add an astonishing feature to my website.

here is my idea :
I want to add a capability to let user to write his own advertisement's text withing an area then let him to tailor it as the way he/she wants it then at the end , the program calculate the inches high of his advertisement automatically for him/her.

I know how to providing the ability of tailoring a textarea in HTML/javascript but the problem is whit calculating the height of ADV in our real measurement say inches or centimeter.

is there any solution or any idea of how to doing this?

regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

山色无中 2024-08-27 06:24:01

我不能 100% 确定你所说的广告是否会在网上使用,或者在实际的报纸上使用。

如果您谈论的是在线广告:

忘记在线广告中的英寸。使用这个术语会产生误导,并且会产生误解和麻烦。您无法保证网页上的物理固定大小。只有像素 - 用它们计算,并用它们定价。向您的客户解释,像素在不同的显示器上可能有不同的尺寸,因此实际结果会有所不同。

如果您谈论的是在线创建的纸质广告:

@Byron Whitlock 的解决方案建议 PDF 将是您最安全的选择,因为客户可以将其打印出来并期望看到实际尺寸的实际结果,如果没有,则取决于客户的打印机设置。

I'm not 100% sure whether the ads you're talking about are going to be used online, or in the actual paper.

If you are talking about on-line ads:

Forget about inches in online advertisements. Using the term is misleading and is going to produce misunderstandings and trouble. You can't guarantee a physical fixed size on a web page. There are only Pixels - calculate with, and price by them. Explain to your customers that a Pixel can have a different size on different displays, so actual results vary.

If you are talking about paper ads created online:

@Byron Whitlock's solution suggesting PDFs would be your safest bet, because the customer can print it out and expect to see the actual result in its real size, and if not, it's down to the customer's printer settings.

说好的呢 2024-08-27 06:24:01

一种选择是使用预期的字体、大小和格式生成文本图像(例如使用 ImageMagick);向用户显示该图像以确认它看起来像他们期望的那样;然后测量图像。这应该可以消除因打印方式而异的问题。

One option would be to generate an image of the text (using, say, ImageMagick) in the expected font, size, and formatting; display that image to the user for confirmation that it looks like they expect; and then measure the image. That should eliminate the issue of variation based on how it will be printed.

冷弦 2024-08-27 06:24:01

这将取决于字体和格式。您可以创建一个 PDF 表单,其中隐式包含宽度和高度约束条件,易于排版。

That will be dependent of font and formatting. You could create a PDF form which implicitly contains width and height constraints and is easy for typesetting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文