Link Search Menu Expand Document

Reduce Memory Usage - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Reduce Memory Usage’

Imports Bytescout.PDFExtractor
Imports System.IO

Class Program

	Friend Shared Sub Main(args As String())

        ' When processing huge PDF documents you may run into OutOfMemoryException.
        ' This example demonstrates a way to spare the memory by disabling page data caching.

        ' Create Bytescout.PDFExtractor.TextExtractor instance
        Using extractor As New TextExtractor("demo", "demo")

                ' Load sample PDF document

                ' Disable page data caching, so processed pages wiil be disposed automatically
                extractor.PageDataCaching = PageDataCaching.None

                ' Save extracted text to file

            Catch exception As PDFExtractorException
            End Try

        End Using

        ' Open result file in default associated application (for demo purposes)

    End Sub

End Class

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK