[英]Multiple tables on one page with prawn
I'm using prawn for pdf generation and everything works quite well, but now I'm having a bit of a problem. 我正在使用prawn生成pdf,一切运行良好,但现在我遇到了一些问题。 When I put multiple tables on one page, they just get put over each other and not under each other.
当我在一个页面上放置多个表格时,它们只是相互叠加而不是彼此叠加。 Is this normal behaviour and what can I do about it?
这是正常的行为吗?我能做些什么呢?
I add the tables on the most normal behaviour btw :) 我在最正常的行为上添加表格btw :)
Thanks! 谢谢!
What is the code you're using to create the PDF document with Prawn? 你用Prawn创建PDF文档的代码是什么?
Without that, I'm guessing that you need to use 'bounding boxes' to seperate the different sections / tables in your document. 没有它,我猜你需要使用'边界框'来分隔文档中的不同部分/表格。 Each bounding box is an area for content rendering, and new bounding boxes or text is rendered below that.
每个边界框都是用于内容呈现的区域,新的边界框或文本在其下方呈现。 See bounding_box() documentation or the example below:
请参阅bounding_box()文档或以下示例:
> pdf.bounding_box([100,500], :width => 100, :height => 300) do
> pdf.text "This text will flow in a very narrow box starting" +
> "from [100,500]. The pointer will then be moved to [100,200]" +
> "and return to the margin_box"
> end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.