using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SelectPdf;

namespace SelectPdf.Samples
{
    public partial class page_settings : System.Web.UI.Page
    {
        protected void BtnCreatePdf_Click(object sender, EventArgs e)
        {
            // create a new pdf document
            PdfDocument doc = new PdfDocument();

            // create a new pdf font
            PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
            font.Size = 18;

            // add a new page to the document 
            // (with specific page size, margins and orientation)
            PdfPage page = doc.AddPage(PdfCustomPageSize.A4, 
                new PdfMargins(0f), PdfPageOrientation.Portrait);

            // create a new text element and add it to the page
            PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeText(), font);
            page.Add(text);

            // add a new page to the document
            // (with specific page size, margins and orientation)
            PdfPage page2 = doc.AddPage(PdfCustomPageSize.Letter, 
                new PdfMargins(20f), PdfPageOrientation.Landscape);

            // create a new text element and add it to the page
            PdfTextElement text2 = new PdfTextElement(0, 0, Helper.SomeText(), font);
            page2.Add(text2);

            // save pdf document
            doc.Save(Response, false, "Sample.pdf");

            // close pdf document
            doc.Close();
        }

    }
}