Aspose.Pdf表单元格不会跨越页面

时间:2020-08-28 14:42:15

标签: vb.net pdf pdf-generation

我正在Aspose.Pdf表中创建一些行和单元格,如下所示:

' add upper left cell
row.Cells.Add("11/03/2020")

' add right cell, spanning two rows since it is going to wrap
Dim summaryCell As Cell = row.Cells.Add(
    "Now is the time for all good men to come to the aid of their party." & vbCrLf &
    "This is the song that doesn't end; yes it goes on and on my friend! Some people started singing it not knowing what it was, and they'll continue singing it forever just because..." & vbCrLf &
    "Space... the final frontier... These are the voyages of the starship Enterprise... Its five year mission: to explore strange new worlds, to seek out new life and new civilizations, to boldly go where no man has gone before!" & vbCrLf &
    "When in the course of human events it becomes necessary..." & vbCrLf &
    "We the people of the United States of America, in order to form a more perfect union..." & vbCrLf &
    "Four score and seven years ago, our fathers set forth in this nation the proposition that all men are created equal." & vbCrLf &
    "In the beginning, when God created the heavens and the earth, and the earth was without form and void..." & vbCrLf &
    "Lorem ipsum sit dolor amet..." & vbCrLf &
    "In the year AD 2101, war was beginning... We get signal! What! Main screen turn on! HOW ARE YOU GENTLEMEN?! ALL YOUR BASE ARE BELONG TO US..." & vbCrLf)
summaryCell.RowSpan = 2

' go to the next row
row = table.Rows.Add()

' add lower left cell
Dim cellVisitType As Cell = row.Cells.Add("Happy election day!")

' go to the next row
row = table.Rows.Add()

当然,将占位符文本替换为实际数据。现在,我在一个循环中运行此命令,以生成多行两行的集合-每一组在左边有两个包含日期和访问类型的单元格,在右边两行包含一个单元格的单个单元格包含大量文本。我的问题是,当这些部分之一跨越页面边界(不是明确的分页符,只是布局引擎在一页上没有空间了)时,下一部分的日期和访问类型就会“拉起”到页面顶部页面,而不是出现在相应部分的开头旁边:

enter image description here

在上面生成的PDF的屏幕截图中,请查看日期和访问类型(以红色箭头突出显示)如何位于页面的顶部,而不是我在窗口开头附近绘制的红色矩形中详细的文字?为什么会这样呢?我该如何解决?

0 个答案:

没有答案
相关问题