Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

pdf open file function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php pdf open file () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.0.5, PHP 5)

pdf_open_file -- Opens a new pdf object

Syntax

bool pdf_open_file ( resource pdfdoc, string filename )

Create a new PDF file using the supplied file name. If filename is empty the PDF document will be generated in memory instead of on file. The result must be fetched by the client with the pdf_get_buffer() function. Parameter filename was optional before PHP 5. Returns TRUE on success or FALSE on failure.

The following example shows how to create a pdf document in memory and how to output it correctly.

Example 1. Creating a PDF document in memory

<?php

$pdf
= pdf_new();

pdf_open_file($pdf);
pdf_begin_page($pdf, 595, 842);
pdf_set_font($pdf, "Times-Roman", 30, "host");
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "A PDF document created in memory!", 50, 750);
pdf_end_page($pdf);
pdf_close($pdf);

$data = pdf_get_buffer($pdf);

header("Content-type: application/pdf");
header("Content-disposition: inline; filename=test.pdf");
header("Content-length: " . strlen($data));

echo
$data;

?>

Php pdf open file Function syntax tag

pdf open file php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php pdf open file syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online