VintaSoft Imaging .NET SDK 15.0: Documentation for .NET developer
Vintasoft.Imaging.Pdf Namespace / PdfFormat Class / GetLinearizedFormat() Method
Syntax Example Requirements SeeAlso
In This Topic
    GetLinearizedFormat() Method (PdfFormat)
    In This Topic
    Returns the linearized PDF format from this PDF format.
    Syntax
    'Declaration
    
    Public Function GetLinearizedFormat() As PdfFormat
    
    
    public PdfFormat GetLinearizedFormat()
    
    
    public: PdfFormat* GetLinearizedFormat()
    
    
    public:
    PdfFormat^ GetLinearizedFormat()

    Return Value

    A new instance of linearized PDF format.
    Example

    Here is an example that shows how to convert PDF document to the linearized format (Fast Web View):

    
    ''' <summary>
    ''' Converts a PDF document to a linearized format.
    ''' </summary>
    ''' <param name="inputPdfFilename">The filename of source PDF document.</param>
    ''' <param name="outputPdfFilename">The filename of output PDF document.</param>
    Public Shared Sub ConvertToLinearizedFormat(inputPdfFilename As String, outputPdfFilename As String)
        ' open PDF document
        Using document As New Vintasoft.Imaging.Pdf.PdfDocument(inputPdfFilename)
            ' get linearized format for PDF document
            Dim linearizedFormat As Vintasoft.Imaging.Pdf.PdfFormat = document.Format.GetLinearizedFormat()
    
            ' if linearized PDF document must be saved to a source file
            If inputPdfFilename = outputPdfFilename Then
                ' pack PDF document in linearized format to a source file
                document.Pack(linearizedFormat)
            ' if linearized PDF document must be saved to a new file
            Else
                ' pack PDF document in linearized format to a new file
                document.Pack(outputPdfFilename, linearizedFormat)
            End If
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Converts a PDF document to a linearized format.
    /// </summary>
    /// <param name="inputPdfFilename">The filename of source PDF document.</param>
    /// <param name="outputPdfFilename">The filename of output PDF document.</param>
    public static void ConvertToLinearizedFormat(string inputPdfFilename, string outputPdfFilename)
    {
        // open PDF document
        using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(inputPdfFilename))
        {
            // get linearized format for PDF document
            Vintasoft.Imaging.Pdf.PdfFormat linearizedFormat = document.Format.GetLinearizedFormat();
            
            // if linearized PDF document must be saved to a source file
            if (inputPdfFilename == outputPdfFilename)
            {
                // pack PDF document in linearized format to a source file
                document.Pack(linearizedFormat);
            }
            // if linearized PDF document must be saved to a new file
            else
            {
                // pack PDF document in linearized format to a new file
                document.Pack(outputPdfFilename, linearizedFormat);
            }
        }
    }
    
    

    Requirements

    Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also