Link Search Menu Expand Document

Extract Audio from PDF - VB.NET

PDF Extractor SDK sample in VB.NET demonstrating ‘Extract Audio from PDF’

Imports Bytescout.PDFExtractor

Class Program
    Friend Shared Sub Main(ByVal args As String())

        ' Create Bytescout.PDFExtractor.MultimediaExtractor instance
        Dim extractor As New MultimediaExtractor()
        extractor.RegistrationName = "demo"
        extractor.RegistrationKey = "demo"

        ' Load PDF document
        ' (!) We do not provide the sample document, please load your own.

        Dim i As Integer = 0

        ' Initialize sound clips enumeration
        If extractor.GetFirstAudio() Then
                Dim outputFileName As String = "audio" & i & extractor.GetCurrentAudioExtension()

                ' Save sound clip to file

                i = i + 1

            Loop While extractor.GetNextAudio() ' Advance sounds enumeration
        End If

        ' Cleanup

    End Sub
End Class

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK