//// This code is part of Document Solutions for PDF .NET demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingGrapeCity.Documents.Pdf; namespaceDsPdfWeb.Demos{// This sample shows how to linearize an arbitrary existing PDF.publicclassMakeLinearized {publicintCreatePDF(Stream stream) {// Load an arbitrary non-linearized PDF into a GcPdfDocument:usingvar fs = File.OpenRead(Path.Combine("Resources", "PDFs", "CompleteJavaScriptBook.pdf"));var doc = newGcPdfDocument(); doc.Load(fs); // Save the PDF as linearized: doc.Save(stream, SaveMode.Linearized); // Done:return doc.Pages.Count; } }}