3 Answers, 1 is accepted
0
Hello Mahesh,
I am afraid that such byte array cannot be extracted from the Barcode widget.
I am sorry for any inconvenience caused.
Kind Regards,
Petur Subev
Telerik
I am afraid that such byte array cannot be extracted from the Barcode widget.
I am sorry for any inconvenience caused.
Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mahesh
Top achievements
Rank 1
answered on 20 Sep 2013, 02:31 PM
Hello Petur,
Thanks for your reply,
I have written following code to create bar code.
$("#barCodeTest").kendoBarcode({
value: "012345",
renderAs: "svg",
type: "upce",
width: 150,
height: 60
});
var barCode = $("#barCodeTest").data("kendoBarcode");
if (barCode != null) {
// Getting Error here, following methods are not able to access
var image = barCode.imageDataURL();
var svg = barCode.svg();
}
I am not able access "imageDataURL()" and "svg()" methods.
How to use these or which libraries need to include to access these methods?
Is it possible to get image object from "imageDataURL()" or "svg()" methods?
I have also attached sample application with this post. Please check it.
Thanks,
Mahesh A
Thanks for your reply,
I have written following code to create bar code.
$("#barCodeTest").kendoBarcode({
value: "012345",
renderAs: "svg",
type: "upce",
width: 150,
height: 60
});
var barCode = $("#barCodeTest").data("kendoBarcode");
if (barCode != null) {
// Getting Error here, following methods are not able to access
var image = barCode.imageDataURL();
var svg = barCode.svg();
}
I am not able access "imageDataURL()" and "svg()" methods.
How to use these or which libraries need to include to access these methods?
Is it possible to get image object from "imageDataURL()" or "svg()" methods?
I have also attached sample application with this post. Please check it.
Thanks,
Mahesh A
0
Hello Mahesh,
You have included old versions and scripts that are already included in the all.min.js pack of kendo.
Try with the following scripts and you should make everything work:
Kind Regards,
Petur Subev
Telerik
You have included old versions and scripts that are already included in the all.min.js pack of kendo.
Try with the following scripts and you should make everything work:
<link href=
"http://cdn.kendostatic.com/2013.2.716/styles/kendo.common.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link href=
"http://cdn.kendostatic.com/2013.2.716/styles/kendo.rtl.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link href=
"http://cdn.kendostatic.com/2013.2.716/styles/kendo.default.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link href=
"http://cdn.kendostatic.com/2013.2.716/styles/kendo.dataviz.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link href=
"http://cdn.kendostatic.com/2013.2.716/styles/kendo.dataviz.default.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link href=
"http://cdn.kendostatic.com/2013.2.716/styles/kendo.mobile.all.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script src=
"http://code.jquery.com/jquery-1.9.1.min.js"
></script>
<script src=
"http://cdn.kendostatic.com/2013.2.716/js/kendo.all.min.js"
></script>
<script type=
"text/javascript"
>
$(document).ready(
function
() {
// For each barcode type value length is different
$(
"#barCodeTest"
).kendoBarcode({
value:
"0123451"
,
renderAs:
"svg"
,
type:
"ean8"
,
width: 150,
height: 60
});
var
barCode = $(
"#barCodeTest"
).data(
"kendoBarcode"
);
if
(barCode !=
null
) {
// Getting Error here, following methods are not able to access
var
image = barCode.imageDataURL();
var
svg = barCode.svg();
console.log(image);
console.log(svg);
}
});
</script>
<h1>Bar code</h1>
<div id=
"barCodeTest"
></div>
Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!