---
title: "PdfWriter Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_PdfWriter.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# PdfWriter Class
 
This class enables you to read PDF images.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public NotInheritable Class PdfWriter _Inherits FormatWriter
```
 
```csharp
public sealed class PdfWriter : FormatWriter
```
 
## Remarks
  
PDF stands for Portable Document Format. This format was developed by Adobe® Systems® Incorporated for the secure and reliable distribution and exchange of electronic documents and nowadays this formats became standard de facto in this field. In general this formats contains not only raster images, but also vector data and texts. However Graphics Mill for .NET can only embed raster images to PDF file.
 
You can create multiple pages in the PDF file. Bitmaps stored in the frame can be of most all the pixel format.
 
## Examples
  
The same, but using PdfWriter class. This class provides more flexible file saving support. In particular, you can use asynchronous mode, etc.
 
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

Dim writer As New Aurigma.GraphicsMill.Codecs.PdfWriter("C:\Mountain.pdf")

Dim frame As New Aurigma.GraphicsMill.Codecs.PdfFrame
frame.Quality = 70
frame.SetBitmap(bitmap)

bitmap.Dispose()

writer.AddFrame(frame)

frame.Dispose()

writer.Dispose()
```
 
```csharp
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    using (Aurigma.GraphicsMill.Codecs.PdfWriter writer = 
               new Aurigma.GraphicsMill.Codecs.PdfWriter(@"C:\Mountain.pdf"))
    {
        using (Aurigma.GraphicsMill.Codecs.PdfFrame frame = 
                   new Aurigma.GraphicsMill.Codecs.PdfFrame())
        {
            frame.Quality = 70;
            frame.SetBitmap(bitmap);
        
            writer.AddFrame(frame);                    
        }
    }        
}
```
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - [Aurigma.GraphicsMill.SyncHandler](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_SyncHandler.htm.md)
        - [Aurigma.GraphicsMill.Codecs.FormatWriter](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_FormatWriter.htm.md)
            - Aurigma.GraphicsMill.Codecs.PdfWriter
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.
 
## Object Model

[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_223.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_PdfWriter.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_107.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_IEncoderOptions.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel1.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_108.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_IFrame.htm.md)
 
## Supported Pixel Formats

| Member Name | Description |
| --- | --- |
| **Format1bppIndexed** | 1 bit per pixel. Indexed. |
| **Format4bppIndexed** | 4 bits per pixel. Indexed. |
| **Format8bppIndexed** | 8 bits per pixel. Indexed. |
| **Format8bppGrayScale** | 8 bits per pixel. Grayscale. 8 bits are used for luminosity level. |
| **Format24bppRgb** | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
| **Format32bppCmyk** | 32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components. |
 
## See Also

### Reference

- [PdfWriter Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_PdfWriter.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
