static void Rimuss_Recipe()
        {
            IPdfTemplate template = new PdfTemplateBasic();

            PdfStyling styling = new PdfStyling(
                fontName: "Times New Roman",
                fontSize: 9,
                fontColor: Color.FromCmyk(84, 73, 62, 92),
                paragraphSmallColor: Color.FromCmyk(21, 15, 16, 1),
                horizontalRuleColor: Color.FromCmyk(21, 15, 16, 1),
                orientation: Orientation.Landscape,
                margin: new Unit[4] {
                Unit.FromCentimeter(1.5), Unit.FromCentimeter(2), Unit.FromCentimeter(1.5), Unit.FromCentimeter(2)
            },
                showPageNumber: false);

            template.Define("Rimuss Rezepte", "Rimuss Rezepte", "Rimuss Rezepte", "Rimuss Rezepte", null, styling);

            template.Elements.Add(new Opten.Web.Infrastructure.Pdf.Test.Custom.Cover());
            template.Elements.Add(new Opten.Web.Infrastructure.Pdf.Test.Custom.TableOfContents());
            template.Elements.Add(new Opten.Web.Infrastructure.Pdf.Test.Custom.Recipe());
            template.Elements.Add(new PdfPageBreak());
            template.Elements.Add(new Opten.Web.Infrastructure.Pdf.Test.Custom.Recipe());

            template.SaveOnDisk(@"C:\Users\cfrei\Desktop\rimuss_recipe.pdf");
        }
        static void PdfLandscape()
        {
            IPdfTemplate template = new PdfTemplateBasic();

            PdfStyling styling = new PdfStyling(
                orientation: Orientation.Landscape,
                margin: new Unit[4] {
                Unit.FromCentimeter(2), Unit.FromCentimeter(2), Unit.FromCentimeter(2), Unit.FromCentimeter(2)
            },
                pageNumberAlignment: ParagraphAlignment.Center,
                pageNumberMarginTop: 20);

            template.Define("Heading tests", "Heading tests", "Heading tests", "Heading tests", null, styling);

            template.Elements.Add(new PdfHeading("HEADING", 1));

            template.SaveOnDisk(@"C:\Users\cfrei\Desktop\" + Guid.NewGuid() + ".pdf");
        }
        static void RobertSpleiss_AG_2()
        {
            IPdfTemplate template = new PdfTemplateBasic();

            template.Define("Robert Spleiss AG", "Robert Spleiss AG", "Firmen mit Geschenkliste", "firmen, geschenkliste, firmen geschenkliste",
                            pdfStyling: new PdfStyling(
                                fontName: "Arial",
                                headerTitleFontSize: 10,
                                headerTitleColor: Colors.Black,
                                fontSize: 6,
                                orientation: Orientation.Landscape,
                                margin: new Unit[4] {
                Unit.FromCentimeter(3.5), Unit.FromCentimeter(1), Unit.FromCentimeter(2), Unit.FromCentimeter(1)
            }));

            template.Elements.Add(new PdfHeaderTitle("ROBERT SPLEISS AG", ParagraphAlignment.Left));
            template.Elements.Add(new PdfHeaderTitle("Firmen mit Geschenkliste: Sekretärin / 2013", ParagraphAlignment.Left, TextFormat.Bold));

            PdfTable table = new PdfTable(
                style: TableStyle.OnlyRowsBordered,
                fitToDocument: true);

            table.THead.Add(new PdfTableHeaderCell("O-Nr.", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("O-Eingang", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Abt.", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("O-Eingabe", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Obj-Art", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Verantw.", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Objektbezeichnung", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCellWithTextLines(new TextLine[] { new TextLine("Eing. Datum"), new TextLine("Eing. Summe") }, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Baubeginn", false, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Bemerkung", false, 6));

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("Werubau AG, Matthias Petter", 6),
                    new PdfTableCell("043 844 20 90", 4)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("Werubau AG, Matthias Petter", 6),
                    new PdfTableCell("043 844 20 90", 4)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("Werubau AG, Matthias Petter", 6),
                    new PdfTableCell("043 844 20 90", 4)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("Werubau AG, Matthias Petter", 6),
                    new PdfTableCell("043 844 20 90", 4)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("Werubau AG, Matthias Petter", 6),
                    new PdfTableCell("043 844 20 90", 4)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("Werubau AG, Matthias Petter", 6),
                    new PdfTableCell("043 844 20 90", 4)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            table.TBody.Add(new PdfTableRow
            {
                Cells = new List <IPdfTableCell>
                {
                    new PdfTableCell("O17450", true),
                    new PdfTableCell("29.10.2015", true),
                    new PdfTableCell("NB", true),
                    new PdfTableCell("13.11.2015", true),
                    new PdfTableCell("Pb", true),
                    new PdfTableCell("MF", true),
                    new PdfTableCell("Freudenbergstrasse 108, 8044 Zürich", true),
                    new PdfTableCellWithTextLines(textLines: new TextLine[] { new TextLine("25.11.2015", true), new TextLine("1'338'600", true) }),
                    new PdfTableCell("Ende Mai 2016"),
                    new PdfTableCell(null)
                }
            });

            template.Elements.Add(table);

            var memory = template.SaveInMemory();

            template.SaveOnDisk(@"C:\Users\cfrei\Desktop\robert_spleiss_ag_2.pdf");
        }
        static void RobertSpleiss_AG()
        {
            IPdfTemplate template = new PdfTemplateBasic();

            template.Define("Robert Spleiss AG", "Robert Spleiss AG", "Firmen mit Geschenkliste", "firmen, geschenkliste, firmen geschenkliste",
                            pdfStyling: new PdfStyling(
                                fontName: "Arial",
                                headerTitleFontSize: 10,
                                headerTitleColor: Colors.Black,
                                fontSize: 6,
                                orientation: Orientation.Landscape,
                                margin: new Unit[4] {
                Unit.FromCentimeter(3.5), Unit.FromCentimeter(2.5), Unit.FromCentimeter(2), Unit.FromCentimeter(2.5)
            }));

            template.Elements.Add(new PdfHeaderTitle("ROBERT SPLEISS AG", ParagraphAlignment.Left));
            template.Elements.Add(new PdfHeaderTitle("Firmen mit Geschenkliste: Sekretärin / 2013", ParagraphAlignment.Left, TextFormat.Bold));

            PdfTable table = new PdfTable(
                fitToDocument: true,
                style: TableStyle.Grid);

            table.THead.Add(new PdfTableHeaderCell("Name", true, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Adresse 1", true, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Adresse 2", true, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("PLZ", true, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("Ort", true, Alignment.Left));
            table.THead.Add(new PdfTableHeaderCell("BRF", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("KRT", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("SK", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("R12", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("R6", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("W6", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("W3", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("SA", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("KS", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("KB", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("CH", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("BL", true, Alignment.Center));
            table.THead.Add(new PdfTableHeaderCell("SONSTIGES", true, Alignment.Left));

            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("AMAG Automobil + Moteren A"),
                    new PdfTableCell("Liegenschaftsverwaltung"),
                    new PdfTableCell("Utoquai 49"),
                    new PdfTableCell("8008"),
                    new PdfTableCell("Zürich"),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell("1"),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell("1"),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell(null),
                    new PdfTableCell("M")
                }
            });

            template.Elements.Add(table);

            template.SaveOnDisk(@"C:\Users\cfrei\Desktop\robert_spleiss_ag.pdf");
        }
        static void PdfWithEmptyCells()
        {
            // Table
            PdfTable table = new PdfTable(
                style: TableStyle.OnlyRowsBordered,
                fitToDocument: true);

            table.THead.Add(new PdfTableHeaderCell("Thema / Sujet", Alignment.Left, 7));
            table.THead.Add(new PdfTableHeaderCell("Bemerkung / Remarques", Alignment.Left, 10));
            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("Parkplatz, Fahrzeug / Place de parking, véhicule"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("Garderobe bewacht / Vestiaire surveillé"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("Weg Fahrzeug – Garderobe /    chemin véhicule - vestiaire"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("Weg Garderobe - Eisfeld / chemin vestiaire - surface de glace"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("Zuschauer auf dem Eis / Spectacteurs sur la glace"),
                    new PdfTableCell(null)
                }
            });
            table.TBody.Add(new PdfTableRow
            {
                Cells =
                {
                    new PdfTableCell("Beleuchtung, Beschallung / Eclairage, Sonorisation"),
                    new PdfTableCell(null)
                }
            });

            IPdfTemplate template = new PdfTemplateBasic();

            template.Define(
                title: "Empty Cells Table",
                author: "Doc Author",
                subject: "Empty Cells",
                keywords: "Doc Keywords");

            template.Elements.Add(table);

            // Create
            template.SaveOnDisk(@"C:\Users\cfrei\Desktop\" + template.FileName());
        }