简体   繁体   English

跨页打印HTML / CSS

[英]Page-Spanning Printing HTML/CSS

SO is probably not the right place for this, but I may have missed a trick with my HTML/CSS. 因此,可能不是正确的选择,但我可能错过了HTML / CSS技巧。

I have written an application that outputs to HTML, for convenience. 为了方便起见,我已经编写了一个输出为HTML的应用程序。 The page it produces is big, insofar as it should span multiple pages, both horizontally and vertically. 它产生的页面很大,因为它应该在水平和垂直方向上跨多个页面。 However, unlike spreadsheets, browsers don't seem to do the "across then down" or "down then across" style printing and, if the page isn't shrunk-to-fit, it's just clipped at one page's width. 但是,与电子表格不同的是,浏览器似乎不执行“先跨后下”或“先跨后下”样式的打印,并且,如果页面没有缩小以适合页面大小,则会被剪裁为一页的宽度。

Short of printing to a custom page size that accommodates the full width and height, is there anything I can do to get the page-spanning printing I'm looking for? 如果无法打印到可容纳整个宽度和高度的自定义页面尺寸,我是否可以做些什么来获得想要的跨页面打印?

For the problem Landscaping is one method you can try out. 对于这个问题, Landscaping是您可以尝试的一种方法。

Refer here:- Landscape printing from HTML 请参阅此处:- 从HTML进行横向打印

But I would recommend to convert it to a PDF before printing which will be more comfortable. 但是我建议您在打印之前将其转换为PDF,这样会更舒适。

I couldn't find a programmatic solution, so did this: 我找不到程序化的解决方案,所以这样做:

  • Print oversized HTML on to paper big enough to accommodate everything (eg, A0) to PDF. 在纸张上打印超大HTML,其大小足以容纳PDF的所有内容(例如,A0)。
  • Adobe Reader (and probably other viewers) have a "Poster Print" option, that does the tiling automatically with an optional scaling factor: Do this, either to PDF if you need to do any further layout processing, or to your printer directly. Adobe Reader(可能还有其他查看器)具有“海报打印”选项,该选项会自动使用可选的缩放因子进行平铺:如果需要进行进一步的布局处理,可将其生成为PDF,或者将其直接生成至打印机。
  • ??? ???
  • Profit 利润

A bit of a weak link in my pipeline -- until I can generate tiled PDFs directly -- but c'est la vie! 我的管道中有一个薄弱的环节-直到我可以直接生成切片的PDF为止,但是请耐心等待!

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

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