# Quick Start

A simple quickstart for you to get started with WinForms PrintDocument. Learn more about PrintDocument from this documentation helpfile.

## Content



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:

![PrintDocument control](https://cdn.mescius.io/document-site-files/images/6772f728-508e-4e80-9394-208f07d64beb/images/runtime-interaction-preview.gif)

To quickly get started using the PrintDocument library, follow these steps:

## Add PrintDocument and PrintPreview

1.  Create a **Windows Forms App** in **Visual Studio**.
2.  Add reference to **C1.Win.Printing** NuGet package.
3.  Drag and drop the **PrintDocument** component and **PrintPreviewControl** control from the **Toolbox** to your form. Observe that **PrintDocument** gets added to the component tray, while the **PrintPreviewControl** is added to the form.

## Configure the Printing Controls

1.  From the **Properties** window, set the **Document** property of **PrintPreviewControl** to the newly added **PrintDocument** component.
2.  Switch to the code view and add the following namespace:
    
    ```csharp
    using C1.C1Preview;
    ```
    
3.  Add the following code in the **Form\_Load** event to add text to the preview document and generate the document.
    
    ```csharp
    this.c1PrintDocument1.Body.Children.Add(new RenderText("Hello, World!"));
    this.c1PrintDocument1.Generate();
    ```
    
    The above code uses the [Generate](/componentone/docs/win/online-printdocument/) method to generate documents. Alternatively, the [StartDoc](/componentone/docs/win/online-printdocument/) and [EndDoc](/componentone/docs/win/online-printdocument/) methods can also be used to create documents. For more information about the StartDoc and EndDoc methods, see [Create Document](/componentone/docs/win/online-printdocument/print-document-library/createdocument) topic.
    

## Build and Run the Project

1.  Click **Build** | **Build Solution** to build the project.
2.  Press **F5** to run the project. Observe the run-time interactions with the previewing controls.