PHP create pdf file css style php - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

create pdf file with css style using php


 711

PHP


2

<?php

// download from https://php-download.com/package/mpdf/mpdf
include('MPDF57/mpdf.php');

$mpdf=new mPDF();

// create css style
$css=
"<style>
.cssPDF{
margin-bottom:20px;
font-weight:bold;
font-size:34px;
font-family:sans-serif;
border-bottom:3px solid #333;
color:teal;
}
</style>
";

// create the header
$mpdf->WriteHTML("$css<p class='cssPDF'>Hello Net-Raft.com</p>");

// create 10 pages and insert the page numbers
for($i=1;$i<=10;$i++){
$mpdf->AddPage();
$mpdf->WriteHTML("<h1>The page number $i <h1>");
}

$mpdf->Output();
exit;

?>


By     Created   
The power of the user (%)
49%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  4.2K     406

create QR code phpcreate QR code phpPHP

Click to see more ...

  2.7K     286

drag and drop upload file using phpdrag and drop upload file using phpPHP

Click to see more ...

  2.4K     253

create relative date phpcreate relative date phpPHP

Click to see more ...

  1.8K     252

delete array item phpdelete array item phpPHP

Click to see more ...

  2.1K     238

detect ie phpdetect ie phpPHP

Click to see more ...

  1.4K     212

get meta tag phpget meta tag phpPHP

Click to see more ...

  1.2K     191

get current url phpget current url phpPHP

Click to see more ...

  1.1K     189

Get real client country using php ?Get real client country using php ?PHP

Click to see more ...

  781     173

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  856     142