I'm having an issue with file sizes. The scanner is set to B&W with a DPI of 300. If I scan to TIF, the TIF file size for one page is 55K. When I scan to PDF and create the PDF doc using PXC_AddImageFromHBITMAP and PXC_SetCompression, my file size is 90K or about double.
Is there something else I need to be doing when I create a PDF page using PXC_AddImageFromHBITMAP to get my file size smaller? Is the order in which I call the functions correct?
Below is the relevant code I'm using so you can see what I'm setting for AddImageFromHBITMAP. This code is call each time as I get a DIB from the scanner. When I'm done, I just Save the document out using SaveDocument.
By the way, the TIF is using CCITTFAX4 compression on the BW image.
Code: Select all
if (FDocID = 0) then
begin
hr := PXC_NewDocument(@FDocID, FRegKey, FDevCode);
if IS_DS_FAILED(hr) or (FDocID = 0) then exit;
end;
PXC_SetCompression(FDocID, True, False, ComprType_C_Deflate, 75, ComprType_I_Deflate, ComprType_M_Deflate);
PXC_AddPage(FDocID, W, H, @hPage);
PXC_AddImageFromHBITMAP(FDocID, B.Handle, 0, @hImg);
PXC_PlaceImage(hPage, hImg, 0, H, W, H);