Skip to content

Instantly share code, notes, and snippets.

@maman
Last active August 29, 2015 14:00
Show Gist options
  • Save maman/f6d562472f751a68b0e6 to your computer and use it in GitHub Desktop.
Save maman/f6d562472f751a68b0e6 to your computer and use it in GitHub Desktop.
namespace ReportSamples {
class HelloWorld {
public static void Main() {
Document document = new Document();
PdfWriter.GetInstance(document, new FileStream("HelloWorld.pdf", FileMode.Create));
document.Open();
document.Add(new Paragraph("Hello World!"));
document.Close();
System.Diagnostics.Process.Start("HelloWorld.pdf");
}
}
}
namespace ReportSamples {
class HelloWorld {
public static void Main() {
Report report = new Report(new PdfFormatter());
FontDef fd = new FontDef(report, "Helvetica");
FontProp fp = new FontPropMM(fd, 25);
Page page = new Page(report);
page.AddCenteredMM(80, new RepString(fp, "Hello World!"));
RT.ViewPDF(report, "HelloWorld.pdf");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment