How to place text over an image at particular position using codeigniter - codeigniter-3

My project is an online exam using CodeIgniter. once a student completed an online exam, I need to display the marks on the mark sheet image. I need to display student name, student photo, register number, mark a particular position in an image.
I have tried to place text over an image using PHP using below function
imagettftext, image copy, imagecreatefromjpeg. in wamp server, it's working. when I copy the same program in xampp it shows a black background.
these function not working in CodeIgniter also. How to do this using CodeIgniter?
I have tried this in core PHP. It's working.
imagettftext($our_image, $size,$angle,$left5,$top5 , $white_color, $font_path, 'MSO');
imagettftext($our_image, $size,$angle,$left6,$top5, $white_color, $font_path, '100');
imagettftext($our_image, $size,$angle,$left7,$top5, $white_color, $font_path, '70');
imagettftext($our_image, $size,$angle,$left8,$top5, $white_color, $font_path, '70% A');
imagettftext($our_image, $size,$angle,$left6,$top6, $white_color, $font_path, '100');
imagettftext($our_image, $size,$angle,$left7,$top6, $white_color, $font_path, '70');
imagettftext($our_image, $size,$angle,$left8,$top6, $white_color, $font_path, '70% A');
imagettftext($our_image, $size,$angle,$left9,$top7, $white_color, $font_path, date('d/m/Y'));
$im2 = imagecreatefromjpeg("cmimage/studentphoto.jpg");
imagecopy($our_image,$im2,1900,1140,-80,-80,360,400);

Related

Ionic android ion-icon not showing

Since i used :
The ion-icon not showing on my android device, i did this for making work the firebase googleAuth !
Do you have any suggestion to make them appear ?
Thanks in advance,
ionic -v
6.16.3
be sure you have this in your angular.json:
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
If still not working, you need to add this in your app.component:
import { fetch as fetchPolyfill } from 'whatwg-fetch';
window.fetch = fetchPolyfill;

how does fast-exif works under ionic 4?

I would like to use under ionic 4 "fast-exif".
https://github.com/titarenko/fast-exif
And I don't arrive to make it works
var exif = require('fast-exif');
doesn't work under ionic 4
Edited to show the code:
const exif = require('fast-exif');
const img = files[0];
exif.read(img).then(console.log).catch(console.error);
Someone can help me with this?
Thanks

IText PDFImage seems to shrink or disappear during new pages after upgrade from 2.1.7 to 5.5.5 (Java .jars)

I seem to have an issue after upgrading iText from 2.1.7 where the PDF seems to be missing or the image has shrunk between pages.
I'm wondering if this is a known issue or if there is something that I need to set in order to fix it.
Some context:
no real calculations have been changed when switching libraries.
the general structure is that we have a Document which has a pdfTable which holds a bunch of pdfImages.
changing between landscape and portrait produces different results.
the images are scaled down so that it will fit the page.
Edit: Sorry, my application was pretty big and does a bunch of work. I had to make a simple mock version before posting the problem
Sample Code (So the numbers are just examples that I used. I basically added a 800*600 Image 5 times using landscape position. I end up seeing only 3 pages when I am expecting 5.)
Note: Using portrait page size shows all 5 but it seems that the sizes vary for some reason.
ByteArrayOutputStream baos = createTemporaryOutputStream();
Document doc = newDocument();
PdfWriter writer = newWriter(doc, baos);
writer.setViewerPreferences(PdfWriter.ALLOW_PRINTING | PdfWriter.PageLayoutSinglePage);
//create page rectangle landscape
Rectangle page = new Rectangle(PageSize.A4.rotate());
doc.setPageSize(page);
doc.setMargins((float)36.0, (float)36.0, (float)36.0, (float)36.0);
doc.open();
//create element pdf table.
PdfPTable table = new PdfPTable(new float[]{(float) 770.0});
table.setWidthPercentage(100);
table.setSplitRows(true);
table.setSplitLate(false);
table.setHeaderRows(0);
// in my case I used 5 800*600 images (same picture)
//then I loop through them and create pdfcell
//and then add it to table which then gets added to the document
List<Image> hi = (List<Image>) model.get("images");
for (Image image : hi) {
com.itextpdf.text.Image pdfImage = com.itextpdf.text.Image.getInstance(image.getBytes());
pdfImage.scalePercent((float) (0.8642384 * 100));
PdfPCell cell = new PdfPCell(pdfImage, false);
table.addCell(cell);
}
doc.add(table);
doc.close();

Set a YouTube video's privacy using GData Obj-C

I know I can set a video as 'Private', while uploading it to Youtube, by :
GDataYouTubeMediaGroup *mediaGroup = [GDataYouTubeMediaGroup mediaGroup];
[mediaGroup setIsPrivate:YES];
Is there a similar way to set a video as 'Unlisted', while uploading it ?
Thanks in advance.
Since I wasn't using an updated version of the GData APIs, first I had to make the changes listed here :
[ http://code.google.com/p/gdata-objectivec-client/source/detail?r=669 ]
Then I used the following code to set the video as 'Unlisted', while uploading it to Youtube :
GDataEntryYouTubeUpload *entry;
entry = [GDataEntryYouTubeUpload uploadEntryWithMediaGroup:mediaGroup
data:data
MIMEType:mimeType
slug:filename];
[entry addAccessControl:[GDataYouTubeAccessControl
accessControlWithAction:#"list" permission:#"denied"]];
Make sure the video is NOT set as 'Private' for this to work :
[mediaGroup setIsPrivate:NO];
Got some major help from :
[ http://groups.google.com/group/gdata-objectivec-client/browse_thread/thread/da69a5ecbb6dfa42?fwc=1 ]

audio/video in phoneGap?

Can you please give me any sample related to audio/video? if the browser doesn't support HTML5, is it throw any error or ??
thanks
sri
on Iphone/Android:
m = new Media("mysong.mp3");
m.play()
on BlackBerry/Palm/Symbian
a = new Audio("mysong.mp3");
a.play();