Hi Nigel
Thank you for answering my questions.
I tested it on a real server, unfortunately it does not scan.
The scanner must be installed on the server to work, because the framework for my Delphi web base programming, unigui, works on the server side.
I use a Windows program to scan and send to the server.
I think that scanners that work with the network that work with IP can be used for web base, and I can put it in a HUB Switch on the network and call the above scanner IP from the client side?
Is this how scanners that work with IP work?
Please post the code sample with none visual components for web base here, I would be grateful.
procedure TDocumentsForm.btnScanClick(Sender: TObject);
var
bmp: TBitmap;
io: TImageEnIO;
DestPath, Field1, Field2, FileName: string;
begin
LabelMessage.Caption := ''; // Clear previous message
bmp := TBitmap.Create;
try
io := TImageEnIO.CreateFromBitmap(bmp);
try
try
if io.Acquire then
begin
// Get field values
Field1 := UniMainModule.FDMain_Query.FieldByName(UniServerModule.Global_field_name_documents).AsString;
Field2 := UniMainModule.FDMain_Query.FieldByName(UniServerModule.Global_field_name).AsString;
// Destination path
DestPath := IncludeTrailingPathDelimiter(UniServerModule.StartPath) + 'documents\' + Field1;
if not DirectoryExists(DestPath) then
ForceDirectories(DestPath);
// Unique file name
FileName := DestPath + '\' + Field2 + '_' + FormatDateTime('yyyymmddhhnnsszzz', Now) + '.jpg';
// Save file
io.SaveToFile(FileName);
// Refresh the form
RefreshDocuments;
// Log success
UniMainModule.MyLogDBUni('Scan image in DocumentsForm', 'yes');
// Show success message to user
LabelMessage.Caption := 'Image scanned and saved successfully.';
end
else
LabelMessage.Caption := 'Error acquiring image from scanner.';
except
on E: Exception do
LabelMessage.Caption := 'Error saving file: ' + E.Message;
end;
finally
io.Free;
end;
finally
bmp.Free;
end;
end;
Regards
Ali Abbasi