public void CreatePDF(Stream stream)
{
// Create a PDF document
var doc = new GcPdfDocument();
var page = doc.NewPage();
var g = page.Graphics;
// Translation Values
var translate0 = Matrix3x2.CreateTranslation(72 * 3, 72 * 5);
var scale0 = Matrix3x2.CreateScale(0.7F);
var rotate0 = Matrix3x2.CreateRotation((float)(-70 * Math.PI) / 180F);
//Draw Rectangle and Apply Transformations
var box = new RectangleF(0, 0, 72 * 4, 72 * 2);
g.Transform = rotate0 * translate0 * scale0;
g.FillRectangle(box, Color.FromArgb(100, Color.DarkSeaGreen));
g.DrawRectangle(box, Color.DarkOrange, 1);
g.DrawString("Sample Box: Text drawn at (0,0) in a 4\"x2\" box"+
", scaled by 0.7, translated by (3\",5\"), " +
"and rotated 70 degrees counterclockwise.",
new TextFormat() { Font = StandardFonts.Times, FontSize = 14, }, box);
// Save document
doc.Save(stream);
}