本文介绍了HTML为PDF A4可打印尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用HTML来设计PDF格式的小册子。在转换为pdf后,如何使它成为A4尺寸并可打印? HTML将由图像和文本组成,并且需要看起来与HTML版本相同。可能吗?我应该使用300dpi像素大小 - > 2480 X 3508像素?

I need to design brochure in HTML from which a pdf will be generated. How can I make it to be A4 size and printable after transform to pdf? The HTML will consist of images and text and needs to look the same as HTML version. Is it possible? Should I use 300dpi pixel size -> 2480 X 3508 pixels?

推荐答案

您可以制作一个css文件,有打印特定的指令。您可以在物理尺寸方面指定尺寸,虽然这可能会在屏幕上进行解释。

You can make a css file that synchonises the layout and even has print-specific directives. You can specify sizes in terms of physical dimensions, although this will be subject to interpretation on the screen.

有关打印CSS的文章可以看到

An article on doing for-print CSS can be seen here.

这篇关于HTML为PDF A4可打印尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 02:07