Closed praveenppass closed 5 years ago
my Ts File...
scanDocImg: any;
docScanner() {
let actionSheet = this.actionSheetCtrl.create({
buttons: [
{
text: 'Use Library',
handler: () => {
scan.scanDoc(0, scanSuccess, scanError);
}
}, {
text: 'Capture Image',
handler: () => {
scan.scanDoc(1, scanSuccess, scanError);
}
}, {
text: 'Cancel',
role: 'cancel'
}
]
});
actionSheet.present();
function scanSuccess(imageURI) {
let img_URL = `${imageURI}`;
if (img_URL) {
this.scanDocImg = img_URL;
}
}
function scanError(message) {
console.log(`Failed because: ${message}`);
}
}
My Html Page --
<ion-card *ngIf="scanDocImg">
<ion-card-header>
<img [src]="scanDocImg" style="width: 100%;">
</ion-card-header>
<ion-card-content>
<ion-fab>
<button ion-fab color="light" (click)="share(img_URL)"> <ion-icon name="share"></ion-icon></button>
</ion-fab>
</ion-card-content>
</ion-card>
Yes I was useing without $ but both response is same please suggest how I will add in ionic3
I retested on JavaScript and I am able to use the image Id and src to set the image using the imageURI directly as given in the example in the readme.
You can check out this issue for how we used this plugin in ionic 2 (https://github.com/NeutrinosPlatform/cordova-plugin-document-scanner/issues/17).
But I think since you are getting the location of the file correctly, the plugin is working as intended. All that needs to be done is to figure out how to display an image in an tag using the imageURI.
Yes i am getting in console but when i want to store this value in this.scanDocImg then i getting these issue where i was share image.
hi i am store path in a variable when success scan and i am getting image url path but when i am store then getting error on below.