PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 11, 2022

[FIXED] How to generate image for a label printer

 October 11, 2022     dpi, gd, php, printing     No comments   

Issue

I have an image that I create which get's initialized like so:

$width = 800;
$height = 600;
$im = @imagecreate($width, $height);
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 0, 0, 0);
$font1 = '../library/BarCodeGen/font/timesbd.ttf';
$font2 = '../library/BarCodeGen/font/Arial.ttf';
$fontSize = 34;
// etc...

The font size is quite large; and the image that gets generated is like this:

enter image description here

The problem is, whenever I print this label via my label printer (hardware) the label and font is really small, as shown in this photo:

enter image description here

I understand that the label printer prints in 203 DPI and is called the Wasp WPL305 Thermal Label Printer With Cutter.

How can I make it so the font is larger? I don't think I should set $fontSize = // some big number because 34 point font should be big enough. I just don't know why it is printing it so small...

Thanks.


Solution

The problem here was that the label printer had to be configured to use the proper size of labels. Once I downloaded the new driver from here http://www.bartenderbarcodesoftware.com/drivers/printer-driver-features.aspx?m=Wasp+WPL-305 I was able to create a new Preset with the correct size of the labels. Then, the print was correct.



Answered By - user1477388
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing