This quick start gets you started with PrintDocument by letting you create a WinForms application, add printing and previewing controls to it, set up the preview and explore some of the run-time interactions available in the previewing controls as illustrated in the below:
To quickly get started using the PrintDocument library, follow these steps:
C# |
Copy Code
|
---|---|
using C1.C1Preview;
|
C# |
Copy Code
|
---|---|
this.c1PrintDocument1.Body.Children.Add(new RenderText("Hello, World!")); this.c1PrintDocument1.Generate(); |
The above code uses the Generate method to generate documents. Alternatively, the StartDoc and EndDoc methods can also be used to create documents. For more information about the StartDoc and EndDoc methods, see Create Document topic.