Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php code add text on existing pdf file

require_once('fpdf.php');require_once('fpdi.php'); function generatePDF($source, $output, $text, $image) { $pdf = new FPDI('Portrait','mm',array(215.9,279.4)); // Array sets the X, Y dimensions in mm$pdf->AddPage();$pagecount = $pdf->setSourceFile($source);$tppl = $pdf->importPage(1); $pdf->useTemplate($tppl, 0, 0, 0, 0); $pdf->Image($image,10,10,50,50); // X start, Y start, X width, Y width in mm $pdf->SetFont('Helvetica','',10); // Font Name, Font Style (eg. 'B' for Bold), Font Size$pdf->SetTextColor(0,0,0); // RGB $pdf->SetXY(51.5, 57); // X start, Y start in mm$pdf->Write(0, $text); $pdf->Output($output, "F");} generatePDF("template.pdf", "export.pdf", "Hello world", "image.jpg");
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress wp_nav_menu custom id 
Php :: laravel mass update relationship 
Php :: php class 
Php :: laravel many to many relationship 
Php :: php password_hash 
Php :: Creating dynamic subdomain in php 
Php :: php replace url parameter value 
Php :: laravel env use other env variables 
Php :: PHP parse_str — Parses the string into variables 
Php :: Get All dates of a month 
Php :: array filter php get first object 
Php :: send email verification nootification laravel 
Php :: how to add an array into an associative array in php 
Php :: php inner join array 
Php :: middleware in laravel 
Php :: laravel project composer [ErrorException] Undefined index: name 
Php :: php carbon 
Php :: php class extends two classes 
Php :: input if not null laravel 
Php :: error handling in laravel 
Php :: prefix laravel route 
Php :: cron job setting for laravel in cpanel 
Php :: phpexcel 
Php :: Bd phone number validation in laravel 
Php :: How to find data in other row with laravel-excel 
Php :: Storing login info in a session 
Php :: aravel cache store does not support tagging 
Php :: import csv laravel 
Php :: PHP detect spam name 
Php :: php tools for visual studio package did not load correctly 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =