单元格溢出中的 MigraDoc 图像
MigraDoc image in cell overflow
我在 2 个单元格中有 2 个图像(每个 1 个,所以它们并排)。图像似乎没有设置单元格的高度,因此图像从当前页面滚动。
有没有办法让图像在需要时滚动到下一页?
我曾尝试手动获取图像的高度并将其设置在单元格上,但它似乎并没有使单元格变大。
我的基本布局table
Dim Section2 As Section = doc.AddSection()
Section2.Headers.FirstPage.IsNull()
'For the graph
Dim graphTable As Table = Section2.AddTable
graphTable.Borders.Visible = False
Dim graphColumn As Column = graphTable.AddColumn
graphColumn.Width = 470
graphColumn = graphTable.AddColumn
graphColumn.Width = 500
Dim graphRow As Row = graphTable.AddRow
graphRow.Cells(0).AddImage("test.png"))
graphRow.Cells(2).AddImage("test.png"))
Dim graphRow2 As Row = graphTable.AddRow
graphRow2.Cells(0).AddParagraph("d")
graphRow2.Cells(1).AddParagraph("d")
如果无法做到这一点,我的下一个想法是将图像剪切成指定的大小,然后在单独的页面上呈现每个部分。
在当前的实施中,table 行和图像都不能跨页。
使用 AddImage 的重载,允许设置图像大小以使其适合一页。或者按照您的建议自行拆分图像。
我在 2 个单元格中有 2 个图像(每个 1 个,所以它们并排)。图像似乎没有设置单元格的高度,因此图像从当前页面滚动。
有没有办法让图像在需要时滚动到下一页?
我曾尝试手动获取图像的高度并将其设置在单元格上,但它似乎并没有使单元格变大。
我的基本布局table
Dim Section2 As Section = doc.AddSection()
Section2.Headers.FirstPage.IsNull()
'For the graph
Dim graphTable As Table = Section2.AddTable
graphTable.Borders.Visible = False
Dim graphColumn As Column = graphTable.AddColumn
graphColumn.Width = 470
graphColumn = graphTable.AddColumn
graphColumn.Width = 500
Dim graphRow As Row = graphTable.AddRow
graphRow.Cells(0).AddImage("test.png"))
graphRow.Cells(2).AddImage("test.png"))
Dim graphRow2 As Row = graphTable.AddRow
graphRow2.Cells(0).AddParagraph("d")
graphRow2.Cells(1).AddParagraph("d")
如果无法做到这一点,我的下一个想法是将图像剪切成指定的大小,然后在单独的页面上呈现每个部分。
在当前的实施中,table 行和图像都不能跨页。
使用 AddImage 的重载,允许设置图像大小以使其适合一页。或者按照您的建议自行拆分图像。