# Quick Start

This quick start section helps you in getting started with the basic concepts of DsPdf such as creating, saving, loading, and modifying a PDF document.

## Content

The following quick start sections help you in getting started with the DsPdf library:

* [Create and save a PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#create-and-save-a-pdf-document)
* [Load and modify a PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#load-and-modify-a-pdf-document)

## Create and Save a PDF Document

This quick start covers how to create a simple PDF document having a single page and draw string on it in a specified font using a .NET Core or .NET Standard application. Follow the steps below to get started:

1. [Create a new PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#step-1-create-a-new-pdf-document)
2. [Draw a string on the PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#step-2-draw-a-string-on-the-pdf-document)
3. [Save the PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#step-3-save-the-document)

![New PDF document](https://cdn.mescius.io/document-site-files/images/884d2bfb-301b-49bc-8d90-656c5b910507/images/qs_gcpdf.png)

### Step 1: Create a new PDF document

1. Create a new application (.NET Core Console App\\Windows Forms App) and add the references.
2. Include the following namespaces
    1. using GrapeCity.Documents.Pdf;
    2. using GrapeCity.Documents.Text;
3. Create a new PDF document using an instance of [GcPdfDocument](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.GcPdfDocument.html) and define a text format for drawing a string, through code.

    ```csharp
    // Create a new PDF document:
    GcPdfDocument doc = new GcPdfDocument();
    // Add a page, and get its Graphics object to draw on:
    GcPdfGraphics g = doc.NewPage().Graphics;
    // Create a text format for the "Hello World!" string:
    TextFormat tf = new TextFormat();
    // Use standard Times font
    tf.Font = StandardFonts.Times;
    // Pick a font size:
    tf.FontSize = 14;
    ```

### Step 2: Draw a string on the PDF document

Add the following code that uses [DrawString](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Drawing.GcGraphics.DrawString.html) method of [GcGraphics](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Drawing.GcGraphics.html) class to draw string.

```csharp
// Draw the string at (1",1") from top/left of page
//(72 dpi is the default PDF graphics' resolution):
g.DrawString("Hello World!", tf, new PointF(72, 72));
```

### Step 3: Save the document

Save the document using **Save** method of the GcPdfDocument class.

```csharp
//Save PDF document
doc.Save("filename.pdf");
```

## Load and Modify a PDF Document

This quick start covers how to load an existing PDF document, modify and save it using a .NET Core or .NET Standard application. Follow the steps below to get started:

1. [Load an existing document in DsPdf](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#step-1-load-an-existing-document-in-dspdf)
2. [Modify the PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#step-2-modify-the-document)
3. [Save the PDF document](/document-solutions/dot-net-pdf-api/docs/online/GettingStarted/quickstart#step-3-save-the-document)

### Step 1: Load an existing document in DsPdf

1. Create a new application (.NET Core Console App\\Windows Forms App) and add the references.
2. Include the following namespace
    1. using GrapeCity.Documents.Pdf;
3. Load an existing document using Load method of the GcPdfDocument class.

    ```csharp
    GcPdfDocument doc = new GcPdfDocument();
    
    //Create an object of filestream
    var fs = new FileStream(Path.Combine("DocAttachment.pdf"), FileMode.Open, 
                 FileAccess.Read);
    //Load the document
    doc.Load(fs);
    ```

### Step 2: Modify the document

1. Add a new page to the document using NewPage method of the GcPdfDocument class.

    ```csharp
    //Add a new page in the document
    GcPdfGraphics g = doc.NewPage().Graphics;
    ```
2. Add the following code that uses DrawString method of GcGraphics class to draw string.

    ```csharp
    //Add text on the new page
    g.DrawString("This is a newly added page in the modified document.", new TextFormat()
    {
         Font = StandardFonts.Times,
         FontSize = 12
    }, new PointF(72, 72));
    ```

### Step 3: Save the document

Save the document using **Save** method of the GcPdfDocument class.

```csharp
//Save the document
doc.Save("ModifiedDocument.pdf");
```