Skip to content
Open
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
10 changes: 10 additions & 0 deletions src/EPPlus.Export.Pdf.Tests/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
<appSettings>
<add key="EPPlus:ExcelPackage.AllowCircularReferences" value="false" />
<add key="EPPlus:ExcelPackage:License" value="NonCommercialPersonal,EPPlus Test Project" />
</appSettings>
</configuration>
2 changes: 1 addition & 1 deletion src/EPPlus.Export.Pdf.Tests/EPPlus.Export.Pdf.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<SignAssembly>True</SignAssembly>
Expand Down
10 changes: 5 additions & 5 deletions src/EPPlus.Export.Pdf/DocumentObjects/Fonts/PdfCIDFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class PdfCIDFont : PdfObject
private readonly CIDSystemInfo CIDInfoObject;
private readonly int FontDescriptorObjectNumber;

private readonly int? DW; // Default width
private int? DW; // Default width
private readonly List<object> W; // Width array
private readonly int[] DW2; // Default metrics for vertical writing (2 numbers)
private readonly List<object> W2; // Vertical writing metrics
Expand Down Expand Up @@ -85,9 +85,9 @@ internal override string RenderDictionary()
if (Subtype == CIDFontSubtype.CIDFontType2)
{
if(string.IsNullOrEmpty( CIDToGIDMap ))
sb.AppendFormat($"\n /CIDToGIDMap {CIDToGIDMap}");
else
sb.AppendFormat($"\n /CIDToGIDMap /Identity");
else
sb.AppendFormat($"\n /CIDToGIDMap {CIDToGIDMap}");
}
sb.Append(" >>");
return sb.ToString();
Expand Down Expand Up @@ -121,9 +121,9 @@ internal override void RenderDictionary(BinaryWriter bw)
if (Subtype == CIDFontSubtype.CIDFontType2)
{
if (string.IsNullOrEmpty(CIDToGIDMap))
sb.AppendFormat($"\n /CIDToGIDMap {CIDToGIDMap}");
else
sb.AppendFormat($"\n /CIDToGIDMap /Identity");
else
sb.AppendFormat($"\n /CIDToGIDMap {CIDToGIDMap}");
}
sb.Append(" >>");
WriteAscii(bw, sb.ToString());
Expand Down
14 changes: 7 additions & 7 deletions src/EPPlus.Export.Pdf/DocumentObjects/PdfBorderRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ namespace EPPlus.Export.Pdf.DocumentObjects
{
internal class PdfBorderRenderer
{
private readonly PdfCellBorderData Top;
private readonly PdfCellBorderData Bottom;
private readonly PdfCellBorderData Left;
private readonly PdfCellBorderData Right;
private readonly PdfCellBorderData DiagonalUp;
private readonly PdfCellBorderData DiagonalDown;
private PdfCellBorderData Top;
private PdfCellBorderData Bottom;
private PdfCellBorderData Left;
private PdfCellBorderData Right;
private PdfCellBorderData DiagonalUp;
private PdfCellBorderData DiagonalDown;
private readonly double X;
private readonly double Y;
private readonly string Name;
private readonly bool IsMerged;
private readonly MergedCellDrawInfo info;
private MergedCellDrawInfo info;
private readonly double Width;
private readonly double Height;

Expand Down
1 change: 1 addition & 0 deletions src/EPPlus/Export/PdfExport/TextMapping/PdfTextMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ internal static PdfHeaderFooter GetTextFormats(PdfPageSettings pageSettings, Pdf
/// <returns>The number of columns to add.</returns>
internal static int AddColumnsForNonWrappedText(PdfPageSettings pageSettings, ExcelWorksheet ws, PdfWorksheet pdfSheet)
{
if (ws.Dimension == null) return 0; //If dimension is null, there are no cells to check, so return 0.
int columnsToAdd = 0;
var catalog = new PdfCatalog();
var lastColumn = ws.Dimension.End.Column;
Expand Down
11 changes: 11 additions & 0 deletions src/EPPlusTest/Issues/ExportIssues.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -52,5 +53,15 @@ public void HtmlExportCRLFIssus2095()
Assert.AreEqual(cell, "<span style=\"font-size:11pt;font-family:Aptos Narrow;\">this\nis\na\nbug</span>");
}
}
[TestMethod]
public void GlyphPositioning_KerningAndMarkOffsets()
{
using var package = new ExcelPackage();
var ws = package.Workbook.Worksheets.Add("Sheet1");
ws.Cells["A1"].Value = "Test";
ws.Cells["A1:A2"].AutoFitColumns();
ws.SaveAsPdf(@"c:\epplusTest\Testoutput\GlyphPositioning.pdf");
}

}
}
Loading