''
'' This code is part of Document Solutions for PDF .NET demos.
'' Copyright (c) MESCIUS inc. All rights reserved.
''
Imports System.IO
Imports System.Drawing
Imports GrapeCity.Documents.Pdf
Imports GrapeCity.Documents.Text
Public Class MakeLinearized
Public Function CreatePDF(ByVal stream As Stream) As Integer
' Load an arbitrary non-linearized PDF into a GcPdfDocument:
Using fs = File.OpenRead(Path.Combine("Resources", "PDFs", "CompleteJavaScriptBook.pdf"))
Dim doc = New GcPdfDocument()
doc.Load(fs)
' Save the PDF as linearized:
doc.Save(stream, SaveMode.Linearized)
'' Done:
Return doc.Pages.Count
End Using
End Function
End Class