using Root.Reports;
using System;

// Creation date: 10.05.2002
// Checked: 30.10.2004
// Author: Otto Mayer (mot@root.ch)
// Version: 1.03

// Report.NET copyright 2002-2004 root-software ag, Bürglen Switzerland - Otto Mayer, Stefan Spirig, all rights reserved
// This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License

// as published by the Free Software Foundation, version 2.1 of the License.

// This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You

// should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software

// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA www.opensource.org/licenses/lgpl-license.html

namespace ReportSamples {
  /// <summary>Hello World (C# Version)</summary>
  /// <remarks>
  /// This console program is the Report.NET version of the traditional "Hello World!" program,
  /// which creates a PDF document with the centered text "Hello World!".
  /// <note type="caution">
  /// This program should not be used as a template for reports, you should alwalys overwrite the virtual method
  /// <see cref="Root.Reports.Report.Create"/>
  /// of the base class <see cref="Root.Reports.Report"/>.
  /// The sample only shows how a document can be created with a few lines of code.
  /// See <see cref="T:ReportSamples.StartTemplate"/> for a sample of a report template.
  /// </note>
  /// </remarks>
  public class HelloWorld {
    //------------------------------------------------------------------------------------------30.10.2004
    /// <summary>Starts the "Hello World" sample.</summary>
    /// <remarks>This method serves only to start the application.</remarks>
    public static void Main() {
      Report report = new Report(new PdfFormatter());
      FontDef fd = new FontDef(report, FontDef.StandardFont.Helvetica);
      FontProp fp = new FontPropMM(fd, 25);
      Page page = new Page(report);
      page.AddCB_MM(80, new RepString(fp, "Hello World!"));
      RT.ViewPDF(report, "HelloWorld.pdf");
    }
  }
}
