BMS-HOSxP Community
HOSxP => Delphi / Pascal => ข้อความที่เริ่มโดย: doramon ที่ พฤศจิกายน 10, 2010, 15:41:59 PM
-
//Here we will scan in a 24bpp in multiple page pdf file
If Twain1.TwainOpenDefaultSource() Then
begin
Twain1.TwainSetAutoFeed (True); // Set AutoFeed Enabled
Twain1.TwainSetAutoScan (True); // To achieve the maximum scanning rate
Twain1.TwainSetCurrentResolution (Resolution);
Twain1.TwainSetCurrentPixelType (TWPT_RGB); // RGB
Twain1.TwainSetCurrentBitDepth (8); // ' 24 bpp
Twain1.TwainPdfStart('C:\multipage.pdf','','','','');
While Twain1.TwainAcquireToGdPictureImage(Handle) <> 0 do
Begin
nImageID := Twain1.GetNativeImage;
Twain1.TwainAddGdPictureImageToPdf(nImageID);
Twain1.CloseImage (nImageID);
end;
Twain1.TwainPdfStop;
Twain1.TwainCloseSource;
ShowMessage('Done !');
end Else
MessageDlg('can´t open default source, twain state is: '+ IntToStr(Twain1.TwainGetState),
mtError,[mbok],0);