getId(), array('height' => '300', 'width' => '300'), $apiContext); // ### Optionally Save to File // This is not a required step. However, if you want to store this image as a file, you can use // 'saveToFile' method with proper file name. // This will save the image as /samples/invoice/images/sample.png $path = $image->saveToFile("images/sample.png"); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $image); // ### Show the Image // In PHP, there are many ways to present an images. // One of the ways, you could directly inject the base64-encoded string // with proper image information in front of it. echo 'Invoice QR Code';