Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/EPPlus.Export.Pdf.Tests/PdfTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,5 +1127,14 @@ public void PngTransparentTest()
string path = _pdfPath + "Allsvenskan2001.pdf";
ws.SaveAsPdf(path);
}

[TestMethod]
public void TableDxfStyleTest()
{
using var p = OpenTemplatePackage("TableDxfStylePdf1.xlsx");
var ws = p.Workbook.Worksheets[0];
string path = _pdfPath + "TableDxfStylePdf1.pdf";
ws.SaveAsPdf(path);
}
}
}
22 changes: 10 additions & 12 deletions src/EPPlus/Export/PdfExport/TextMapping/PdfTextMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -878,21 +878,19 @@ internal static ExcelDxfBorderItem GetTopBorderItem(ExcelRangeBase cell, ExcelBo
{
if (table.ShowColumnStripes && (tableCol & 1) == 0)
{
if (cell._fromRow - ts > range._fromRow && cell._fromRow < range._toRow)
{ top = tableStyle.FirstColumnStripe.Style.Border.Horizontal; elementOrder = TableEdgeOrder.FirstColumnStripe; }
else if (cell._fromRow <= range._toRow)
{ top = null; }
else
{ top = tableStyle.FirstColumnStripe.Style.Border.Top; elementOrder = TableEdgeOrder.FirstColumnStripe; }
var band = tableStyle.FirstColumnStripe.Style.Border;
if (tableRow == 0)
{ if (band.Top.HasValue) { top = band.Top; elementOrder = TableEdgeOrder.FirstColumnStripe; } }
else if (band.Horizontal.HasValue)
{ top = band.Horizontal; elementOrder = TableEdgeOrder.FirstColumnStripe; }
}
if (table.ShowColumnStripes && (tableCol & 1) != 0)
{
if (cell._fromRow + ts > range._fromRow && cell._fromRow < range._toRow)
{ top = tableStyle.SecondColumnStripe.Style.Border.Horizontal; elementOrder = TableEdgeOrder.SecondColumnStripe; }
else if (cell._fromRow <= range._toRow)
{ top = null; }
else
{ top = tableStyle.SecondColumnStripe.Style.Border.Top; elementOrder = TableEdgeOrder.SecondColumnStripe; }
var band = tableStyle.SecondColumnStripe.Style.Border;
if (tableRow == 0)
{ if (band.Top.HasValue) { top = band.Top; elementOrder = TableEdgeOrder.SecondColumnStripe; } }
else if (band.Horizontal.HasValue)
{ top = band.Horizontal; elementOrder = TableEdgeOrder.SecondColumnStripe; }
}
if (table.ShowRowStripes && tableStyle.FirstRowStripe.Style.Border.Top.HasValue && (tableRow & 1) != 0)
{ top = tableStyle.FirstRowStripe.Style.Border.Top; elementOrder = TableEdgeOrder.FirstRowStripe; }
Expand Down
Loading