locked
Which is the best way to communicate a local .exe and js RRS feed

  • Question

  • User283528319 posted

    Hi all,

    I have written <g class="gr_ gr_28 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-del replaceWithoutSep" id="28" data-gr-id="28">a software</g> to get scanned pdf from a scanner (via twain driver).

    Now I use <g class="gr_ gr_90 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="90" data-gr-id="90">clipboard</g> to communicate with that software to get pdf and upload it.

    <g class="gr_ gr_166 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="166" data-gr-id="166">However</g> this feels kinda primitive way to do this. Is there any better / modern method for it?

    thanks.

    Tuesday, April 9, 2019 11:16 AM

Answers

  • User475983607 posted

    I  dont use clipboard to get pdf file I just need to get informed that "the file is uploaded to server"

    I assume you are uploading the file via an action.  The action can run whatever logic you like, writing to a DB etc.  Your web application can check on the next request or you can write JavaScript code that polls the application for the upload.  There's also SignalR.

    Currently, I guess you are polling the clipboard?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 9, 2019 12:38 PM

All replies

  • User475983607 posted

    Hi all,

    I have written a software to get scanned pdf from a scanner (via twain driver).

    Now I use clipboard to communicate with that software to get pdf and upload it.

    However this feels kinda primitive way to do this. Is there any better / modern method for it?

    thanks.

    I'm a bit confused.  If you wrote code to that gets a pdf from a scanner, why are you copying the file to the clipboard rather than simply taking an extra step to have the same software upload the file?

    Tuesday, April 9, 2019 12:23 PM
  • User283528319 posted

    I  <g class="gr_ gr_13 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="13" data-gr-id="13">dont</g> use <g class="gr_ gr_44 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="44" data-gr-id="44">clipboard</g> to get pdf file I just need to get informed that "the file is uploaded to server"

    Tuesday, April 9, 2019 12:27 PM
  • User475983607 posted

    I  dont use clipboard to get pdf file I just need to get informed that "the file is uploaded to server"

    I assume you are uploading the file via an action.  The action can run whatever logic you like, writing to a DB etc.  Your web application can check on the next request or you can write JavaScript code that polls the application for the upload.  There's also SignalR.

    Currently, I guess you are polling the clipboard?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 9, 2019 12:38 PM
  • User283528319 posted

    I just don't want to make server busy and solve the problem with <g class="gr_ gr_59 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="59" data-gr-id="59">minimal</g> source in client side.

    Tuesday, April 9, 2019 12:42 PM
  • User475983607 posted
    I don’t understand why this makes the server busy? Like I said you can do the check the next time the navigates the site.
    Tuesday, April 9, 2019 12:48 PM
  • User283528319 posted

    User clicks the button

    button writes StartScan to <g class="gr_ gr_26 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="26" data-gr-id="26">clipboard</g> (<g class="gr_ gr_71 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="71" data-gr-id="71">mean while</g> it starts a timer to check if the scanned file is uploaded to <g class="gr_ gr_213 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="213" data-gr-id="213">server</g> to show it in <g class="gr_ gr_274 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="274" data-gr-id="274">web</g> page)

    <g class="gr_ gr_34 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="34" data-gr-id="34">Sofware</g> catches command

    Starts scan and finish it 5-30 seconds (with possible mistakes like paper stuck)

    then uploads the file.

    Tuesday, April 9, 2019 1:02 PM
  • User475983607 posted

    User clicks the button

    button writes StartScan to clipboard (mean while it starts a timer to check if the scanned file is uploaded to server to show it in web page)

    Sofware catches command

    Starts scan and finish it 5-30 seconds (with possible mistakes like paper stuck)

    then uploads the file.

    Yeah, I lost interest.  You ask vague questions which are impossible to answer.  

    I'm guessing the clipboard messaging system works as expected.  It seems like a fine solution if you are looking for validation.  

    In another thread I suggested that the scanner process shot the doc to the web server.  You scoffed at this suggestion.  Your solution shots the doc to the web server.  At least as far as I can tell.

    Tuesday, April 9, 2019 1:18 PM
  • User-474980206 posted

    your webpage can not link to a local exe to run due to security.

    the only more modern way, is your scanner exe expose itself as a web service on a know port and support CORS. then the webpage can do an ajax call to scanner program (http://localhost:<mydedicated port>) to get the data. 

    Tuesday, April 9, 2019 4:11 PM
  • User283528319 posted

    it sounds great approach 

    could you be more specific about it

    Tuesday, April 9, 2019 4:42 PM
  • User283528319 posted

    You ask vague questions which are impossible to answer.  

    I am using a secret language only reptilians can understand. sorry about it.

    I thought every one of us is reptilians in here though.

    Tuesday, April 9, 2019 8:07 PM
  • User475983607 posted

    fatihbarut

    it sounds great approach 

    could you be more specific about it

    Host Web API in IIS or a in a Windows Service on the client machine.  

    Tuesday, April 9, 2019 8:31 PM
  • User283528319 posted

    There's also SignalR.

    SignalR was great advice to open my eyes in new horizons

    Wednesday, April 10, 2019 1:15 AM