ByteScout PDF Extractor SDK - C# - Optimize PDF - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – C# – Optimize PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Optimize PDF

How to optimize PDF in C# with ByteScout PDF Extractor SDK

How to code in C# to optimize PDF with this step-by-step tutorial

With this source code sample you may quickly learn how to optimize PDF in C#. Want to optimize PDF in your C# app? ByteScout PDF Extractor SDK is designed for it. ByteScout PDF Extractor SDK is the Software Development Kit (SDK) that is designed to help developers with data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker.

The SDK samples like this one below explain how to quickly make your application do optimize PDF in C# with the help of ByteScout PDF Extractor SDK. In order to implement the functionality, you should copy and paste this code for C# below into your code editor with your app, compile and run your application. Test C# sample code examples whether they respond your needs and requirements for the project.

Our website provides trial version of ByteScout PDF Extractor SDK for free. It also includes documentation and source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.IO; using Bytescout.PDFExtractor; namespace OptimizePDF { class Program { static void Main() { // Create Bytescout.PDFExtractor.DocumentOptimizer instance using (DocumentOptimizer optimizer = new DocumentOptimizer("demo", "demo")) { // Try various optimization options OptimizationOptions optimizationOptions = new OptimizationOptions(); optimizationOptions.ImageOptimizationFormat = ImageOptimizationFormat.JPEG; optimizationOptions.JPEGQuality = 25; optimizationOptions.ResampleImages = true; optimizationOptions.ResamplingResolution = 120; // Optimize document and save it to new file optimizer.OptimizeDocument(@".\sample1.pdf", @".\optimized.pdf", optimizationOptions); } Console.WriteLine("Optimized document has been saved as " + Path.GetFullPath(@".\optimized.pdf")); Console.WriteLine(); Console.WriteLine("Press any key..."); Console.ReadLine(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next