I am trying to convert scanned PDF files (each page is one image) to TIF files using VB6.
Problem:-
The code below works, but the TIF image isn't compressed.
(ImCompression_CCITT4 = 7)
How do I compress the file and what should mySaveFormat.CompressionLevel be set to?
Question:-
I am hardcoding the imgType and resolution (xDpi,yDpi) in the example below. How do I see what these were in the original PDF image ?
Code: Select all
mySaveFormat.fmtID = PRO_FMT_TIFF_ID
mySaveFormat.imgType = ImType_bw_1bpp
mySaveFormat.bConvertToGray = False
mySaveFormat.bDither = 0
mySaveFormat.bWriteAlpha = False
mySaveFormat.xDPI = 150
mySaveFormat.yDPI = 150
mySaveFormat.CompressionMethod = ImCompression_CCITT4
'mySaveFormat.CompressionLevel ????
mySaveFormat.bAppendToExisting = False
res = PDFXCp_SaveImageFromPage(pdf, i - 1, j - 1, mySaveFormat, "C:\test.tif")
If IS_DS_FAILED(res) Then
ShowDSErrorString (res)
Exit Sub
End If
Obviously for a Black and White TIF CCITT compression (eg Goup 4 Fax) is normal.
Steve