首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用比萨xhtml2pdf设置3列布局

如何使用比萨xhtml2pdf设置3列布局
EN

Stack Overflow用户
提问于 2012-05-21 14:43:07
回答 1查看 1.8K关注 0票数 2

我有一个项目列表,我想在三列中进行布局。列表相当长(使用3列布局可能需要5页)。这些条件如下:

  1. 第一页的标题高度约为200 in,宽度为100%。在第一页的标题之后,页面应该开始以3列显示列表.
  2. “中间和最后”页面不包含任何标题。
  3. 最后一页包含一个图像。

我试图给第二和第三帧的页边距顶,第一页看起来是对的,但是“中间”页没有。边距顶适用于所有页面。

我们会感谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2015-08-23 21:17:04

当一个框架被填充时,比萨将自动使用下一个帧。这个例子用usage.rst解释。

代码语言:javascript
复制
<html>
<head>
<style>
    @page {
        size: letter portrait;
        @frame header_frame {           /* Static frame */
            -pdf-frame-content: header_content;
            left: 50pt; width: 512pt; top: 50pt; height: 40pt;
        }
        @frame col1_frame {             /* Content frame 1 */
            left: 44pt; width: 245pt; top: 90pt; height: 632pt;
        }
        @frame col2_frame {             /* Content frame 2 */
            left: 323pt; width: 245pt; top: 90pt; height: 632pt;
        }
        @frame footer_frame {           /* Static frame */
            -pdf-frame-content: footer_content;
            left: 50pt; width: 512pt; top: 772pt; height: 20pt;
        }
    }
</style>
<head>

<body>
    <div id="header_content">Lyrics-R-Us</div>
    <div id="footer_content">(c) - page <pdf:pagenumber>
        of <pdf:pagecount>
    </div>
    <p>Old MacDonald had a farm. EIEIO.</p>
    <p>And on that farm he had a cow. EIEIO.</p>
    <p>With a moo-moo here, and a moo-moo there.</p>
    <p>Here a moo, there a moo, everywhere a moo-moo.</p>
</body>
</html>

HTML内容将从Page1.Col1流到Page1.Col2到Page2.Col1,等等。

代码语言:javascript
复制
+-------------------------------+    +-------------------------------+
| Lyrics-R-Us                   |    | Lyrics-R-Us                   |
|                               |    |                               |
| Old MacDonald   farm he had a |    | a moo-moo       everywhere a  |
| had a farm.     cow. EIEIO.   |    | there.          moo-moo.      |
| EIEIO.          With a moo-   |    | Here a moo,                   |
| and on that     moo here, and |    | there a moo,                  |
|                               |    |                               |
| (c) - page 1 of 2             |    | (c) - page 2 of 2             |
+-------------------------------+    +-------------------------------+
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10687434

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档