Hello all! i've accessed the 1C Barcode component using API but i print it not show right picture barcode, and in "1C:Small Business 1.4 (demo)" it show picture barcode template.
ConnectionCompleted = AttachAddIn("CommonTemplate.InBarcode",
"BarCodePicture", AddInType.Native);
If ConnectionCompleted Then
ExternalComponent = New("AddIn.BarCodePicture.Barcode");
Else
Return Undefined;
EndIf;
ExternalComponent.CodeType = 1;
ExternalComponent.CodeValue = TrimAll(Code);
ExternalComponent.CodeText = TrimAll(Code);
Area.Drawings.D4.Picture = ExternalComponent.GetBarcode(); // template has got picture name "D4"
// error because: Type mismatch
Area.Drawings.D3.Picture = ExternalComponent.GetBarcode();
I don't know why it's error ?
This answer Andrey Golyshev
Quote
Actually i've accessed the 1C Barcode component using API only and it's working fine.
For example: Area.Drawings.EAN.Object.CodeValue = "1234567890128"; // Change "1234567890128" = "1234567890111" but print still "1234567890128"
Here: - Area - is area cells of table document; - Drawings - is a collection of attached drawings; - EAN - is a name of drawing containg ActiveX object; - Object - is drawing property referencing 1C Barcode object; - CodeValue - 1C Barcode property containing text for constructing the barcode.
You need to convert the BinaryData into the Picture to assign it to the drawing:
Code
// Generating a picture
PictureBinaryData = ExternalComponent.GetBarcode();
// If the picture is generated
If Not PictureBinaryData = Undefined Then
// Generating from the binary data
Area.Drawings.D4.Picture New Picture(PictureBinaryData);
EndIf;