private Table SetTableStyle(ref Section section, Color tableColor) { TextFrame frame = section.AddTextFrame(); frame.MarginTop = new Unit(6, UnitType.Centimeter); frame.Width = new Unit(16, UnitType.Centimeter); //TABLE LABEL Paragraph p = frame.AddParagraph(); p.AddFormattedText("Purchased goods:", TextFormat.Bold); frame.AddParagraph("").AddLineBreak(); //TABLE Table table = frame.AddTable(); table.Style = "Table"; table.Borders.Color = tableColor; table.Borders.Width = 0.25; table.Borders.Left.Width = 0.5; table.Borders.Right.Width = 0.5; table.Rows.LeftIndent = 0; return(table); }
private void HeaderSection() { HeaderFooter header = Pdf.LastSection.Headers.Primary; Table table = header.AddTable(); double thirdWidth = Pdf.PageWidth() / 3; table.AddColumn(ParagraphAlignment.Left, thirdWidth * 2); table.AddColumn(); Row row = table.AddRow(); if (!string.IsNullOrEmpty(Invoice.Image)) { Image image = row.Cells[0].AddImage(Invoice.Image); row.Cells[0].VerticalAlignment = VerticalAlignment.Center; image.Height = Invoice.ImageSize.Height; image.Width = Invoice.ImageSize.Width; } TextFrame frame = row.Cells[1].AddTextFrame(); Table subTable = frame.AddTable(); subTable.AddColumn(thirdWidth / 2); subTable.AddColumn(thirdWidth / 2); row = subTable.AddRow(); row.Cells[0].MergeRight = 1; row.Cells[0].AddParagraph(Invoice.Title, ParagraphAlignment.Right, "H1-20"); row = subTable.AddRow(); if (!String.IsNullOrEmpty(Invoice.OrderReference)) { row.Cells[0].AddParagraph("COMMANDE N°:", ParagraphAlignment.Left, "H2-9B-Color"); row.Cells[1].AddParagraph(Invoice.OrderReference, ParagraphAlignment.Right, "H2-9"); } row.Cells[0].AddParagraph("EDITÉE LE:", ParagraphAlignment.Left, "H2-9B-Color"); row.Cells[1].AddParagraph(Invoice.InvoiceDate.ToString("dd/MM/yyyy"), ParagraphAlignment.Right, "H2-9"); if (Invoice.PayedDate != DateTime.MinValue) { row.Cells[0].AddParagraph("PAYÉE LE:", ParagraphAlignment.Left, "H2-9B-Color"); row.Cells[1].AddParagraph(Invoice.PayedDate.ToString("dd/MM/yyyy"), ParagraphAlignment.Right, "H2-9"); } }
public TextFrame generate(MannschaftskampfViewModel mannschaftskampfViewModel, CompetitionInfosViewModel zusatzInfos, double randLinksRechts, bool useColor) { var result = new TextFrame(); result.Width = "25cm"; var table = result.AddTable(); table.Borders.Visible = false; table.TopPadding = "0.5cm"; double a4LandscapeBreite = (29.7 - 2 * randLinksRechts); double breite_Sieger = 8; double breite_Wettkampf = 6; double breite_Orga = 6; double breite_Kommentar = a4LandscapeBreite - breite_Orga - breite_Wettkampf - breite_Sieger; Column column = table.AddColumn($"{breite_Sieger}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{breite_Wettkampf}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{breite_Orga}cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn($"{breite_Kommentar}cm"); column.Format.Alignment = ParagraphAlignment.Left; Row zeile = table.AddRow(); zeile.Style = CustomStyles.BEMERKUNG; zeile.Cells[0].AddParagraph().AddFormattedText($"{Resources.LanguageFiles.DictPluginMain.Winner}:", TextFormat.Bold); zeile.Cells[0].Add(SiegerTeam(mannschaftskampfViewModel.HeimMannschaft, Convert.ToInt32(mannschaftskampfViewModel.HeimPunkte), mannschaftskampfViewModel.GastMannschaft, Convert.ToInt32(mannschaftskampfViewModel.GastPunkte), useColor)); zeile.Cells[1].Add(Wettkampf(mannschaftskampfViewModel)); zeile.Cells[2].Add(Organisation(zusatzInfos)); zeile.Cells[3].Add(Kommentar(mannschaftskampfViewModel.Kommentar)); return(result); }
private void HeaderSection() { HeaderFooter header = Pdf.LastSection.Headers.Primary; Table table = header.AddTable(); double thirdWidth = Pdf.PageWidth() / 3; table.AddColumn(ParagraphAlignment.Left, thirdWidth * 2); table.AddColumn(); Row row = table.AddRow(); if (!string.IsNullOrEmpty(Invoice.Image)) { Image image = row.Cells[0].AddImage(Invoice.Image); row.Cells[0].VerticalAlignment = VerticalAlignment.Center; image.Height = Invoice.ImageSize.Height; image.Width = Invoice.ImageSize.Width; } TextFrame frame = row.Cells[1].AddTextFrame(); Table subTable = frame.AddTable(); subTable.AddColumn(thirdWidth / 2); subTable.AddColumn(thirdWidth / 2); row = subTable.AddRow(); row.Cells[0].MergeRight = 1; row.Cells[0].AddParagraph(Invoice.Title, ParagraphAlignment.Right, "H1-20"); row = subTable.AddRow(); row.Cells[0].AddParagraph("REFERENCE:", ParagraphAlignment.Left, "H2-9B-Color"); row.Cells[1].AddParagraph(Invoice.Reference, ParagraphAlignment.Right, "H2-9"); row.Cells[0].AddParagraph("INVOICE DATE:", ParagraphAlignment.Left, "H2-9B-Color"); row.Cells[1].AddParagraph(Invoice.InvoiceDate.ToString("dd/MM/yyyy"), ParagraphAlignment.Right, "H2-9"); row.Cells[0].AddParagraph("DUE DATE:", ParagraphAlignment.Left, "H2-9B-Color"); row.Cells[1].AddParagraph(Invoice.DueDate.ToString("dd/MM/yyyy"), ParagraphAlignment.Right, "H2-9"); }
private void PlaceImage(Stone stone) { Section section = this.document.AddSection(); //Table mainTable = section.AddTable(); //mainTable.Style = "Table"; //mainTable.Borders.Color = new Color(81, 125, 192); //mainTable.Borders.Width = 0.25; //mainTable.Format.SpaceAfter = "5mm"; //Column column = mainTable.AddColumn(Unit.FromMillimeter(170)); //column.Format.Alignment = ParagraphAlignment.Center; ////column = mainTable.AddColumn("7cm"); ////column.Format.Alignment = ParagraphAlignment.Center; //Row row2 = mainTable.AddRow(); //row2.Format.Alignment = ParagraphAlignment.Center; //row2.Format.Font.Bold = true; Image image = section.AddImage(stone.FullFilePath); image.Width = Unit.FromMillimeter(170); image.LockAspectRatio = true; //write the properties table TextFrame frame = section.AddTextFrame(); frame.Left = ShapePosition.Center; frame.Top = "1cm"; this.infopartTable = frame.AddTable(); // this.infopartTable.Format.SpaceBefore = "10mm"; this.infopartTable.Style = "Table"; this.infopartTable.Borders.Color = new Color(81, 125, 192); this.infopartTable.Borders.Width = 0.25; this.infopartTable.BottomPadding = "2mm"; this.infopartTable.LeftPadding = "2mm"; this.infopartTable.RightPadding = "2mm"; this.infopartTable.TopPadding = "2mm"; Column column2 = this.infopartTable.AddColumn("3cm"); column2.Format.Alignment = ParagraphAlignment.Center; column2 = this.infopartTable.AddColumn("2cm"); column2.Format.Alignment = ParagraphAlignment.Center; foreach (var infopart in stone.InfoList) { Row row = this.infopartTable.AddRow(); row.Cells[0].AddParagraph(infopart.TitleForReport); row.Cells[0].Format.Font.Bold = true; row.Cells[0].Format.Alignment = ParagraphAlignment.Left; row.Cells[0].VerticalAlignment = VerticalAlignment.Bottom; row.Cells[1].AddParagraph(infopart.Value); row.Cells[1].Format.Font.Bold = false; row.Cells[1].Format.Alignment = ParagraphAlignment.Left; row.Cells[1].VerticalAlignment = VerticalAlignment.Bottom; } }
private TextFrame WertungenRunden() { var result = new TextFrame(); var maxBreite = _breite_Wertungen; double breite_RundenNr = 1; double breite_Wertungen = maxBreite - breite_RundenNr; var table = result.AddTable(); table.Borders.Visible = false; table.Style = CustomStyles.TABLEKLEIN; table.Rows.Height = "0.95cm"; table.Rows.VerticalAlignment = VerticalAlignment.Center; Column column = table.AddColumn($"{breite_RundenNr}cm"); column.Format.Alignment = ParagraphAlignment.Center; column = table.AddColumn($"{breite_Wertungen / 2}cm"); column.Format.Alignment = ParagraphAlignment.Center; column = table.AddColumn($"{breite_Wertungen / 2}cm"); column.Format.Alignment = ParagraphAlignment.Center; _kopfSpaltenCounter = 0; Row kopfzeile = table.AddRow(); kopfzeile.Height = "0.3cm"; Cell kopfSpalte = AddKopfSpalte(kopfzeile, "Runde"); kopfSpalte.Format.Alignment = ParagraphAlignment.Center; kopfSpalte.Shading.Color = Colors.Gray; kopfSpalte.Format.Font.Color = Colors.White; kopfSpalte = kopfzeile.Cells[1]; kopfSpalte.Format.Alignment = ParagraphAlignment.Center; kopfSpalte.Shading.Color = CustomStyles.ROT; kopfSpalte.Format.Font.Color = Colors.White; kopfSpalte.AddParagraph($"ROT"); kopfSpalte = kopfzeile.Cells[2]; kopfSpalte.Format.Alignment = ParagraphAlignment.Center; kopfSpalte.Shading.Color = CustomStyles.BLAU; kopfSpalte.Format.Font.Color = Colors.White; kopfSpalte.AddParagraph($"BLAU"); int maxKampfrunden = 2; for (int i = 1; i <= maxKampfrunden; i++) { Row zeile = table.AddRow(); Cell spalte = zeile.Cells[0]; spalte.AddParagraph($"{i}"); spalte.Borders.Right.Visible = true; var spalteZwischen = zeile.Cells[1]; spalteZwischen.Borders.Right.Visible = true; if (i != maxKampfrunden) { Row zeilePause = table.AddRow(); zeilePause.Height = "0.3cm"; Cell spalteLeer = zeilePause.Cells[0]; spalteLeer.Shading.Color = Colors.Gray; Cell spaltePauseRot = zeilePause.Cells[1]; spaltePauseRot.Shading.Color = CustomStyles.ROT; spaltePauseRot.Format.Font.Color = Colors.White; spaltePauseRot.AddParagraph($"30 Sekunden Pause"); Cell spaltePauseBlau = zeilePause.Cells[2]; spaltePauseBlau.Shading.Color = CustomStyles.BLAU; spaltePauseBlau.Format.Font.Color = Colors.White; spaltePauseBlau.AddParagraph($"30 Sekunden Pause"); } } return(result); }