How can I Linearize a PDF in memory?

Question:

I need to Linearize PDF files completely in memory.

Answer:

Note: Linearized PDF is also known as Fast Web View.

PDFDoc pdfDoc = new PDFDoc(pdfData, pdfData.Length); if(!pdfDoc.IsLinearized()) { byte[] linearizedPdfData = pdfDoc.Save(SDFDoc.SaveOptions.e_linearized); }