With the code below the cell containing our description string is split into three lines but the middle line is in the wrong font. Additionally when printing this from MS Edge (or IE) the printer produces an error. The latter may or may not be related to the former problem.
Hi Oliver,
Aspose.Pdf.Document
pdf = new Aspose.Pdf.Document();<o:p></o:p>
var mainPage = pdf.Pages.Add();
var textFont = FontRepository.FindFont("Book Antiqua");
pdf.PageInfo.DefaultTextState = new TextState { Font = textFont };
mainPage.SetPageSize(597.6, 842.4);
mainPage.PageInfo.Margin = new Aspose.Pdf.MarginInfo { Left = 42, Right = 42, Top = 120, Bottom = 73 };
mainPage.PageInfo.DefaultTextState = new TextState { Font = textFont, FontSize = 10 };
var itemTable = new Aspose.Pdf.Table
{
ColumnWidths = "50 200 65 85 55",
Margin = new Aspose.Pdf.MarginInfo { Left = 15, Right = 12, Top = 35, Bottom = 10 },
DefaultCellTextState = { Font = textFont, FontSize = 10 },
RepeatingRowsCount = 1,
IsBroken = true
};
var headerRow = itemTable.Rows.Add();
headerRow.DefaultCellTextState.Font = FontRepository.FindFont("Book Antiqua Bold");
headerRow.Cells.Add("Quantité");
headerRow.Cells.Add("Description");
var hdrUnit = headerRow.Cells.Add("PU HT");
hdrUnit.Alignment = HorizontalAlignment.Right;
var hdrNet = headerRow.Cells.Add("Total HT");
hdrNet.Alignment = HorizontalAlignment.Right;
var hdrTax = headerRow.Cells.Add("TVA");
hdrTax.Alignment = HorizontalAlignment.Right;
var itemRow1 = itemTable.Rows.Add();
itemRow1.Cells.Add("6");
itemRow1.Cells.Add("2 x Locations balises et frais de Communication pour 3 mois à partir du 15 Août 2010.");
var numUnit = itemRow1.Cells.Add("1,10 €");
numUnit.Alignment = HorizontalAlignment.Right;
var numNet = itemRow1.Cells.Add("6,60 €");
numNet.Alignment = HorizontalAlignment.Right;
var numTax = itemRow1.Cells.Add("3,30 €");
numTax.Alignment = HorizontalAlignment.Right;
mainPage.Paragraphs.Add(itemTable);
pdf.Save(myDir+"table_font1.pdf");