C# PdfSharp单元格中的图像与其他行重叠

C# PdfSharp单元格中的图像与其他行重叠,c#,pdfsharp,C#,Pdfsharp,我前天开始使用PDFSharp,并使用以下代码将图像添加到单元格中: Section section = this.document.AddSection(); Table table1 = section.Headers.Primary.AddTable(); Column column = table1.AddColumn("8.5cm"); column.Format.Alignment = ParagraphAlignment.Right; colum

我前天开始使用PDFSharp,并使用以下代码将图像添加到单元格中:

   Section section = this.document.AddSection();

   Table table1 = section.Headers.Primary.AddTable();

   Column column = table1.AddColumn("8.5cm");
   column.Format.Alignment = ParagraphAlignment.Right;

   column = table1.AddColumn("8.5cm");
   column.Format.Alignment = ParagraphAlignment.Right;

   Row row = table1.AddRow();       
   Image image = row.Cells[0].Elements.AddImage(@"C:\testdump\logo.jpg");
   image.LockAspectRatio = true;
   image.RelativeVertical = RelativeVertical.Line;
   image.RelativeHorizontal = RelativeHorizontal.Margin;
   image.Top = ShapePosition.Top;
   image.Left = ShapePosition.Left;
   image.WrapFormat.Style = WrapStyle.None;
我在这个表之后添加了另一个表:

Table table2 = section.AddTable();
单元格中的图像与表2重叠。有人知道为什么会发生这种情况吗?

似乎在第二个表中添加了一个“空白”行解决了这个问题。不确定这是如何解决重叠的。

a确认这条线

image.WrapFormat.Style = WrapStyle.None; 
创建一个自由浮动的图像。图像从单元格中获取其位置,但对表的布局没有影响

如果要将图像与文本或其他元素重叠,请使用WrapStyle.None