MakeLinearized.cs
 // // This code is part of Document Solutions for PDF demos. // Copyright (c) MESCIUS inc. All rights reserved. // using System; using System.IO; using System.Drawing; using GrapeCity.Documents.Pdf; using GrapeCity.Documents.Text; namespace DsPdfWeb.Demos { // This sample shows how to linearize an arbitrary existing PDF. public class MakeLinearized { public int CreatePDF(Stream stream) { // Load an arbitrary non-linearized PDF into a GcPdfDocument: using var fs = File.OpenRead(Path.Combine("Resources", "PDFs", "CompleteJavaScriptBook.pdf")); var doc = new GcPdfDocument(); doc.Load(fs); // Save the PDF as linearized: doc.Save(stream, SaveMode.Linearized); // Done: return doc.Pages.Count; } } }