View Pdf in PHP
In this blog I will teach you how to view pdf file in php. I am working on a php project where a pdf has to be shown in div container for that purpose I use this code may be it will help you in your project
Lets get start, first I upload the file in database means store the path of file in database and move the file from temporary directory to project directory and save that path to the database. At the time of viewing I fetch that path in a variable and passes that variable to the value of src attribute in Iframe tag the source code is given below
1) Database where path of file is saved
2)Output of the program
echo '<embed src='.$a.' type="application/pdf" height="730" width="50%">';
$variable is a variable of php which contains the path of file
Thanks for reading my article if it helps you so please share
In this blog I will teach you how to view pdf file in php. I am working on a php project where a pdf has to be shown in div container for that purpose I use this code may be it will help you in your project
Lets get start, first I upload the file in database means store the path of file in database and move the file from temporary directory to project directory and save that path to the database. At the time of viewing I fetch that path in a variable and passes that variable to the value of src attribute in Iframe tag the source code is given below
1) Database where path of file is saved
2)Output of the program
echo '<embed src='.$a.' type="application/pdf" height="730" width="50%">';
$variable is a variable of php which contains the path of file
Thanks for reading my article if it helps you so please share
0 Comments