How to Change the size of Barcode

  • Posts: 1
  • Thank you received: 0
9 years 7 months ago #197345

-- HikaShop version -- : 2.4.0
-- HikaSerial version -- : 1.9.1
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.39

Hi, First of all thanks for an excellent product hikashop and serial .

My problem is that i can not change the size of the barcode i print using AttachSerial plugin
when i increase the size ṕarameter the only thing that happens is that my barcode gets higher but it is still as wide (or narrow) all the time . It's most likely just a matter of setting the right parameter.

When changing the same parameter for my qrcode is affects both width and height so it works for that

and is the a way of easily regenerate the file that is created and attached for the order , right not when i am testing/creating my eTicket its a bit of work to go to the webshop , add items to the cart , checkout and wait for the confiormation mail

Best regards
Peter

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 7 months ago #197347

Hi,

Thanks for the report.

That's right, the setting "size" was just changing the height of the barcode but was not affecting the width.
So, I think that we have to modify the plugin "attach serial" in order to change how the settings are handle.
Please edit the file "plugins/hikaserial/attachserial/attachserial.php" and replace

	if(empty($d['size']))
		$d['size'] = 40;

	$BarCode = hikaserial::get('inc.barcode', 'ean13', $d['size'], $width, $showText);
By
	if(empty($d['h']))
		$d['h'] = 40;
	if(empty($d['size']))
		$d['size'] = 1;

	$BarCode = hikaserial::get('inc.barcode', 'ean13', $d['h'], $d['size'], $showText);
So it will use the parameter "size" to define the width of the barcode lines (in pixels) and it will use the parameter "height" in order to set the height of the barcode (in pixels).
You can't really define a fixed width of a EAN13 barcode, but you can use the parameter "size" as a width coefficient.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: pestal

Please Log in or Create an account to join the conversation.

  • Posts: 846
  • Thank you received: 92
9 years 7 months ago #197365

Hi

I read in the forum
"HikaSerial embedded a barcode generator and a QRcode generator.
His library could be use for the generation of such images with a little development."

In wich format could be generate the bar code in hikashop ? only raster ?

thank's

Last edit: 9 years 7 months ago by lionel75.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 7 months ago #197368

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lionel75

Please Log in or Create an account to join the conversation.

  • Posts: 846
  • Thank you received: 92
9 years 2 months ago #214731

Hi
where is documented the parameters use by hks for barcode in the php code beneath . Is there other parameters that are not call ( because already set by using defaut options value) ?
is there a php editor that show us the a select box to know wich value can be choose for example has alternative to ean13 ? If not where is define the list of choice of this parameters ?

$BarCode = hikaserial::get('inc.barcode', 'ean13', $d, $d, $showText);

thank's

Last edit: 9 years 2 months ago by lionel75.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 2 months ago #214736

Hi,

Lib "barcode2" : pear.php.net/package/Image_Barcode2
inc.barcode constructor :

public function __construct($type = 'int25', $height = 60, $width = 1, $showText = true, $rotation = 0, $format = 'png') {
for more details, please refer to the lib file (admin.../com_hikaserial/inc/barcode.php)

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.062 seconds
Powered by Kunena Forum