I'm using prawn for pdf generation and everything works quite well, but now I'm having a bit of a problem. 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?
我正在使用prawn生成pdf,一切运行良好,但现在我遇到了一些问题。当我在一个页面上放置多个表格时,它们只会相互叠加而不会相互叠加。这是正常行为,我该怎么办呢?
I add the tables on the most normal behaviour btw :)
我在最正常的行为上添加表格btw :)
Thanks!
谢谢!
1 个解决方案
#1
2
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
#1
2
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