PDFCompInsertNormal Example for Visual Basic

Dim WithEvents LeadPDFComp As LEADPDFCompressor
Dim Factory As New LEADRasterFactory
Dim Raster As LEADRaster
Dim RasterIO As New LEADRasterIO
Dim gszLic As String

Private Sub Form_Load()
gszLic = "LEADTOOLS OCX Copyright (c) 1991-2005 LEAD Technologies, Inc."
Set LeadPDFComp = New LEADPDFCompressor

Set Raster = Factory.CreateObject ("LEADRaster.LEADRaster", gszLic)

RasterIO.Load Raster, "C:\Image.cmp", 0, 0, 1

LeadPDFComp.PDFCompInit False
LeadPDFComp.PDFCompInsertNormal Raster
LeadPDFComp.PDFCompWrite "C:\Output.pdf"
LeadPDFComp.PDFCompFree

End Sub