Hi,
first sorry for the general tag selected as I didn't find any specificone about Document Processing.
I am creating a simple document mostly made up of tables using the following code where neither the row.height, nor the VerticalAlignment are working (see attached screenshot).
I would like much narrower cells and the text vertically centered.
How to achieve this ?
thanks
Patrick
RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
Section section = new Telerik.Windows.Documents.Flow.Model.Section(document);
document.Sections.Add(section);
section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(40, 10, 40, 10);
section.PageSize = PaperTypeConverter.ToSize(PaperTypes.A4);
Table FactTable = section.Blocks.AddTable();
for (int i = 0; i < datas.GetLength(0); i++)
{
TableRow row = new TableRow(document);
row.Height = new TableRowHeight(HeightType.Exact, 14);
PiedFactTable.Rows.Add(row);
{
TableCell cell = row.Cells.AddTableCell();
cell.VerticalAlignment = VerticalAlignment.Center;
Run run= cell.Blocks.AddParagraph().Inlines.AddRun(datas[i]);
}
}
Hi Patgat,
I have tested your code and it works on my side. I wanted to ask you what is the format you are saving to?
Hi Dimitar,
I am saving this in pdf format :
Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider = new(); RadFixedDocument PdfDocument = provider.ExportToFixedDocument(document);Hi again,
effectively when saving as Docx it looks fine, while saving as Pdf has multiple incorrect rendering. See attached docs.
formatting is done with the following very standard code :
IFormatProvider<RadFlowDocument> formatProvider = null; switch (selectedFromat) { case "Docx": formatProvider = new DocxFormatProvider(); break; case "Pdf": formatProvider = new PdfFormatProvider(); break; } using (var stream = dialog.OpenFile()) { formatProvider.Export(document, stream); }