This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fileName = $_FILES['afile']['name']; | |
$fileType = $_FILES['afile']['type']; | |
$fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
$json = json_encode(array( | |
'name' => $fileName, | |
'type' => $fileType, | |
'dataUrl' => $dataUrl, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = new Vue({ | |
el: '#app', | |
data: { | |
title: 'DWT + Vue.js', | |
button: 'Scan' | |
}, | |
methods: { | |
acquireImage: function () { | |
var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); | |
DWObject.IfDisableSourceAfterAcquire = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Tutorial: Hello Dojo!</title> | |
<link rel="stylesheet" href="bower_components/dijit/themes/claro/claro.css"> | |
<script>dojoConfig = {parseOnLoad: true}</script> | |
<script src="bower_components/dojo/dojo.js"></script> | |
<script type="text/javascript" src="https://www.dynamsoft.com/library/dwt/dynamsoft.webtwain.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello World</title> | |
<link rel="stylesheet" href="bower_components/dijit/themes/claro/claro.css"> | |
<script> | |
dojoConfig = { | |
parseOnLoad: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<div id="divLoadInfo">loading...</div> | |
<input id="uploadImage" type="file" accept="image/bmp,image/jpeg,image/png,image/gif"> | |
<script src="https://demo.dynamsoft.com/dbr_wasm/js/dbr-6.3.0.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); | |
if args.len() == 1 { | |
println!("Please input an image file."); | |
return | |
} | |
let file_name = env::args().nth(1).expect("Missing argument"); | |
println!("{}", file_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct Barcode { | |
char* barcode_type; | |
char* barcode_value; | |
} Barcode; | |
typedef __int32 int32_t; | |
typedef void (*RustCallback)(int32_t, const char *, const char *); | |
int32_t register_callback(RustCallback callback); | |
void c_decodeFile(const char *fileName, const char *pszLicense); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "bridge.h" | |
#include "DynamsoftBarcodeReader.h" | |
#include <stdio.h> | |
RustCallback cb; | |
int32_t register_callback(RustCallback callback) { | |
cb = callback; | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate cc; | |
use std::env; | |
use std::fs; | |
fn main() { | |
// Link Dynamsoft Barcode Reader. | |
println!("cargo:rustc-link-search=./platforms/win"); | |
println!("cargo:rustc-link-lib=DBRx64"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate bindgen; | |
fn main() { | |
// Generates Rust FFI bindings. | |
let bindings = bindgen::Builder::default() | |
// The input header we would like to generate | |
// bindings for. | |
.header("src/bridge.h") | |
// Finish the builder and generate the bindings. | |
.generate() |
OlderNewer