0% found this document useful (0 votes)
5 views2 pages

WBP PR 7

The document outlines a PHP program aimed at creating PDF documents using graphics concepts. It includes a theoretical section detailing various graphics functions such as page setup, shapes, colors/styles, text/images, and output generation. A sample code snippet demonstrates the implementation of these concepts using the FPDF library.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

WBP PR 7

The document outlines a PHP program aimed at creating PDF documents using graphics concepts. It includes a theoretical section detailing various graphics functions such as page setup, shapes, colors/styles, text/images, and output generation. A sample code snippet demonstrates the implementation of these concepts using the FPDF library.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: Mohammad Muazzam Class: CO6IB Batch: B1

Enroll: 2205690321 Subject: WBP Practical: 7

Aim: Write a simple PHP program to create PDF documents by using graphics concepts.

Theory:
XII. Practical Related Questions:
a. Write use of various graphics function.

1. Page Setup: AddPage(), SetMargins() — Set page and margins


2. Shapes: Line() for lines, Rect() for rectangles, Ellipse() (TCPDF) for circles,
Polygon() (TCPDF) for complex shapes.
3. Colors/Styles: SetDrawColor() for bordercolor, SetFillColor() for fill color,
SetLineWidth() for line thickness
4. Text/Images: Text() to add text, Image() to insert images
5. Output: Output() to generate and display/download the PDF.
Code:
<?php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

You might also like