Convert PDF to Black and White | VB.NETByteScout PDF Extractor SDK

Convert PDF to Black and White | VB.NET

Module1.vb:

VB
Imports Bytescout.PDFExtractor

Module Module1

    Sub Main()

        ' Create Bytescout.PDFExtractor.UnsearchablePDFMaker instance
        Dim unsearchablePDFMaker = New UnsearchablePDFMaker()
        unsearchablePDFMaker.RegistrationName = "demo"
        unsearchablePDFMaker.RegistrationKey = "demo"

        ' Load sample PDF document
        unsearchablePDFMaker.LoadDocumentFromFile("sample1.pdf")

        'maker.ImageFormat = EmbeddedImageFormat.JPEG; ' use JPEG for smaller PDF file, but be ready to compression artefacts
        'maker.JPEGQuality = 75; // JPEG quality (1 - 100)
        unsearchablePDFMaker.RenderingResolution = 300  ' larger resolution - longer processing And larger PDF file size

        ' Enable Black And White mode
        unsearchablePDFMaker.Grayscale = True

        ' Process the document
        unsearchablePDFMaker.MakePDFUnsearchable("result.pdf")

        ' Cleanup
        unsearchablePDFMaker.Dispose()

        ' Open the result PDF file in default associated application
        System.Diagnostics.Process.Start("result.pdf")

    End Sub

End Module