Hi, I'm generating PDF from HTML using PDFSharp, but the letter-spacing HTML is not working:
Code:
h1 {
text-align: center;
font-size: 2.2em;
letter-spacing: 3px;
}
Generating PDF like below:
Code:
var config = new PdfGenerateConfig();
config.PageOrientation = PageOrientation.Landscape;
config.PageSize = PdfSharpPageSize.A4;
string cssStr = File.ReadAllText(folderPath + "1.css");
CssData css = PdfGenerator.ParseStyleSheet(cssStr);
PdfSharp.Pdf.PdfDocument pdf = PdfGenerator.GeneratePdf(html, config, css);
MemoryStream stream = new MemoryStream();
pdf.Save(stream, false);
byte[] bytes = stream.ToArray();
File.WriteAllBytes(folderPath + "document.pdf", bytes);
Also tried inline CSS style, also not working:
Code:
<h1 style="letter-spacing:3px;">
If letter-spacing css is not supported, is there an alternative way for generate PDF from HTML? Thanks!!