Closed occult closed 4 years ago
@occult thanks for your feedback. Can you provide the web page in which you found the code?
I've looked up the issue. Please check out my comments.
Dynamsoft.WebTwainEnv.Load();
?If Dynamsoft.WebTwainEnv.AutoLoad = false;
, you need to manually load the TWAIN component.
Dynamsoft.WebTwainEnv.Load()
If you install Dynamic Web TWAIN locally, you will get the resource folder.
In dynamsoft.webtwain.config.js
, you can see Dynamsoft.WebTwainEnv.AutoLoad = true;
.
In our official documentation, the SDK is used as follows:
<head>
<script type="text/javascript" src="Resources/dynamsoft.webtwain.initiate.js"></script>
<script type="text/javascript" src="Resources/dynamsoft.webtwain.config.js"></script>
</head>
Alternatively, you can import the online JS source if you don't want to download the installer:
<head>
<script type="text/javascript" src="https://unpkg.com/dwt/dist/dynamsoft.webtwain.min.js"> </script>
</head>
Open the JS file to check the AutoLoad
status:
The value is false
.
Currently, I don't know why they are different. I'll confirm the issue with our R&D team.
Thank you so much! You’re correct. I had this setting, but I thought it was for something else.
From: Xiao Ling notifications@github.com Sent: Thursday, December 5, 2019 9:30 PM To: Dynamsoft/Dynamic-Web-TWAIN Cc: Felipe Braga; Mention Subject: Re: [Dynamsoft/Dynamic-Web-TWAIN] GetWebTwain returns null if Load isn't used before (#6)
@occulthttps://github.com/occult thanks for your feedback. Can you provide the web page in which you found the code?
I've looked up the issue. Please check out my comments.
When should you use Dynamsoft.WebTwainEnv.Load();?
If Dynamsoft.WebTwainEnv.AutoLoad = false;, you need to manually load the TWAIN component.
Dynamsoft.WebTwainEnv.Load()
The default AutoLoad property value
If you install Dynamic Web TWAIN locally, you will get the resource folder.
[Annotation 2019-12-06 075946]https://user-images.githubusercontent.com/2202306/70284497-2a2e5400-17ff-11ea-934f-d319639ff4ee.png
In dynamsoft.webtwain.config.js, you can see Dynamsoft.WebTwainEnv.AutoLoad = true;.
[Annotation 2019-12-06 081816]https://user-images.githubusercontent.com/2202306/70285003-0409b380-1801-11ea-8a5b-f85622ebb9c3.png
In our official documentation, the SDK is used as follows:
Alternatively, you can import the online JS source if you don't want to download the installer:
Open the JS file to check the AutoLoad status:
[Annotation 2019-12-06 081200]https://user-images.githubusercontent.com/2202306/70284972-e9cfd580-1800-11ea-9098-45f74748e7d0.png
The value is false.
Currently, I don't know why they are different. I'll confirm the issue with our R&D team.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Dynamsoft/Dynamic-Web-TWAIN/issues/6?email_source=notifications&email_token=ABXLBQO5MKV6WWR6Q44RLBDQXGMLRA5CNFSM4JV2ESW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGCTWVI#issuecomment-562379605, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXLBQJVTSR5BLZSMH2726TQXGMLRANCNFSM4JV2ESWQ.
If I use the code example on your site such as
dwObject
will returnnull
. However, if I runDynamsoft.WebTwainEnv.Load();
before clicking on the button, it will work.I found the
Dynamsoft.WebTwainEnv.Load();
on another website and have only seen it once in the documentation.Why doesn't the official documentation include the load? or am I missing something?
Thank you so much!! Besides that, this SDK is excellent.