Is there a bug in your ScanDemo for VB?
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
Is there a bug in your ScanDemo for VB?
Hello,
if I use your ScanDemo for VB6, the scann-process will work correct and I also see the result (the scanned document).
But if I click the "Save" button, only a small area of the image will be saved as PDF.
I've already checked your sample-code, but will not find the bug.
Please can you check your sample or tell me, what I do wrong? Thank you!
if I use your ScanDemo for VB6, the scann-process will work correct and I also see the result (the scanned document).
But if I click the "Save" button, only a small area of the image will be saved as PDF.
I've already checked your sample-code, but will not find the bug.
Please can you check your sample or tell me, what I do wrong? Thank you!
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Hi,
Can you please provide a sample PDF ?
Thanks
Can you please provide a sample PDF ?
Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Re: Is there a bug in your ScanDemo for VB?
What PDF-file do you mean?John - Tracker Supp wrote:Can you please provide a sample PDF ?
The problem occurs after scanning. As yet there is no PDF. Only the saved PDF is reduced. Please run the example "Examples \ SDKExamples \ VBExamples \ scan demo" and try to scan and save the PDF. After this, open it with a PDF Viewer.
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Hi,
You say : "But if I click the "Save" button, only a small area of the image will be saved as PDF."
It is this file I require please for further analysis
Thanks
You say : "But if I click the "Save" button, only a small area of the image will be saved as PDF."
It is this file I require please for further analysis
Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Re: Is there a bug in your ScanDemo for VB?
Oh yes, I do understand!
Please see the attached ZIP-File.
1.) "Scanned_Document_withoutErrors.jpg" will show you the scan-result in the demo-app
2.) "Result_as_Image.jpg" will show the result in any PDF-viewer
3.) "ScanResult.pdf" is the saved PDF file.
BTW: Thank you for your dedicated support.
Please see the attached ZIP-File.
1.) "Scanned_Document_withoutErrors.jpg" will show you the scan-result in the demo-app
2.) "Result_as_Image.jpg" will show the result in any PDF-viewer
3.) "ScanResult.pdf" is the saved PDF file.
BTW: Thank you for your dedicated support.
- Attachments
-
- Pack.zip
- (1.18 MiB) Downloaded 243 times
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Yes, looks like it is a bug in the VB demo application which places the image without making any correction to fit it to the page's size.
We will fix the example in the next build and will endeavour to post the revised example here in the next day or so.
Thanks for your patience.
We will fix the example in the next build and will endeavour to post the revised example here in the next day or so.
Thanks for your patience.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: Is there a bug in your ScanDemo for VB?
Hi!Ivan - Tracker Software wrote:...and will endeavour to post the revised example here in the next day or so.
Any news about the fixed example?
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Replace with the file from attached archive corresponding file in the example.
- Attachments
-
- frmChild.zip
- (3.75 KiB) Downloaded 239 times
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: Is there a bug in your ScanDemo for VB?
THANK YOU!
Re: Is there a bug in your ScanDemo for VB?
Thank you, but there are still three problems with the example code.
------
1.) B/W scan will not work. If I set to B/W (constant PT_BW), the scan will be scanned grayed instead of B/W.
*If I use the Scan-OCX from LeadControls instead of yours, the B/W scan will be work without any problems.
Defined Pixel types from your documentation:
PT_BW 0x01 = Black and White / PT_GRAY 0x02 = Gray / PT_RGB 0x04 = RGB
...Are you really sure, this constant-values are correct?
I'm little confused because it seems that this will work (testet with two different scanners Samsung and Canon)
PT_BW 0x00 = Black and White / PT_GRAY 0x01 = Gray / PT_RGB 0x02 = RGB
...So please can you confirm me, what's the correct constant-values.
------
2.) Grayed scanned documents will be still be distortion after saving it as a PDF file.
*Colored scanned documents will be correct saved as a PDF file without any distortions.
I've already also try out some other settings and code changing, but without success.
------
3.) Second scan is not possible - by unloading of your exampe application it will crash
If I scan any document and click after the scan-process again the scan-button, your example show the error message "Unknown Error, code: -2113329386".
Start scaning without UI...
Got data from scaner. DataSize is: 26113592
Start scaning without UI...
>>> Unknown Error (code: -2113329386)
*If I close now your example-application, it will crash with the following message:
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
File: atlwin.h
Line: 858
Expression: ::IsWindow(m_hWnd)
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
------
1.) B/W scan will not work. If I set to B/W (constant PT_BW), the scan will be scanned grayed instead of B/W.
*If I use the Scan-OCX from LeadControls instead of yours, the B/W scan will be work without any problems.
Defined Pixel types from your documentation:
PT_BW 0x01 = Black and White / PT_GRAY 0x02 = Gray / PT_RGB 0x04 = RGB
...Are you really sure, this constant-values are correct?
I'm little confused because it seems that this will work (testet with two different scanners Samsung and Canon)
PT_BW 0x00 = Black and White / PT_GRAY 0x01 = Gray / PT_RGB 0x02 = RGB
...So please can you confirm me, what's the correct constant-values.
------
2.) Grayed scanned documents will be still be distortion after saving it as a PDF file.
*Colored scanned documents will be correct saved as a PDF file without any distortions.
I've already also try out some other settings and code changing, but without success.
------
3.) Second scan is not possible - by unloading of your exampe application it will crash
If I scan any document and click after the scan-process again the scan-button, your example show the error message "Unknown Error, code: -2113329386".
Start scaning without UI...
Got data from scaner. DataSize is: 26113592
Start scaning without UI...
>>> Unknown Error (code: -2113329386)
*If I close now your example-application, it will crash with the following message:
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
File: atlwin.h
Line: 858
Expression: ::IsWindow(m_hWnd)
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Is there a bug in your ScanDemo for VB?
1) Yes, constants values are ok. While pixel type in TWAIN are defined as:
We are using bit masks for color types to simplifier API interface - we can return supported pixel types as one value with corresponding bits set. So,
PT_BW = (1 << TWPT_BW), PT_GRAY = (1 << TWPT_GRAY), etc.
I will check what may cause such problems on your side.
2) Can you send saved PDF file? if you can provide also original B&W image it would be very helpful.
3) Will check what may cause problem. Can you confirm you are using the latest build of SDK ?
Code: Select all
/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
#define TWPT_BW 0 /* Black and White */
#define TWPT_GRAY 1
#define TWPT_RGB 2
#define TWPT_PALETTE 3
PT_BW = (1 << TWPT_BW), PT_GRAY = (1 << TWPT_GRAY), etc.
I will check what may cause such problems on your side.
2) Can you send saved PDF file? if you can provide also original B&W image it would be very helpful.
3) Will check what may cause problem. Can you confirm you are using the latest build of SDK ?
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: Is there a bug in your ScanDemo for VB?
> I will check what may cause such problems on your side.
OK, and I've check it again at this moment. And believe me, if I set PT_BW=0 / PT_GRAY=1 / PT_RGB=2 the scanning-process will work ON MY BOTH COMPUTERS in correct way. But I will/can not say, that this will also work on computers of my future clients. And this is the important reason, why I must ask you! Realy strange...
> Can you send saved PDF file? if you can provide also original B&W image it would be very helpful.
Yes, please see attachment. You will see, that the original images are still all correct, after scanning. But saved as PDF, the B&W and also the grayed PDF are many pixels moved to right (BW.pdf) and many pixels moved to left (gray.pdf) and also on the right side of the PDF you see many verticaly points!
> Can you confirm you are using the latest build of SDK ?
Yes, I use Trial of PDF-XChange PRO SDK v4.0.200.0 (BTW: I'm already licensed owner of Tools SDK, but want to upgrade to PDF-XChange PRO SDK because OCR functionality).
I think I know the problem. If I call "SXC_EnableSource(...)", this process will not come back, if I scan without scan-UI. Please set a Breakpoint to the code-row "If m_TwainObj <> 0 Then" (after "SXC_EnableSource(...)") and run the VB code in debug mode (F5) without Scanner-UI. Now you will see, that "SXC_EnableSource(...)" comes NOT BACK and if the application calls "SXC_EnableSource(...)" again, it will crash. Hope you do understand my english? If not, let me know and I will try to explain it with other words.
OK, and I've check it again at this moment. And believe me, if I set PT_BW=0 / PT_GRAY=1 / PT_RGB=2 the scanning-process will work ON MY BOTH COMPUTERS in correct way. But I will/can not say, that this will also work on computers of my future clients. And this is the important reason, why I must ask you! Realy strange...
> Can you send saved PDF file? if you can provide also original B&W image it would be very helpful.
Yes, please see attachment. You will see, that the original images are still all correct, after scanning. But saved as PDF, the B&W and also the grayed PDF are many pixels moved to right (BW.pdf) and many pixels moved to left (gray.pdf) and also on the right side of the PDF you see many verticaly points!
> Can you confirm you are using the latest build of SDK ?
Yes, I use Trial of PDF-XChange PRO SDK v4.0.200.0 (BTW: I'm already licensed owner of Tools SDK, but want to upgrade to PDF-XChange PRO SDK because OCR functionality).
I think I know the problem. If I call "SXC_EnableSource(...)", this process will not come back, if I scan without scan-UI. Please set a Breakpoint to the code-row "If m_TwainObj <> 0 Then" (after "SXC_EnableSource(...)") and run the VB code in debug mode (F5) without Scanner-UI. Now you will see, that "SXC_EnableSource(...)" comes NOT BACK and if the application calls "SXC_EnableSource(...)" again, it will crash. Hope you do understand my english? If not, let me know and I will try to explain it with other words.
- Attachments
-
- ScanResults.zip
- (134.26 KiB) Downloaded 225 times
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Is there a bug in your ScanDemo for VB?
I have found a few mistakes in the scanner library, and have fixed them apologies !
Please check these attachments - one is the fixed scanner library DLL (32-bits) and the other - modified VB example.
Please check these attachments - one is the fixed scanner library DLL (32-bits) and the other - modified VB example.
- Attachments
-
- ScanDemo_VB.zip
- (26.04 KiB) Downloaded 235 times
-
- xcscan40.zip
- (61.53 KiB) Downloaded 240 times
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: Is there a bug in your ScanDemo for VB?
Thank you very much!
But one problem is still exist.
Please open the VB example and go to "frmMain.Private Sub StartScan(ByVal isUI As Boolean)"
Now you will see this lines of code:
...>
res = SXC_EnableSource(m_TwainObj, 0, isUI)
b = CHECK_TW(m_TwainObj, res, str)
AddLog str
...>
Now set a breakpoint to the row "b = CHECK_TW(m_TwainObj, res, str)" and start the application in debug mode (F5).
Please scan WITHOUT UI (this is important!) now. The scan will work, but the program holds still on the row "res = SXC_EnableSource(m_TwainObj, 0, isUI)".
Now try to scan again! ...You will see, it is NOT possible. Now close VB.exe and the IDE will crash.
Also I've already try out to call "SXC_DisableSource m_TwainObj" in Public Sub "SGetData(...)" - but without success. Also I can't scan a next page because this problem.
I think there is a very little bug still inside your DLL maybe.
But one problem is still exist.
Please open the VB example and go to "frmMain.Private Sub StartScan(ByVal isUI As Boolean)"
Now you will see this lines of code:
...>
res = SXC_EnableSource(m_TwainObj, 0, isUI)
b = CHECK_TW(m_TwainObj, res, str)
AddLog str
...>
Now set a breakpoint to the row "b = CHECK_TW(m_TwainObj, res, str)" and start the application in debug mode (F5).
Please scan WITHOUT UI (this is important!) now. The scan will work, but the program holds still on the row "res = SXC_EnableSource(m_TwainObj, 0, isUI)".
Now try to scan again! ...You will see, it is NOT possible. Now close VB.exe and the IDE will crash.
Also I've already try out to call "SXC_DisableSource m_TwainObj" in Public Sub "SGetData(...)" - but without success. Also I can't scan a next page because this problem.
I think there is a very little bug still inside your DLL maybe.
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Do you have only one scanner? Can you try to reproduce the issue on another one ?
And also please check if you scanner doesn't show the UI (even if NoUI specified, some scanners can show UI, and requires to press "Close" button)
And also please check if you scanner doesn't show the UI (even if NoUI specified, some scanners can show UI, and requires to press "Close" button)
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: Is there a bug in your ScanDemo for VB?
> Do you have only one scanner? Can you try to reproduce the issue on another one ?
Yes, a Samsung CLX-3175FN. But also already tested a little Test.exe with a old canon scanner (from a customer).
> And also please check if you scanner doesn't show the UI
No, I see no UI (only with UI=True I will see the sacnner UI). And btw - the scan without UI works with other scan-applications (like Acrobat Reader, Omnipage and many more).
And also remember: I can scan without UI with LEADTOOLS Scan-OCX (very old version 12) without any problems. If you want, I will send you a little demo code.
I've also noticed that if I call "SXC_DeleteTwainObject m_TwainObj" after the scan-process by buttonClick-Event, your "SXC_EnableSource" comes back from the slumber sleep. But this ist not really a solution, because I can not call SXC_DeleteTwainObject automatic ny code. For example If I try to call "SXC_DeleteTwainObject..." at the end of your GetData CallBack-function, it will not work. It is definitifly necessarily to call "SXC_DeleteTwainObject m_TwainObj" explicit after the scan-routines. Another problem is: After calling "SXC_DeleteTwainObject..." my complete Scan-object is deleted (Object is NOTHING) and I must re-Init this complete object for the next page... and so on...
See the attached video for a better understanding
Yes, a Samsung CLX-3175FN. But also already tested a little Test.exe with a old canon scanner (from a customer).
> And also please check if you scanner doesn't show the UI
No, I see no UI (only with UI=True I will see the sacnner UI). And btw - the scan without UI works with other scan-applications (like Acrobat Reader, Omnipage and many more).
And also remember: I can scan without UI with LEADTOOLS Scan-OCX (very old version 12) without any problems. If you want, I will send you a little demo code.
I've also noticed that if I call "SXC_DeleteTwainObject m_TwainObj" after the scan-process by buttonClick-Event, your "SXC_EnableSource" comes back from the slumber sleep. But this ist not really a solution, because I can not call SXC_DeleteTwainObject automatic ny code. For example If I try to call "SXC_DeleteTwainObject..." at the end of your GetData CallBack-function, it will not work. It is definitifly necessarily to call "SXC_DeleteTwainObject m_TwainObj" explicit after the scan-routines. Another problem is: After calling "SXC_DeleteTwainObject..." my complete Scan-object is deleted (Object is NOTHING) and I must re-Init this complete object for the next page... and so on...
See the attached video for a better understanding
- Attachments
-
- demo.zip
- (539.24 KiB) Downloaded 221 times
Re: Is there a bug in your ScanDemo for VB?
...here is another demo for you to demonstrate the main problem.
For this video clip I use your example "ScannerDemo_PDFXC.exe" with your new "xcscan40.dll"...
For this video clip I use your example "ScannerDemo_PDFXC.exe" with your new "xcscan40.dll"...
- Attachments
-
- demo2.zip
- (599.39 KiB) Downloaded 222 times
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Hi Dorwol,
we still cannot reproduce this here using our Brother/Epson Scanners - we are going to set up a new test machine with a Canon scanner over the weekend and if we can reproduce hope to resolve in time for the new build on Monday ..
we still cannot reproduce this here using our Brother/Epson Scanners - we are going to set up a new test machine with a Canon scanner over the weekend and if we can reproduce hope to resolve in time for the new build on Monday ..
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Re: Is there a bug in your ScanDemo for VB?
OK, thank you and have a nice weekend!
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Is there a bug in your ScanDemo for VB?
This problem has now been located and a fix available in Build 201 released a little later today.
thanks for your patience.
thanks for your patience.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
Re: Is there a bug in your ScanDemo for VB?
> This problem has now been located
Wow!
> and a fix available in Build 201 released a little later today.
Thanks a lot!
Wow!
> and a fix available in Build 201 released a little later today.
Thanks a lot!
- Paul - Tracker Supp
- Site Admin
- Posts: 6829
- Joined: Wed Mar 25, 2009 10:37 pm
- Location: Chemainus, Canada
- Contact:
Re: Is there a bug in your ScanDemo for VB?
Best regards
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com