Exemple #1
0
        //----------------------------------------------------------------------------------------------------x
        /// <summary>Initializes a new instance of the PDF formatter class.</summary>
        /// <example>
        /// <code>
        /// using Root.Report;
        /// using System;
        /// namespace ReportSample {
        /// class PdfPropertiesSample : Report {
        ///   public static void Main() {
        ///     PdfFormatter pf = new PdfFormatter();
        ///     pf.sTitle = "PDF Sample";
        ///     pf.sAuthor = "Otto Mayer, [email protected]";
        ///     pf.sSubject = "Sample of some PDF features";
        ///     pf.sKeywords = "Sample PDF Report.NET";
        ///     pf.sCreator = "Report.NET Sample Application";
        ///     pf.dt_CreationDate = new DateTime(2002, 8, 15, 0,0,0,0);
        ///     pf.pageLayout = PageLayout.TwoColumnLeft;
        ///     pf.bHideToolBar = true;
        ///     pf.bHideMenubar = false;
        ///     pf.bHideWindowUI = true;
        ///     pf.bFitWindow = true;
        ///     pf.bCenterWindow = true;
        ///     pf.bDisplayDocTitle = true;
        ///
        ///     RT.ViewPDF(new PdfPropertiesSample(pf), "PdfPropertiesSample.pdf");
        ///   }
        ///
        ///   public PdfPropertiesSample(Formatter formatter) : base(formatter) {
        ///   }
        ///
        ///   protected override void Create() {
        ///     FontDef fd = new FontDef(this, FontDef.StandardFont.Helvetica);
        ///     FontProp fp = new FontPropMM(fd, 4);
        ///     FontProp fp_Title = new FontPropMM(fd, 11);
        ///     fp_Title.bBold = true;
        ///
        ///     Page page = new Page(this);
        ///     page.AddCenteredMM(40, new RepString(fp_Title, "PDF Properties Sample"));
        ///     fp_Title.rSizeMM = 8;
        ///     page.AddCenteredMM(100, new RepString(fp_Title, "First Page"));
        ///     page.AddCenteredMM(120, new RepString(fp, "Choose &lt;Document Properties, Summary&gt; from the"));
        ///     page.AddCenteredMM(126, new RepString(fp, "File menu to display the document properties"));
        ///
        ///     page = new Page(this);
        ///     page.AddCenteredMM(100, new RepString(fp_Title, "Second Page"));
        ///   }
        /// }
        /// }
        /// </code>
        /// </example>
        public PdfFormatter()
        {
            sb = new StringBuilder(10000);

            pdfIndirectObject_Catalog = new PdfIndirectObject_Catalog(this);
            pdfIndirectObject_Info    = new PdfIndirectObject_Info(this);
        }
Exemple #2
0
        //----------------------------------------------------------------------------------------------------x
        /// <summary>Initializes a new instance of the PDF formatter class.</summary>
        /// <example>
        /// <code>
        /// using Root.Report;
        /// using System;
        /// namespace ReportSample {
        /// class PdfPropertiesSample : Report {
        ///   public static void Main() {
        ///     PdfFormatter pf = new PdfFormatter();
        ///     pf.sTitle = "PDF Sample";
        ///     pf.sAuthor = "Otto Mayer, [email protected]";
        ///     pf.sSubject = "Sample of some PDF features";
        ///     pf.sKeywords = "Sample PDF Report.NET";
        ///     pf.sCreator = "Report.NET Sample Application";
        ///     pf.dt_CreationDate = new DateTime(2002, 8, 15, 0,0,0,0);
        ///     pf.pageLayout = PageLayout.TwoColumnLeft;
        ///     pf.bHideToolBar = true;
        ///     pf.bHideMenubar = false;
        ///     pf.bHideWindowUI = true;
        ///     pf.bFitWindow = true;
        ///     pf.bCenterWindow = true;
        ///     pf.bDisplayDocTitle = true;
        ///
        ///     RT.ViewPDF(new PdfPropertiesSample(pf), "PdfPropertiesSample.pdf");
        ///   }
        ///
        ///   public PdfPropertiesSample(Formatter formatter) : base(formatter) {
        ///   }
        ///
        ///   protected override void Create() {
        ///     FontDef fd = new FontDef(this, FontDef.StandardFont.Helvetica);
        ///     FontProp fp = new FontPropMM(fd, 4);
        ///     FontProp fp_Title = new FontPropMM(fd, 11);
        ///     fp_Title.bBold = true;
        ///
        ///     Page page = new Page(this);
        ///     page.AddCenteredMM(40, new RepString(fp_Title, "PDF Properties Sample"));
        ///     fp_Title.rSizeMM = 8;
        ///     page.AddCenteredMM(100, new RepString(fp_Title, "First Page"));
        ///     page.AddCenteredMM(120, new RepString(fp, "Choose &lt;Document Properties, Summary&gt; from the"));
        ///     page.AddCenteredMM(126, new RepString(fp, "File menu to display the document properties"));
        ///
        ///     page = new Page(this);
        ///     page.AddCenteredMM(100, new RepString(fp_Title, "Second Page"));
        ///   }
        /// }
        /// }
        /// </code>
        /// </example>
        public PdfFormatter()
        {
            sb = new StringBuilder(10000);
      #if Framework2
            dict_FontProp = new Dictionary <String, FontProp>(50);
      #else
            dict_FontProp = new Hashtable(50);
      #endif

            pdfIndirectObject_Catalog = new PdfIndirectObject_Catalog(this);
            pdfIndirectObject_Info    = new PdfIndirectObject_Info(this);
        }