---
title: "C# .NET PDF linearization: Optimize PDF for fast web view | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/optimization/linearize/"
md_url: "https://www.nutrient.io/guides/dotnet/optimization/linearize.md"
last_updated: "2026-07-08T10:25:35.512Z"
description: "Learn how to linearize PDF documents programmatically in C# .NET using Nutrient .NET SDK. Optimize PDFs for faster web viewing."
---

# Linearize PDFs in C# .NET

Linearize a PDF when you want to optimize a PDF for Fast Web View mode. This means that the linearized PDF loads faster in a browser or other applications that stream the document from a remote server. The linearization process restructures a PDF document so that only the requested page is downloaded from the server, rather than the entire PDF. This is especially important with large documents that can take a long time to download. For more on what linearization is and how it differs from a standard PDF, see our [linearized PDF blog post](https://www.nutrient.io/blog/linearized-pdf.md).

To linearize a PDF document, follow these steps:

1. Create a `GdPicturePDF` object.

2. Load the source document by passing its path to the `LoadFromFile` method.

3. Save the output in a linearized PDF document with the `SaveToFile` method. This method takes the following parameters:
   - `FilePath` — The path to the output PDF document.
   - `PackDocument` — Optional: A Boolean value that specifies whether to pack the PDF document. This reduces the file size but slows down the saving process.
   - `Linearize` — Set this parameter to `true` to linearize the output PDF document.

### C#

```csharp

using GdPicturePDF gdPicturePDF = new GdPicturePDF();
// Load a PDF document to GdPicture.
gdPicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Save the loaded PDF document to a file.
gdPicturePDF.SaveToFile(@"C:\temp\output.pdf", true, true);

```

### VB.NET

```vb

Using gdPicturePDF As GdPicturePDF = New GdPicturePDF()
    ' Load a PDF document to GdPicture.
    gdPicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Save the loaded PDF document to a file.
    gdPicturePDF.SaveToFile("C:\temp\output.pdf", True, True)
End Using

```

#### Used methods

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SaveToFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Optimize PDFs using C#](/guides/dotnet/optimization.md)
- [Image and PDF compression in C#](/guides/dotnet/optimization/compress.md)
- [Flatten PDFs in C# .NET](/guides/dotnet/optimization/flatten.md)
- [MRC compression in C#](/guides/dotnet/optimization/hyper-compress-mrc.md)
- [MRC PDF optimization](/guides/dotnet/optimization/pdf-optimization-mrc.md)
- [Optimizing PDFs](/guides/dotnet/optimization/pdf-optimization.md)

