To create PDF documents using PDF for .NET, you simply create a C1PdfDocument object, add content to the document, and save the document. To follow tradition, here's how to create a "hello world" document using PDF for .NET.
After the application is run, the hello world.pdf document will look like this:
Step 3 is the most interesting one. The code starts by retrieving the page rectangle, expressed in points. It then adds a one-inch margin around the page (72 points). Finally, the code creates a Font object and calls the DrawString method to write "Hello World!" on the page. This is exactly what you would do if you were writing to a Graphics object in .NET and is what makes PDF for .NET so easy to use.
One important thing to remember is that PDF for .NET uses a point-based coordinate system with the origin at the top-left corner of the page. This is similar to the default coordinate system used by .NET, but is different from the default PDF coordinate system (where the origin is on the bottom-left corner of the page). In this example, the top left point of the "H" in "Hello World" is located at [1,1].
Because the coordinate system is based on points, rather than pixels, PDF for .NET uses RectangleF, SizeF, and PointF structures, which have members of type float, rather than Rectangle, Size, and Point, which have members of type int.