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");
        }
Exemple #3
0
        /// <summary>
        /// Defines the PDF.
        /// </summary>
        /// <param name="title"></param>
        /// <param name="author"></param>
        /// <param name="subject"></param>
        /// <param name="keywords"></param>
        /// <param name="absolutePathToPdfTemplate"></param>
        /// <param name="pdfStyling"></param>
        public override void Define(
            string title,
            string author,
            string subject,
            string keywords,
            string absolutePathToPdfTemplate = null,
            IPdfStyling pdfStyling           = null)
        {
            if (pdfStyling == null)
            {
                pdfStyling = new PdfStyling(
                    orientation: Orientation.Portrait,
                    margin: new Unit[4] {
                    0, 0, 0, 0
                },
                    showPageNumber: false);
            }

            base.Define(title, author, subject, keywords, absolutePathToPdfTemplate, pdfStyling);
        }