Skip to content

Instantly share code, notes, and snippets.

@jagroop
Created March 1, 2018 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagroop/cf45a57c0268d820049c3666dc2eedd2 to your computer and use it in GitHub Desktop.
Save jagroop/cf45a57c0268d820049c3666dc2eedd2 to your computer and use it in GitHub Desktop.
cors
<?php
require 'vendor/autoload.php';
require 'helpers.php';
$randomTxt = "jagroop singh.";
$redeemdesc = 'Reward entitles you to one night of Romance with Giver. Giver will take all necessary steps to create the mood and conditions to spark the';
$redeemPoint = '750';
$title = 'Reward title';
$firstReply = parseString($randomTxt);
$from = 'jagroop';
$to = 'jagroop';
$redeemName='foo';
$image = new \NMC\ImageWithText\Image(dirname(__FILE__) . '/images/Mytime.png');
$textt = ucfirst($to);
$text1 = new \NMC\ImageWithText\Text($textt);
$text1->align = 'left';
$text1->color = '000000';
$text1->background = 'ffffff';
$text1->font = dirname(__FILE__) . '/fonts/Lato-Regular.ttf';;
$text1->lineHeight = 15;
$text1->size = 10;
$text1->startX = 164;
$text1->startY = 233;
$image->addText($text1);
// Add another styled text to image
$textt1 = ucfirst($from);
$text2 = new \NMC\ImageWithText\Text($textt1);
$text2->align = 'left';
$text2->color = '000000';
$text2->font = dirname(__FILE__) . '/fonts/Lato-Regular.ttf';;
$text2->lineHeight = 15;
$text2->size = 10;
$text2->startX = 185;
$text2->startY = 257;
$image->addText($text2);
// Add another styled text to image
$textt2 = date('d/m/Y');
$text3 = new \NMC\ImageWithText\Text($textt2);
$text3->align = 'left';
$text3->color = '000000';
$text3->font = dirname(__FILE__) . '/fonts/Lato-Regular.ttf';;
$text3->lineHeight = 15;
$text3->size = 10;
$text3->startX = 185;
$text3->startY = 281;
$image->addText($text3);
$textt3 = parseString($redeemdesc);
$textt5 = parseString(strtoupper($redeemName));
$text6 = new \NMC\ImageWithText\Text($textt3, 7, 35);
$text6->align = 'left';
$text6->color = 'ffffff';
$text6->font = dirname(__FILE__) . '/fonts/Lato-Regular.ttf';;
$text6->lineHeight = 20;
$text6->size = 15;
$text6->startX = 30;
$text6->startY = 150;
$image->addText($text6);
// Add another styled text to image
$text4 = new \NMC\ImageWithText\Text($title);
$text4->align = 'left';
$text4->color = 'ffffff';
$text4->font = dirname(__FILE__) . '/fonts/Lato-Regular.ttf';
$text4->lineHeight = 20;
$text4->size = 20;
$text4->startX = 30;
$text4->startY = 130;
$image->addText($text4);
$textt4 = $redeemPoint;
$text5 = new \NMC\ImageWithText\Text($textt4);
$text5->align = 'left';
$text5->color = 'ffffff';
$text5->font = dirname(__FILE__) . '/fonts/Lato-Regular.ttf';;
$text5->lineHeight = 20;
$text5->size = 15;
$text5->startX = 78;
$text5->startY = 240;
$image->addText($text5);
$randomImageName = 'destination.jpg';
// Render image
$renderedImage = dirname(__FILE__) . '/' . $randomImageName;
$image->render($renderedImage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment