Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:10:28+00:00 2026-06-01T09:10:28+00:00

I’m trying to dynamically generate QR codes for my thermal printer. In order to

  • 0

I’m trying to dynamically generate QR codes for my thermal printer. In order to do this, I have to send a request to my server (say something like http://domain.example.com/qr?url=).

This page should then go and get a QR code from Google in PNG format. So far so good.

But now the difficult part. Once I have done that, I need to convert it to something along the lines of this.

I have previously found this question, but, unlike him, I need to do it on the web. I don’t have access to installing PHP modules on the server, and so the best option for me, as far as I know, is phMagik, but again the problem is that as far as I know this does not support the extra parameters that can be fed into the normal Linux or Windows version of ImageMagik, as detailed on this documentation page.

So does anyone know how I could get round this problem? In the long term I’m hoping to make my own version of the Little Printer. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:10:29+00:00Added an answer on June 1, 2026 at 9:10 am

    Just use the normal linux version of ImageMagick – call it using exec()

    If you don’t have access to install things on your server, then it’s going to get a little more complicated. If you have GD installed (you probably do), you can use http://php.net/imagecreatefrompng to get at the pixel data. You can then manually create the thing you’re looking for, something like this:

    $file = "/path/to/png.png"; 
    $image = ImageCreateFromPng($file); 
    list($w, $h) = GetImageSize($file); 
    
    $pixels = array();
    for ($x=0; $x<$w; $x++){
    for ($y=0; $y<$h; $y++){
        $rgb = ImageColorAt($image, $x, $y); 
        $r = ($rgb >> 16) & 0xFF;
        $g = ($rgb >> 8) & 0xFF;
        $b = $rgb & 0xFF;
        $pixels = '0x'.sprintf('%02x', ($r+$g+$b)/3); # store the average of r/g/b
    }
    }
    
    echo "static unsigned char __attribute__ ((progmem)) adalogo [] = {\n";
    echo implode(', ', $pixels);
    echo "};\n";
    

    You need to first get the actual PNG – you could either fetch it via URL if you have file wrappers enabled:

    $file = "http://url.com/to/png.png"; 
    $image = ImageCreateFromPng($file); 
    

    Or use PHP on the command line first the grab the image:

    $file = "/path/to/png.png"; 
    exec("php /path/to/script.php > $file");
    $image = ImageCreateFromPng($file); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.