mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
#21 use win ansi encoding
This commit is contained in:
@@ -221,7 +221,15 @@
|
||||
page.AddText("é (lower case, upper case É).", 9,
|
||||
new PdfPoint(30, page.PageSize.Height - 50), font);
|
||||
|
||||
WriteFile(nameof(CanWriteSinglePageWithAccentedCharacters), builder.Build());
|
||||
var bytes = builder.Build();
|
||||
WriteFile(nameof(CanWriteSinglePageWithAccentedCharacters), bytes);
|
||||
|
||||
using (var document = PdfDocument.Open(bytes))
|
||||
{
|
||||
var page1 = document.GetPage(1);
|
||||
|
||||
Assert.Equal("é (lower case, upper case É).", page1.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private static void WriteFile(string name, byte[] bytes)
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
{ NameToken.FirstChar, metrics.FirstChar },
|
||||
{ NameToken.LastChar, metrics.LastChar },
|
||||
{ NameToken.Widths, new IndirectReferenceToken(widthsRef.Number) },
|
||||
{ NameToken.Encoding, NameToken.MacRomanEncoding }
|
||||
{ NameToken.Encoding, NameToken.WinAnsiEncoding }
|
||||
};
|
||||
|
||||
var token = new DictionaryToken(dictionary);
|
||||
|
||||
Reference in New Issue
Block a user