public static void DefineTableOfContents(Document document) { Section section = document.LastSection; section.AddPageBreak(); Paragraph paragraph = section.AddParagraph("Table of Contents"); paragraph.Format.Font.Size = 14; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; paragraph = section.AddParagraph(); paragraph.Style = "TOC"; Hyperlink hyperlink = paragraph.AddHyperlink("Paragraphs"); hyperlink.AddText("Paragraphs\t"); hyperlink.AddPageRefField("Paragraphs"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Tables"); hyperlink.AddText("Tables\t"); hyperlink.AddPageRefField("Tables"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Charts"); hyperlink.AddText("Charts\t"); hyperlink.AddPageRefField("Charts"); }
// [UnitTestFunction] public static void TestHyperlink() { Document doc = new Document(); doc.Info.Author = "K.P."; Section sec = doc.Sections.AddSection(); Paragraph par = sec.AddParagraph(); par.AddBookmark("myBookmark1"); Hyperlink hp = par.AddHyperlink("myBookmark1"); hp.AddText("Hyperlink lokal"); hp = par.AddHyperlink("http://www.empira.de", HyperlinkType.Web); hp.AddText("Hyperlink Web"); hp = par.AddHyperlink("RtfHyperlinks.txt", HyperlinkType.File); hp.AddText("Hyperlink Datei Relativ"); hp = par.AddHyperlink(@"\\Klpo01\D$\Kram\Tabs.pdf", HyperlinkType.File); hp.AddText("Hyperlink Datei Netzwerk"); DocumentRenderer docRndrr = new DocumentRenderer(); docRndrr.Render(doc, "RtfHyperlinks.txt", null); File.Copy("RtfHyperlinks.txt", "RtfHyperlinks.rtf", true); System.Diagnostics.Process.Start("RtfHyperlinks.txt"); }
/// <summary> /// Default constructor /// </summary> /// <param name="result">LearnResult - learning result</param> /// <param name="chartFilename">string - char filename</param> /// <param name="includeDataTable">bool - true id learning data should be included</param> public HistoryPDF(LearnByErrorLibrary.LearnResult result, String chartFilename, bool includeDataTable = false) { this.result = result; this.chartFilename = chartFilename; document = new Document(); document.Info.Title = "NBN C# - wynik uczenia sieci neuronowej"; document.Info.Subject = "Uczenie sieci neuronowej za pomocą algorytmu NBN C#"; document.Info.Author = "Marek Bar 33808"; document.Info.Comment = "...ponieważ tylko dobry kod się liczy."; document.Info.Keywords = "C#, NBN, neuron, uczenie, sieć, nbn c#"; DefineStyles(document); DefineCover(document); DefineInfo(document, result); DefineChartArea(document, chartFilename, Path.GetFileNameWithoutExtension(result.Filename)); DefineWeightsSection(document, result); if (includeDataTable) { MatrixMB mat = MatrixMB.Load(result.Filename); AddMatrixTable(document, mat); } Section section = document.LastSection; section.AddPageBreak();//index of pages Paragraph paragraph = section.AddParagraph("Spis treści"); paragraph.Format.Font.Size = 14; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; paragraph = section.AddParagraph(); paragraph.Style = "TOC"; //first link Hyperlink hyperlink = paragraph.AddHyperlink("Informacje na temat sieci neuronowej"); hyperlink.AddText("\r\n" + "Informacje na temat sieci neuronowej" + "\t"); hyperlink.AddPageRefField("Informacje na temat sieci neuronowej"); hyperlink = paragraph.AddHyperlink("Wykres przebiegu uczenia"); hyperlink.AddText("\r\n" + "Wykres przebiegu uczenia" + "\t"); hyperlink.AddPageRefField("Wykres przebiegu uczenia"); hyperlink = paragraph.AddHyperlink("Wagi otrzymane w procesie uczenia"); hyperlink.AddText("\r\n" + "Wagi otrzymane w procesie uczenia" + "\t"); hyperlink.AddPageRefField("Wagi otrzymane w procesie uczenia"); if (includeDataTable) { hyperlink = paragraph.AddHyperlink("Dane wejściowe"); hyperlink.AddText("\r\n" + "Dane wejściowe" + "\t"); hyperlink.AddPageRefField("Dane wejściowe"); } }
/// <summary> /// Builds a table of contents, based on the content /// </summary> /// <param name="doc">The document to define for</param> /// <param name="contents">The content</param> private void DefineTableOfContents(Document doc, IEnumerable <FaseType> contents) { Section sect = doc.LastSection; sect.AddPageBreak(); Paragraph p = sect.AddParagraph("Inhoudsopgave", "Heading1"); p.Format.SpaceAfter = 24; p.Format.OutlineLevel = OutlineLevel.Level1; foreach (FaseType ft in contents) { Paragraph p2 = sect.AddParagraph(); p2.Style = "TOC"; if (ft.Type != null) { Hyperlink hyperlink = p2.AddHyperlink(ft.Type); hyperlink.AddText(ft.Type + "\t"); hyperlink.AddPageRefField(ft.Type); } else { p2.AddFormattedText("Critical data incomplete", "error"); } } }
private void RenderList(Section section, IEnumerable <TextLine> textLines) { string listStyle = _listType == PdfListType.UnorderedList ? "UnorderedList" : "OrderedList"; int level = 1; //TODO: Make multiple levels possible listStyle += level; TextLine line; for (int i = 0; i < textLines.Count(); i++) { line = textLines.ElementAt(i); Paragraph listItem = section.AddParagraph().SetStyle(listStyle); //TODO: Nicer way? E.g. .Render() returns the element instead of directly adding it?! // So we have more power to use the rendered element and have less code?! Like the HTML Converter from SIHF. if (_hyperlinkType == HyperlinkType.Web) { listItem.AddHyperlink(name: line.Text, type: _hyperlinkType); } //TODO: Extension > AsFormattedText? listItem.AddFormattedText( text: line.Text, textFormat: line.IsBold ? TextFormat.Bold : TextFormat.NotBold); listItem.Format.ListInfo.ContinuePreviousList = i > 0; } }
public void FooterSection() { HeaderFooter footer = Pdf.LastSection.Footers.Primary; Table table = footer.AddTable(); table.AddColumn(footer.Section.PageWidth() / 2); table.AddColumn(footer.Section.PageWidth() / 2); Row row = table.AddRow(); if (!string.IsNullOrEmpty(Invoice.Footer)) { Paragraph paragraph = row.Cells[0].AddParagraph(Invoice.Footer, ParagraphAlignment.Left, "H2-8-Blue"); Hyperlink link = paragraph.AddHyperlink(Invoice.Footer, HyperlinkType.Web); } Paragraph info = row.Cells[1].AddParagraph(); info.Format.Alignment = ParagraphAlignment.Right; info.Style = "H2-8"; info.AddText("Page "); info.AddPageField(); info.AddText(" of "); info.AddNumPagesField(); }
/// <summary> /// Builds a table of contents, based on the content /// </summary> /// <param name="doc">The document to define for</param> /// <param name="contents">The content</param> private void DefineTableOfContents(Document doc, IEnumerable <Module> contents) { Section sect = doc.LastSection; sect.AddPageBreak(); Paragraph p = sect.AddParagraph("Inhoudsopgave", "Heading1"); p.Format.SpaceAfter = 24; p.Format.OutlineLevel = OutlineLevel.Level1; foreach (Module m in contents) { Paragraph p2 = sect.AddParagraph(); p2.Style = "TOC"; if (m.Naam != null && m.Schooljaar != null) { Hyperlink hyperlink = p2.AddHyperlink(m.Naam + " - " + m.Schooljaar); hyperlink.AddText(m.Naam + "\t"); hyperlink.AddPageRefField(m.Naam + " - " + m.Schooljaar); } else { p2.AddFormattedText("Critical data incomplete", "error"); } } }
public static void DefineTableOfContents(FinalDocument model) { if (!model.TOC) { return; } Section section = model.Document.AddSection(); section.PageSetup.LeftMargin = 40; section.PageSetup.RightMargin = 40; section.AddPageBreak(); Paragraph paragraph = section.AddParagraph("Contents"); paragraph.Format.Font.Size = 20; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; paragraph.Format.SpaceAfter = "2cm"; // Main title model.MainTitle.ToList().ForEach(x => { paragraph = section.AddParagraph(); paragraph.Style = "TOC 1"; Hyperlink hyperlinkLvl1 = null; // Sub title x.SubTitle.ToList().ForEach(u => { if (hyperlinkLvl1 == null) { hyperlinkLvl1 = paragraph.AddHyperlink(u.Id); hyperlinkLvl1.AddText($"{x.Title}\t"); hyperlinkLvl1.AddPageRefField(u.Id); paragraph.Format.SpaceAfter = "0.25cm"; } paragraph = section.AddParagraph(); paragraph.Style = "TOC 2"; Hyperlink hyperlinkLvl2 = paragraph.AddHyperlink(u.Id); hyperlinkLvl2.AddText($"{(char)160}{(char)160}{(char)160}{(char)160}{u.Title}\t"); hyperlinkLvl2.AddPageRefField(u.Id); }); paragraph.Format.SpaceAfter = "1cm"; }); }
/// <summary> /// Renders the element. /// </summary> /// <param name="pdfStyling">The PDF styling.</param> /// <param name="section">The section.</param> public void Render(IPdfStyling pdfStyling, Section section) { Paragraph paragraph = section.AddParagraph(); Hyperlink hyperlink = paragraph.AddHyperlink(this._text, this._hyperlinkType); hyperlink.AddText(this._text); }
private void DefineTableOfContentsProvinces(Document document) { Section section = document.LastSection; section.AddPageBreak(); Paragraph paragraph = section.AddParagraph("Table of Contents"); paragraph.Format.Font.Size = 14; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; paragraph = section.AddParagraph(); paragraph.Style = "TOC"; Hyperlink hyperlink = paragraph.AddHyperlink("All Provinces"); hyperlink.AddText("All Provinces\t"); hyperlink.AddPageRefField("All Provinces"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Provinces"); hyperlink.AddText("Provinces\t"); hyperlink.AddPageRefField("Provinces"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Province"); hyperlink.AddText("Province\t"); hyperlink.AddPageRefField("Province"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Male Players"); hyperlink.AddText("Male Players\t"); hyperlink.AddPageRefField("Male Players"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Female Players"); hyperlink.AddText("Female Players\t"); hyperlink.AddPageRefField("Female Players"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Events"); hyperlink.AddText("Events\t"); hyperlink.AddPageRefField("Events"); paragraph = section.AddParagraph(); paragraph.Style = "TOC"; hyperlink = paragraph.AddHyperlink("Charts"); hyperlink.AddText("Charts\t"); hyperlink.AddPageRefField("Charts"); }
static void TableOfContents(PdfDocument document) { // Puts the Table of contents on the second page PdfPage page = document.Pages[1]; XGraphics gfx = XGraphics.FromPdfPage(page); gfx.MUH = PdfFontEncoding.Unicode; // Create MigraDoc document + Setup styles Document doc = new Document(); Styles.DefineStyles(doc); // Add header Section section = doc.AddSection(); Paragraph paragraph = section.AddParagraph("Table of Contents"); paragraph.Format.Font.Size = 14; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; // Add links - these are the PdfSharp outlines/bookmarks added previously when concatinating the pages foreach (var bookmark in document.Outlines) { paragraph = section.AddParagraph(); paragraph.Style = "TOC"; //paragraph.AddBookmark(bookmark.Title); Hyperlink hyperlink = paragraph.AddHyperlink(bookmark.Title); hyperlink.AddText($"{bookmark.Title}\t"); //hyperlink.AddPageRefField(bookmark.Title); } // Render document DocumentRenderer docRenderer = new DocumentRenderer(doc); docRenderer.PrepareDocument(); docRenderer.RenderPage(gfx, 1); gfx.Dispose(); }
/// <summary> /// Export name to a section in a document /// </summary> /// <param name="toExport">The data to export from</param> /// <param name="sect">The section to write on</param> /// <returns>The section with appended data</returns> public override Section Export(Leerlijn toExport, Section sect) { base.Export(toExport, sect); //custom code Paragraph p = sect.AddParagraph("Modules in deze leerlijn", "Heading2"); p.AddLineBreak(); p = sect.AddParagraph(); p.AddFormattedText("De leerlijnen zijn klikbaar in PDF viewers").Font.Color = Colors.DarkGray; p.AddLineBreak(); p.AddLineBreak(); foreach (Module m in toExport.Module) { p.AddFormattedText((m.Naam ?? "Data niet gevonden")).Font.Bold = true; p.AddLineBreak(); p.AddFormattedText("Komt ook voor in:").Font.Color = Colors.DarkGray; p.AddLineBreak(); List <Leerlijn> otherLines = m.Leerlijn.ToList(); foreach (Leerlijn l in otherLines) { if (!l.Naam.Equals(toExport.Naam)) { p.AddTab(); Hyperlink hyperlink = p.AddHyperlink((l.Naam ?? "Data niet gevonden")); hyperlink.AddText((l.Naam ?? "Data niet gevonden") + ", zie ook pagina "); hyperlink.AddPageRefField((l.Naam ?? "Data niet gevonden")); hyperlink.Font.Underline = Underline.Single; p.AddLineBreak(); } } p.AddLineBreak(); } return(sect); }
/// <summary> /// Creates the static parts of the invoice. /// </summary> private void CreatePage() { // Each MigraDoc document needs at least one section. Section section = this.document.AddSection(); var with_2 = section.PageSetup; //.HeaderDistance = "1cm" with_2.TopMargin = "4,5cm"; with_2.BottomMargin = "3,0cm"; with_2.FooterDistance = "0,3cm"; // Create footer // Put a logo in the header Image image = section.Headers.Primary.AddImage(Logo); image.Height = "2.5cm"; image.LockAspectRatio = true; image.RelativeVertical = RelativeVertical.Line; image.RelativeHorizontal = RelativeHorizontal.Margin; image.Top = ShapePosition.Top; image.Left = ShapePosition.Right; image.WrapFormat.Style = WrapStyle.Through; // Create the text frame for the address //section.Headers.Primary.AddParagraph() this.addressFrame = section.Headers.Primary.AddTextFrame(); //AddParagraph() 'section.AddTextFrame() this.addressFrame.Top = "3.0cm"; this.addressFrame.Left = ShapePosition.Left; //.Height = "3.0cm" this.addressFrame.Width = "7.0cm"; this.addressFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.addressFrame.RelativeVertical = RelativeVertical.Page; // Create the text frame for the address //section.Headers.Primary.AddParagraph() this.deleveryFrame = section.Headers.Primary.AddTextFrame(); //AddParagraph() 'section.AddTextFrame() this.deleveryFrame.Top = "2.0cm"; this.deleveryFrame.Left = "7.00cm"; //ShapePosition.Left this.deleveryFrame.Width = "5.0cm"; //.Height = "3.0cm" this.deleveryFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.deleveryFrame.RelativeVertical = RelativeVertical.Page; // Create footer Paragraph paragraph = section.Footers.Primary.AddParagraph(); var with_7 = paragraph.Format; with_7.SpaceBefore = "1cm"; with_7.Font.Size = 7; with_7.Borders.Color = RescueTekniq.Doc.IncassoForm_Dk.TableBorder; with_7.Borders.Width = 0.25; with_7.Borders.Left.Width = 0.5; with_7.Borders.Right.Width = 0.5; with_7.Alignment = ParagraphAlignment.Center; paragraph.AddText(Config.Company.name); paragraph.AddText(" · "); paragraph.AddText(Config.Company.adresse); paragraph.AddText(" · "); paragraph.AddText(Config.Company.zipcode); paragraph.AddText(" "); paragraph.AddText(Config.Company.city); if (this.Incasso.Virksomhed.LandekodeID != 45) { paragraph.AddText(" · "); paragraph.AddText(Config.Company.country); } paragraph.AddText(" · "); paragraph.AddText("CVR.nr. "); paragraph.AddText(Config.Company.vatno); paragraph.AddText(" · "); if (this.Incasso.Virksomhed.LandekodeID != 45) { paragraph.AddText("Pho. "); paragraph.AddText(Config.Company.int_phone); } else { paragraph.AddText("Tlf. "); paragraph.AddText(Config.Company.phone); } paragraph.AddText(" · "); Hyperlink link = paragraph.AddHyperlink("http://" + Config.Company.link, HyperlinkType.Web); link.AddFormattedText(Config.Company.link); var with_8 = section.Footers.Primary.AddParagraph(); var with_9 = with_8.Format; with_9.Font.Size = 4; with_9.Alignment = ParagraphAlignment.Center; with_8.AddLineBreak(); with_8.AddLineBreak(); with_8.AddText(string.Format("- {0}Incasso varsel nr. {1}", EANtitle, Incasso.ID)); if (IsCopy) { with_8.AddText(" kopi"); } with_8.AddText(" - side "); with_8.AddPageField(); with_8.AddText(" af "); with_8.AddNumPagesField(); with_8.AddText(" - "); // Create the text frame for the address this.headerFrame = section.AddTextFrame(); this.headerFrame.Height = "2.0cm"; this.headerFrame.Width = "5.5cm"; this.headerFrame.Left = ShapePosition.Right; this.headerFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.headerFrame.Top = "4.5cm"; this.headerFrame.RelativeVertical = RelativeVertical.Page; // Add the print date field paragraph = this.headerFrame.AddParagraph(); string Cvrnr = Config.Company.vatno; paragraph.Style = "Reference"; //.Format.Alignment = ParagraphAlignment.Right //Select Case Invoice.Status // Case Invoice_StatusEnum.IncassoNotis // '.AddFormattedText("Incasso varsel", TextFormat.Bold) // Case Invoice_StatusEnum.FirstReminder // .AddFormattedText(String.Format("1. Rykker på faktura nr.{0}", Invoice.ID), TextFormat.Bold) // Case Else // .AddFormattedText(String.Format("{0}Faktura nr. {1}", EANtitle, Invoice.ID), TextFormat.Bold) // If IsCopy Then // .AddFormattedText(" - kopi", TextFormat.Bold) // End If //End Select //.AddLineBreak() paragraph.AddText("Dato: "); paragraph.AddDateField("yyyy-MM-dd"); paragraph.AddLineBreak(); paragraph.AddText("Sagsnr.: "); paragraph.AddFormattedText(string.Format("{0}", Incasso.ID), TextFormat.Bold); paragraph.AddLineBreak(); paragraph.AddText("Kreditor: "); paragraph.AddFormattedText(Config.Company.name, TextFormat.Bold); paragraph.AddLineBreak(); paragraph.AddLineBreak(); // Add the print date field paragraph = section.AddParagraph(); paragraph.Format.SpaceBefore = "3cm"; paragraph.Style = "Reference"; paragraph.AddFormattedText(string.Format("Incasso varsel - Vedr. faktura nr. {0}", Incasso.Invoice.ID), TextFormat.Bold); paragraph.AddLineBreak(); // Add the print date field paragraph = section.AddParagraph(); paragraph.Style = "Reference"; paragraph.AddText("Vi skal hermed rykke Dem for betaling af Deres gæld, som nu er opgjort til:"); //Select Case Invoice.Status // Case Invoice_StatusEnum.IncassoNotis // .AddText(String.Format("{0} har bedt os om at rykke Dem for betaling af Deres gæld, som nu er opgjort til:", Config.Company.name)) // Case Invoice_StatusEnum.FirstReminder // .AddText(String.Format("Hermed skal vi bringe vort tilgodehavende i henhold til ovennævnte faktura nr. {0} i erindring – da vi ikke kan se at denne er betalt", Invoice.ID)) // ' – og vi skal herved erindre om indbetaling af nedennævnte beløb.", Invoice.ID)) // .AddLineBreak() // .AddText("Såfremt beløbet er indbetalt inden modtagelse af denne skrivelse – bedes De bortse fra denne.") // .AddLineBreak() // Case Else // .AddText("I henhold til aftale fremsendes hermed faktura på:") //End Select // Create the item table this.table = section.AddTable(); this.table.Style = "Table"; //.Borders.Color = TableBorder this.table.Borders.Width = 0; //0.25 '0.25 this.table.Borders.Left.Width = 0; //0.5 this.table.Borders.Right.Width = 0; //0.5 this.table.Rows.LeftIndent = 0; this.table.Format.Font.Size = "8pt"; this.table.Format.Alignment = ParagraphAlignment.Center; // Before you can add a row, you must define the columns //Dim column As Column var with_15 = this.table.AddColumn("1cm"); with_15.Format.Alignment = ParagraphAlignment.Left; var with_16 = this.table.AddColumn("12,5cm"); with_16.Format.Alignment = ParagraphAlignment.Left; var with_17 = this.table.AddColumn("2,5cm"); with_17.Format.Alignment = ParagraphAlignment.Right; //' Create the header of the table //Dim row As Row //row = table.AddRow() //With row // .HeadingFormat = True // .Format.Alignment = ParagraphAlignment.Center // .Format.Font.Bold = True // .Shading.Color = TableBlue // .Cells(0).AddParagraph("Vare nr") // .Cells(0).Format.Alignment = ParagraphAlignment.Left // .Cells(1).AddParagraph("i alt") // .Cells(1).Format.Alignment = ParagraphAlignment.Right //End With //Me.table.SetEdge(0, 0, 7, 1, Edge.Box, BorderStyle.[Single], 0.75, Color.Empty) }
/// <summary> /// Creates the static parts of the invoice. /// </summary> private void CreatePage() { // Each MigraDoc document needs at least one section. Section section = this.document.AddSection(); var with_2 = section.PageSetup; //.HeaderDistance = "1cm" with_2.TopMargin = "4,5cm"; with_2.BottomMargin = "3,0cm"; with_2.FooterDistance = "0,3cm"; // Create footer // Put a logo in the header Image image = section.Headers.Primary.AddImage(Logo); image.Height = "2.5cm"; image.LockAspectRatio = true; image.RelativeVertical = RelativeVertical.Line; image.RelativeHorizontal = RelativeHorizontal.Margin; image.Top = ShapePosition.Top; image.Left = ShapePosition.Right; image.WrapFormat.Style = WrapStyle.Through; // Create the text frame for the address //section.Headers.Primary.AddParagraph() this.addressFrame = section.Headers.Primary.AddTextFrame(); //AddParagraph() 'section.AddTextFrame() //.Height = "3.0cm" this.addressFrame.Width = "8.0cm"; this.addressFrame.Left = ShapePosition.Left; this.addressFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.addressFrame.Top = "2.0cm"; this.addressFrame.RelativeVertical = RelativeVertical.Page; // Create footer Paragraph paragraph = section.Footers.Primary.AddParagraph(); var with_6 = paragraph.Format; with_6.SpaceBefore = "1cm"; with_6.Font.Size = 7; with_6.Borders.Color = RescueTekniq.Doc.TilbudFolgemail_Dk.TableBorder; with_6.Borders.Width = 0.25; with_6.Borders.Left.Width = 0.5; with_6.Borders.Right.Width = 0.5; with_6.Alignment = ParagraphAlignment.Center; paragraph.AddText(Company.name); paragraph.AddText(" · "); paragraph.AddText(Company.adresse); paragraph.AddText(" · "); paragraph.AddText(Company.zipcode); paragraph.AddText(" "); paragraph.AddText(Company.city); if (this.tilbud.Virksomhed.LandekodeID != 45) { paragraph.AddText(" · "); paragraph.AddText(Company.country); } paragraph.AddText(" · "); paragraph.AddText("CVR.nr. "); paragraph.AddText(Company.vatno); paragraph.AddText(" · "); if (this.tilbud.Virksomhed.LandekodeID != 45) { paragraph.AddText("Pho. "); paragraph.AddText(Company.int_phone); } else { paragraph.AddText("Tlf. "); paragraph.AddText(Company.phone); } paragraph.AddText(" · "); Hyperlink link = paragraph.AddHyperlink(string.Format("http://{0}", Company.link), HyperlinkType.Web); link.AddFormattedText(Company.link); var with_7 = section.Footers.Primary.AddParagraph(); var with_8 = with_7.Format; with_8.Font.Size = 4; with_8.Alignment = ParagraphAlignment.Center; with_7.AddLineBreak(); with_7.AddLineBreak(); with_7.AddText("- TILBUD nr. " + tilbud.ID.ToString()); with_7.AddText(" - side "); with_7.AddPageField(); with_7.AddText(" af "); with_7.AddNumPagesField(); with_7.AddText(" - "); // Create the text frame for the address this.headerFrame = section.AddTextFrame(); this.headerFrame.Height = "2.0cm"; this.headerFrame.Width = "4.0cm"; this.headerFrame.Left = ShapePosition.Right; this.headerFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.headerFrame.Top = "4.5cm"; this.headerFrame.RelativeVertical = RelativeVertical.Page; // Add the print date field paragraph = this.headerFrame.AddParagraph(); paragraph.Style = "Reference"; //.Format.Alignment = ParagraphAlignment.Right paragraph.AddFormattedText("TILBUD nr. " + tilbud.ID.ToString(), TextFormat.Bold); paragraph.AddLineBreak(); paragraph.AddText(Company.city); //("Hillerød, ") paragraph.AddText(", "); paragraph.AddDateField("dd.MM.yyyy"); paragraph.AddLineBreak(); paragraph.AddText(System.Convert.ToString("/" + System.Convert.ToString(this.tilbud.Ansvarlig != "" ? this.tilbud.Ansvarlig : "LFU"))); paragraph.AddLineBreak(); paragraph.AddLineBreak(); paragraph.AddText("Side "); paragraph.AddPageField(); paragraph.AddText(" af "); paragraph.AddNumPagesField(); //' Put sender in address frame //paragraph = Me.addressFrame.AddParagraph() //With paragraph // .AddText("Heart2Start Aps · Gefionsvej 8 · 3400 Hillerød") // .Format.Font.Name = "Times New Roman" // .Format.Font.Size = 7 // .Format.SpaceAfter = 3 //End With // Add the print date field //paragraph = section.AddParagraph() //With paragraph // .Format.SpaceBefore = "5cm" // .Style = "Reference" // .AddFormattedText("TILBUD nr. " & tilbud.ID.ToString, TextFormat.Bold) // .AddTab() // .AddText("Hillerød, ") // .AddDateField("dd.MM.yyyy") // .Format.Font.Color = RGB(255, 0, 0) //End With // Add the print date field paragraph = section.AddParagraph(); paragraph.Format.SpaceBefore = "3cm"; paragraph.Style = "Reference"; paragraph.AddFormattedText("Fremsendelse af tilbud", TextFormat.Bold); paragraph.AddLineBreak(); // Add the print date field paragraph = section.AddParagraph(); paragraph.Style = "Reference"; paragraph.AddText("I henhold til aftale fremsendes hermed tilbud på:"); // Create the item table this.table = section.AddTable(); this.table.Style = "Table"; this.table.Borders.Color = RescueTekniq.Doc.TilbudFolgemail_Dk.TableBorder; this.table.Borders.Width = 0.25; this.table.Borders.Left.Width = 0.5; this.table.Borders.Right.Width = 0.5; this.table.Rows.LeftIndent = 0; // Before you can add a row, you must define the columns Column column; column = this.table.AddColumn("1cm"); //1cm - Antal column.Format.Alignment = ParagraphAlignment.Center; column = this.table.AddColumn("7,75cm"); //3cm - Beskrivelse column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1,75cm"); //3cm - Stk. pris DKK column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1,75cm"); //3cm - Reduktion column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1,75cm"); //3cm - á pris column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("2cm"); //3cm - i alt column.Format.Alignment = ParagraphAlignment.Right; // 1+(5*3) = 16 cm | 1+7,5+2+1+2+2,5 // Create the header of the table Row row = default(Row); //row = table.AddRow() //With row // .HeadingFormat = True // .Format.Alignment = ParagraphAlignment.Center // .Format.Font.Bold = True // .Shading.Color = TableBlue // .Cells(0).AddParagraph("Antal") // .Cells(0).Format.Font.Bold = False // .Cells(0).Format.Alignment = ParagraphAlignment.Left // .Cells(0).VerticalAlignment = VerticalAlignment.Bottom // .Cells(0).MergeDown = 1 // .Cells(1).AddParagraph("Beskrivelse") // .Cells(1).Format.Alignment = ParagraphAlignment.Left // .Cells(1).MergeRight = 3 // .Cells(5).AddParagraph("i alt") // .Cells(5).Format.Alignment = ParagraphAlignment.Right 'Left // .Cells(5).VerticalAlignment = VerticalAlignment.Bottom // .Cells(5).MergeDown = 1 //End With row = table.AddRow(); row.HeadingFormat = true; row.Format.Alignment = ParagraphAlignment.Center; row.Format.Font.Bold = true; row.Shading.Color = RescueTekniq.Doc.TilbudFolgemail_Dk.TableBlue; row.Cells[0].AddParagraph("Antal"); row.Cells[0].Format.Font.Bold = false; row.Cells[0].Format.Alignment = ParagraphAlignment.Left; row.Cells[0].VerticalAlignment = VerticalAlignment.Bottom; //.Cells(0).MergeDown = 1 row.Cells[1].AddParagraph("Beskrivelse"); row.Cells[1].Format.Alignment = ParagraphAlignment.Left; row.Cells[2].AddParagraph("Stk. pris "); //DKK row.Cells[2].Format.Alignment = ParagraphAlignment.Left; row.Cells[3].AddParagraph("Reduktion"); // (%)Ambassadør - Reduktion row.Cells[3].Format.Alignment = ParagraphAlignment.Left; row.Cells[4].AddParagraph("á pris"); row.Cells[4].Format.Alignment = ParagraphAlignment.Left; row.Cells[5].AddParagraph("i alt"); row.Cells[5].Format.Alignment = ParagraphAlignment.Right; //Left row.Cells[5].VerticalAlignment = VerticalAlignment.Bottom; //.Cells(5).MergeDown = 1 this.table.SetEdge(0, 0, 6, 1, Edge.Box, BorderStyle.Single, 0.75, Color.Empty); }
public static Document CreateDocument() { // Create a new MigraDoc document Document document = new Document(); document.Info.Title = "SAMPLE TITLE NOTE"; document.Info.Subject = "Auto generated file of all list of items notes"; document.Info.Author = "Data Migration "; DefineStyles(document); DefineCover(document); Section section = document.LastSection; section.AddPageBreak(); Paragraph paragraph = section.AddParagraph("Table of Contents"); paragraph.Format.Font.Size = 14; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; var list = new List <LogEntry>() { new LogEntry() { LogId = 1, Desc = "sdfsdfsd sdf", Summary = "lorem sdfds sdfs dfds", CreatedOn = DateTime.Now }, new LogEntry() { LogId = 2, Desc = "XXXX XXXX", Summary = "SSSSS SSSSdfds sdSS SSS fs dfds" } }; foreach (var i in list) //loop for each item { paragraph = section.AddParagraph(); paragraph.Style = "TOC"; Hyperlink hyperlink = paragraph.AddHyperlink(i.LogId.ToString()); hyperlink.AddText(i.Desc + "\t"); hyperlink.AddPageRefField(i.LogId.ToString()); } DefineContentSection(document); foreach (var i in list) //loop for each item { //for each item do this Paragraph paragraph_S = document.LastSection.AddParagraph(i.Desc, "Heading1"); paragraph_S.AddBookmark(i.LogId.ToString()); Table table = new Table(); table.Borders.Width = 0.75; Column column = table.AddColumn("16cm"); column.Format.Alignment = ParagraphAlignment.Left; Row row = table.AddRow(); paragraph = row.Cells[0].AddParagraph(); paragraph.AddFormattedText("hello", TextFormat.Bold); paragraph.AddFormattedText(" by ", TextFormat.Italic); paragraph.AddLineBreak(); paragraph.AddText("XXXXX "); row = table.AddRow(); paragraph = row.Cells[0].AddParagraph(); paragraph.AddFormattedText("hellosdf", TextFormat.Bold); paragraph.AddFormattedText(" by ssdfds", TextFormat.Italic); paragraph.AddText(i.CreatedOn?.ToString("MM/dd/yyyy h:mm tt") ?? ""); table.SetEdge(0, 0, 1, table.Rows.Count, Edge.Box, BorderStyle.Single, 1.5, Colors.Black); document.LastSection.Add(table); } return(document); }
public static void WriteFormattedParagraphFromContent(ref Paragraph p, string content) { //replace the vars string moddedcontent = content; moddedcontent = content.Replace("%refference%", "b.bookingReference"); string[] content_array = moddedcontent.Split('|'); foreach (string s in content_array) { if (s != string.Empty) { if (s.First().ToString() == "l") { p.AddLineBreak(); string s1 = s.Remove(0, 1); if (s1.First().ToString() == "b") { p.AddFormattedText(s1.Remove(0, 1), TextFormat.Bold); } else if (s1.First().ToString() == "t") { p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading9); } else if (s1.First().ToString() == "r") { p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading6); } else if (s1.First().ToString() == "c") { p.AddFormattedText(s1.Remove(0, 1), TextFormat.Bold); } else if (s1.First().ToString() == "u") { p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading7); } else if (s1.First().ToString() == "o" && s1[1].ToString() == " ") { p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading4); } else if (s1.First().ToString() == "z") { p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading8); } else if (s1.First().ToString() == "") { // p.AddFormattedText(s1.Remove(0, 1), StyleNames.Heading4); } else if (s1.First().ToString() == "a") { p.AddFormattedText(" " + s1.Remove(0, 1), TextFormat.Bold); } else if (s1.First().ToString() == "h") { string hlinktext = s1.Remove(0, 1).Split('=').Last().Trim(); if (hlinktext.Length > 4) { if (hlinktext.Substring(0, 4).ToLower() != "http") { hlinktext = "http://" + hlinktext; } } Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url); hlink.Font.Color = new Color(24, 106, 207); hlink.Font.Underline += 1; hlink.AddFormattedText(s1.Remove(0, 1).Split('=').First()); } else if (s1.First().ToString() == "e") { string hlinktext = "mailto:" + s1.Remove(0, 1); Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url); hlink.Font.Color = new Color(24, 106, 207); hlink.Font.Underline += 1; hlink.AddFormattedText(s1.Remove(0, 1).ToUpper(), TextFormat.Bold); } else if (s1.First().ToString() == "s") { p.AddSpace(1); } else { p.AddText(s1); } } else { if (s.First().ToString() == "b") { p.AddFormattedText(s.Remove(0, 1), TextFormat.Bold); } else if (s.First().ToString() == "t") { p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading9); } else if (s.First().ToString() == "c") { p.AddFormattedText(s.Remove(0, 1), TextFormat.Bold); } else if (s.First().ToString() == "r") { p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading6); } else if (s.First().ToString() == "u") { p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading7); } else if (s.First().ToString() == "o" && s[1].ToString() == " ") { p.AddFormattedText(s.Remove(0, 1), StyleNames.Heading4); } else if (s.First().ToString() == "a") { p.AddFormattedText(" " + s.Remove(0, 1), TextFormat.Bold); } else if (s.First().ToString() == "h") { string hlinktext = s.Remove(0, 1).Split('=').Last().Trim(); if (hlinktext.Length > 4) { if (hlinktext.Substring(0, 4).ToLower() != "http") { hlinktext = "http://" + hlinktext; } } Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url); hlink.Font.Color = new Color(24, 106, 207); hlink.Font.Underline += 1; hlink.AddFormattedText(s.Remove(0, 1).Split('=').First()); } else if (s.First().ToString() == "e") { string hlinktext = "mailto:" + s.Remove(0, 1); Hyperlink hlink = p.AddHyperlink(hlinktext, HyperlinkType.Url); hlink.Font.Color = new Color(24, 106, 207); hlink.Font.Underline += 1; hlink.AddFormattedText(s.Remove(0, 1).ToUpper(), TextFormat.Bold); } else if (s.First().ToString() == "s") { p.AddSpace(1); } else { p.AddText(s); } } } } }
public static Document CreateDocument() { // Create a new MigraDoc document Document document = new Document(); document.Info.Title = " list NOTE"; document.Info.Subject = " generated file of all list notes"; document.Info.Author = "Data Migration Lange"; DefineStyles(document); DefineCover(document); Section section = document.LastSection; section.AddPageBreak(); Paragraph paragraph = section.AddParagraph("Table of Contents"); paragraph.Format.Font.Size = 14; paragraph.Format.Font.Bold = true; paragraph.Format.SpaceAfter = 24; paragraph.Format.OutlineLevel = OutlineLevel.Level1; //loop for each item { paragraph = section.AddParagraph(); paragraph.Style = "TOC"; Hyperlink hyperlink = paragraph.AddHyperlink("Table Overview"); hyperlink.AddText("Table Overview\t"); hyperlink.AddPageRefField("Table Overview"); } DefineContentSection(document); //for each item do this Paragraph paragraph_S = document.LastSection.AddParagraph("Table Overview", "Heading1"); paragraph_S.AddBookmark("Table Overview"); Table table = new Table(); table.Borders.Width = 0.75; Column column = table.AddColumn("16cm"); column.Format.Alignment = ParagraphAlignment.Left; //column = table.AddColumn(); //column.Format.Alignment = ParagraphAlignment.Left; Row row = table.AddRow(); //row.Shading.Color = Colors.PaleGoldenrod; //Cell cell = row.Cells[0]; //cell.Style = "BOLD"; //cell.AddParagraph("Itemus"); //cell.Style = "NOR"; //cell.AddParagraph("sdfsdf sdfsdf sdfsdf ssdfsdfsdf"); paragraph = row.Cells[0].AddParagraph(); paragraph.AddFormattedText("hello", TextFormat.Bold); paragraph.AddFormattedText(" by ", TextFormat.Italic); paragraph.AddLineBreak(); paragraph.AddText("XXXXX "); row = table.AddRow(); paragraph = row.Cells[0].AddParagraph(); paragraph.AddFormattedText("hellosdf", TextFormat.Bold); paragraph.AddFormattedText(" by ssdfds", TextFormat.Italic); paragraph.AddText("XXXXXsdf sdfdsf "); table.SetEdge(0, 0, 1, table.Rows.Count, Edge.Box, BorderStyle.Single, 1.5, Colors.Black); document.LastSection.Add(table); section.AddPageBreak(); return(document); }
/// <summary> /// Creates the static parts of the invoice. /// </summary> private void OrderForm_CreatePage() { // Each MigraDoc document needs at least one section. Section section = this.document.AddSection(); var with_2 = section.PageSetup; //.HeaderDistance = "1cm" with_2.TopMargin = "4,5cm"; with_2.BottomMargin = "3,0cm"; with_2.FooterDistance = "0,3cm"; // Create footer // Put a logo in the header Image image = section.Headers.Primary.AddImage(Logo); image.Height = "2.5cm"; image.LockAspectRatio = true; image.RelativeVertical = RelativeVertical.Line; image.RelativeHorizontal = RelativeHorizontal.Margin; image.Top = ShapePosition.Top; image.Left = ShapePosition.Right; image.WrapFormat.Style = WrapStyle.Through; // Create the text frame for the address //section.Headers.Primary.AddParagraph() this.addressFrame = section.Headers.Primary.AddTextFrame(); //AddParagraph() 'section.AddTextFrame() this.addressFrame.Top = "3.0cm"; this.addressFrame.Left = ShapePosition.Left; //.Height = "3.0cm" this.addressFrame.Width = "7.0cm"; this.addressFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.addressFrame.RelativeVertical = RelativeVertical.Page; // Create the text frame for the address //section.Headers.Primary.AddParagraph() this.deleveryFrame = section.Headers.Primary.AddTextFrame(); //AddParagraph() 'section.AddTextFrame() this.deleveryFrame.Top = "2.0cm"; this.deleveryFrame.Left = "7.00cm"; //ShapePosition.Left this.deleveryFrame.Width = "5.0cm"; //.Height = "3.0cm" this.deleveryFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.deleveryFrame.RelativeVertical = RelativeVertical.Page; // Create footer Paragraph paragraph = section.Footers.Primary.AddParagraph(); var with_7 = paragraph.Format; with_7.SpaceBefore = "1cm"; with_7.Font.Size = 7; with_7.Borders.Color = RescueTekniq.Doc.OrderForm_Dk.TableBorder; with_7.Borders.Width = 0.25; with_7.Borders.Left.Width = 0.5; with_7.Borders.Right.Width = 0.5; with_7.Alignment = ParagraphAlignment.Center; paragraph.AddText(Company.name); //("Heart2Start ApS") paragraph.AddText(" · "); paragraph.AddText(Company.adresse); //("Gefionsvej 8") paragraph.AddText(" · "); paragraph.AddText(Company.zipcode); //("3400") paragraph.AddText(" "); paragraph.AddText(Company.city); //("Hillerød") if (this.Invoice.Virksomhed.LandekodeID != 45) { paragraph.AddText(" · "); paragraph.AddText(Company.country); //("Denmark") } paragraph.AddText(" · "); paragraph.AddText("CVR.nr. "); paragraph.AddText(Company.vatno); //("32446329") paragraph.AddText(" · "); if (this.Invoice.Virksomhed.LandekodeID != 45) { paragraph.AddText("Pho. "); paragraph.AddText(Company.int_phone); //("+45 48212879") } else { paragraph.AddText("Tlf. "); paragraph.AddText(Company.phone); //("48212879") } paragraph.AddText(" · "); //.AddText("www.RescueTekniq.dk") Hyperlink link = paragraph.AddHyperlink(string.Format("http://{0}", Company.link), HyperlinkType.Web); link.AddFormattedText(Company.link); //("www.RescueTekniq.dk") //.AddHyperlink("www.RescueTekniq.dk", HyperlinkType.Web) var with_8 = section.Footers.Primary.AddParagraph(); var with_9 = with_8.Format; with_9.Font.Size = 4; with_9.Alignment = ParagraphAlignment.Center; with_8.AddLineBreak(); with_8.AddLineBreak(); with_8.AddText("- " + EANtitle + "Faktura nr. " + Invoice.ID.ToString()); if (IsCopy) { with_8.AddText(" kopi"); } with_8.AddText(" - side "); with_8.AddPageField(); with_8.AddText(" af "); with_8.AddNumPagesField(); with_8.AddText(" - "); // Create the text frame for the address this.headerFrame = section.AddTextFrame(); this.headerFrame.Height = "2.0cm"; this.headerFrame.Width = "5.5cm"; this.headerFrame.Left = ShapePosition.Right; this.headerFrame.RelativeHorizontal = RelativeHorizontal.Margin; this.headerFrame.Top = "4.5cm"; this.headerFrame.RelativeVertical = RelativeVertical.Page; // Add the print date field paragraph = this.headerFrame.AddParagraph(); string Cvrnr = Company.vatno; //ConfigurationManager.AppSettings("company.vatno") // <add key="company.vatno" value="32446329" /> paragraph.Style = "Reference"; //.Format.Alignment = ParagraphAlignment.Right paragraph.AddFormattedText(EANtitle + "Følgebrev nr. " + Invoice.ID.ToString(), TextFormat.Bold); paragraph.AddLineBreak(); paragraph.AddText(Company.city); //("Hillerød, ") paragraph.AddLineBreak(); paragraph.AddText("dato: "); paragraph.AddText(Invoice.InvoiceDate.ToString("dd-MM-yyyy")); //.AddDateField("dd. MMM yyyy") paragraph.AddLineBreak(); paragraph.AddText("CVR: "); paragraph.AddFormattedText(Cvrnr, TextFormat.Bold); paragraph.AddLineBreak(); paragraph.AddText(this.Invoice.RettetAf.ToUpper()); paragraph.AddText("/"); if (this.Invoice.ResponsibleName.Trim() != "") { paragraph.AddText(this.Invoice.ResponsibleName.ToUpper()); } paragraph.AddLineBreak(); paragraph.AddLineBreak(); paragraph.AddText("Side "); paragraph.AddPageField(); paragraph.AddText(" af "); paragraph.AddNumPagesField(); // Add the print date field paragraph = section.AddParagraph(); paragraph.Format.SpaceBefore = "3cm"; paragraph.Style = "Reference"; paragraph.AddFormattedText(EANtitle + "Følgebrev", TextFormat.Bold); paragraph.AddLineBreak(); // Add the print date field paragraph = section.AddParagraph(); paragraph.Style = "Reference"; paragraph.AddText("I henhold til aftale fremsendes hermed:"); // Create the item table this.table = section.AddTable(); this.table.Style = "Table"; this.table.Borders.Color = RescueTekniq.Doc.OrderForm_Dk.TableBorder; this.table.Borders.Width = 0.25; //0.25 this.table.Borders.Left.Width = 0.5; this.table.Borders.Right.Width = 0.5; this.table.Rows.LeftIndent = 0; this.table.Format.Font.Size = "8pt"; // Before you can add a row, you must define the columns Column column; column = this.table.AddColumn("2,25cm"); // - Item no column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn(); //("6,50cm") ' - Item Name / Serial No column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1,00cm"); // - Quantity column.Format.Alignment = ParagraphAlignment.Center; //column = Me.table.AddColumn("1,50cm") ' - Item Price //column.Format.Alignment = ParagraphAlignment.Right //column = Me.table.AddColumn("1,25cm") ' - Discount //column.Format.Alignment = ParagraphAlignment.Right //column = Me.table.AddColumn("1,50cm") ' - Sales price //column.Format.Alignment = ParagraphAlignment.Right //column = Me.table.AddColumn("2,00cm") ' - Line total //column.Format.Alignment = ParagraphAlignment.Right //' Sum CM must be = 16 cm | 1+7,5+2+1+2+2,5 //' // Create the header of the table Row row = default(Row); row = table.AddRow(); row.HeadingFormat = true; row.Format.Alignment = ParagraphAlignment.Center; row.Format.Font.Bold = true; row.Shading.Color = RescueTekniq.Doc.OrderForm_Dk.TableBlue; row.Cells[0].AddParagraph("Vare nr"); row.Cells[0].Format.Alignment = ParagraphAlignment.Left; row.Cells[1].AddParagraph("Tekst"); row.Cells[1].Format.Alignment = ParagraphAlignment.Left; row.Cells[2].AddParagraph("Antal"); //.Cells(2).Format.Font.Bold = False row.Cells[2].Format.Alignment = ParagraphAlignment.Left; //.Cells(2).VerticalAlignment = VerticalAlignment.Bottom //.Cells(3).AddParagraph("Stk. pris ") 'DKK //.Cells(3).Format.Alignment = ParagraphAlignment.Left //.Cells(4).AddParagraph("Rabat") ' (%)Ambassadør - Reduktion //.Cells(4).Format.Alignment = ParagraphAlignment.Left //.Cells(5).AddParagraph("á pris") //.Cells(5).Format.Alignment = ParagraphAlignment.Left //.Cells(6).AddParagraph("i alt DKK") //.Cells(6).Format.Alignment = ParagraphAlignment.Right //'.Cells(6).VerticalAlignment = VerticalAlignment.Bottom //'.Cells(6).MergeDown = 1 this.table.SetEdge(0, 0, 3, 1, Edge.Box, BorderStyle.Single, 0.75, Color.Empty); }
private void addBesked() { Paragraph paragraph = default(Paragraph); // Add the notes paragraph paragraph = this.document.LastSection.AddParagraph(); //.Format.Font.Size = 7 //With .Format // .Font.Size = 8 paragraph.Format.SpaceBefore = "5mm"; // '.Borders.Width = 0.75 // '.Borders.Distance = 3 // '.Borders.Color = TableBorder // '.Shading.Color = TableGray //End With paragraph.AddText("Dette tilbud er gældende i 3 uger fra d.d."); paragraph.AddLineBreak(); paragraph = this.document.LastSection.AddParagraph(); paragraph.Format.SpaceBefore = "5mm"; //.Format.Font.Size = 7 paragraph.AddText("Accept af tilbud kan foretages on-line ved fremsendelse af accept på mailadressen "); Hyperlink hyp = paragraph.AddHyperlink(string.Format("mailto:{0}?subject=Tilbudnr.{1}", Company.OrdreEmail, TilbudID.ToString()), HyperlinkType.Web); //hyp.Font.Size = 7 hyp.AddText(Company.OrdreEmail); paragraph.AddText(" og samtidig oplyse tilbudsnr. "); paragraph.AddText(TilbudID.ToString()); paragraph.AddLineBreak(); paragraph = this.document.LastSection.AddParagraph(); paragraph.Format.SpaceBefore = "5mm"; //.Format.Font.Size = 7 paragraph.AddText("Såfremt der er spørgsmål"); paragraph.AddText(" – eller korrektioner"); paragraph.AddText(" – til det fremsendte tilbud, er du meget velkommen til at kontakte os på telefon nr. "); paragraph.AddText(Company.phone); paragraph.AddLineBreak(); paragraph = this.document.LastSection.AddParagraph(); paragraph.Format.SpaceBefore = "5mm"; //.Format.Font.Size = 7 paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.AddText("Med venlig hilsen"); paragraph.AddLineBreak(); Font FontTal = new Font(); FontTal.Color = new Color((byte)255, (byte)0, (byte)0); FontTal.Bold = true; paragraph = this.document.LastSection.AddParagraph(); paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.AddText(Company.name); paragraph.AddLineBreak(); //paragraph = Me.document.LastSection.AddParagraph() //With paragraph // .Format.SpaceBefore = "1,5cm" // '.Format.Font.Size = 7 // .Format.Alignment = ParagraphAlignment.Center // .AddText("Kamilla Rye / Lennart Funch") // .AddLineBreak() //End With paragraph = this.document.LastSection.AddParagraph(); paragraph.Format.SpaceBefore = "1cm"; //.Format.Font.Size = 7 paragraph.AddText("Bilag:"); paragraph.AddLineBreak(); paragraph.AddText(" · "); paragraph.AddText("Salgs- og leveringsbetingelser"); paragraph.AddLineBreak(); paragraph.AddText(" · "); paragraph.AddText("Produktark"); //.AddLineBreak() }