How to generate pdf from url [duplicate] - php

This question already has answers here:
How Can I add HTML And CSS Into PDF [closed]
(30 answers)
Closed 5 years ago.
How could i generate a pdf file using url without using any api ?
Or if any free api provider then please tell me.
I have a file www.highstore.in/myticket.php
In this file php & MySQL is used to get data now i want to convert this data as it is in PDF format.

this is not an API, but you can use a FPDF OPEN SOURCE library, it's too easy to use. you can see some examples here :
FPDF LIBRARY

You can use one of free libraries to generate pdf files
https://ourcodeworld.com/articles/read/226/top-5-best-open-source-pdf-generation-libraries-for-php
If you want to return generated pdf as a result of execution of a PHP script you should change header content-type into
header("Content-type:application/pdf");

Related

How to make pdf of html page of invoice? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Create a PDF file with PHP
I have created invoice generator using javascript. well I am able to work on it. Now what I have to do is I have to generate the data in the pdf which are available in the invoice. I tried some but none work out. So If there is anyone who can help me out?
Thanx in advance
I have used "webkit html to pdf" (wkhtmltopdf) several times.
It worked well for me, although working with page breaks is a bit of an hassle.
PDF cannot be generated at the client side (I mean with Javascript). You will need to process the invoice data at the server side using a PDF library and write to a URL location, so that it can be downloaded or opened in a browser.
TCPDF is a good tool to generate PDF with PHP. See this link.
Also see this question.

how to take print out of a page in pdf format using php? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Convert HTML + CSS to PDF with PHP?
Which is the best PDF library for PHP?
I am trying to take the print out of a web page in pdf format.
How can this be done?
Take a look at http://www.php.net/manual/en/book.pdf.php or http://www.fpdf.org/
You could use a free save to pdf tool
http://www.dopdf.com/
If you then want to share this with othe people on your website then upload the file and link to it via href
download pdf
You need to use pdf generator library in your php file
Download it from http://sourceforge.net/projects/tcpdf/files/
See README.txt for installation instructions.
You can use one of these:
FPDF
TCPDF
DOMPDF

Converting HTML to an Image [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicates:
Convert URL to screenshot (script).
PHP: How to capture browser window screen with php?
I have a URL and I want to convert that webpage screenshot to an image. Please let me know if we can do this using php or some other tools that can be used with PHP/Linux.
This isn't the best solution, but you could convert the HTML page to a PDF, then use imagemagick to convert the pdf to a jpeg using this command exec("convert sample.pdf sample.jpeg"). To convert HTML to pdf, see this question.
Convert HTML + CSS to PDF with PHP?
The shutter screenshot tool is able to do that.
It's in the menu: File -> New -> Web
Can be used with Linux and PHP on the same system. See the manpage for commandline options to be invoked from PHP.

Easy way to generate excel file for report with php [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Alternative for PHP_excel
i need a simple php library for generating excel file like PHPEXCEL library. i like PHPEXCEL library but it is heavy weight.
i need to generate my report data in excel that also display as html table. i need to convert htnl table data to excel without css.
i need to write in every cell.
How about using CSV files? Excel can open them.

How to create a PDF file with PHP? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicates:
Convert HTML + CSS to PDF with PHP?
I am working with my new project. I want to generate a new PDF file with the help of PHP code.
How can I do this? Do you any have any ideas?
You can try free libraries like fPdf
FPDF is a PHP class which allows to
generate PDF files with pure PHP, that
is to say without using the PDFlib
library. F from FPDF stands for Free:
you may use it for any kind of usage
and modify it to suit your needs.
Look into Zend_PDF from Zend Framework - it allows you to create/manipulate PDFs.
Use Zend_PDF I guess.
Check the documentation here:
http://framework.zend.com/manual/en/zend.pdf.html
It's the best PDF generator for PHP IMO.

Categories