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.
Related
This question already has answers here:
Reading an Excel file in PHP [closed]
(8 answers)
Closed 6 years ago.
I am wondering if I can get some advice on folks that might have come across this before.
Basically I have a folder with files a user can add / remove which has an iframe beside it so they can view their PDF's etc.
I cannot get excel (probably ppt either) to open up in chrome or a browser.
I know I can go through google docs, or send files and get it back different format through their api but for security it is not a solution I want to work with.
example I saw in excel:
If I have a fairly loaded excel file, graph, formulas etc., in that file I 'Save As' and convert to htm I can publish option which provides a beautiful htm page with all relative pics, links in a folder. If I can get php to do something similar this would really make my day.
I played with PHPExcel but it usually spits out a mess, sometimes just crashes because of formulas. Unless I just haven't sent the time with PHPExcel to figure this out I don't know what else to do.
You already know the best way use read excel file to php using any library then print the data.
if PHPExcel not working for you please have a look at following
"Reading an Excel file in PHP"
ps. if you are facing problem with PHPExcel kindly post you code in new question, definitely this great developer community will help you resolve that.
This question already has answers here:
Create PDF pages in PHP
(2 answers)
Closed 9 years ago.
If I missed a similar question, I'm truly sorry - I have done what I believe to be quite a bit of digging on this subject and come up empty handed.
Is it possible (or practical) to do one of the following:
1) Use the data from a web form to populate fields in a PDF?
or 2) Simply upload the PDF and allow the user to complete and submit it online?
I don't necessarily have a preference between the two, other than the most practical solution.
mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF, with a number of enhancements.
check it out MPDF1
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Website screenshots using PHP
Can someone tell me how to take a thumbnail off of a web page using php or js without any 'API' support? Otherwise convert HTML to PS and PS to jpeg is also possible.
Thank you.
Try Phantom JS. It can be used to render HTML from the commandline, using various output formats. Creating a thumbnail can be done by setting the zoom factor.
WKHtmlToImage is able to render a webpage using webkit engine. You will have to launch an executable on server-side though.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Filling PDF Forms with PHP
I have been looking and testing this for a couple days now and was wondering if anyone could point me in a different direction. I have a very long job application HTML form (jobapp.html) and a matching PDF (jobpdf.pdf) that have the same field names for all entries in both the HTML form and the PDF. I need to take the user data that is entered in the form and convert it to a PDF. This is what I have gathered so far but don't know if I am on track:
Is pdftk the only viable 3rd party app to accomplish this?
Using pdftk would i take the $_POST data collected for the user and generate a .fdf(user.fdf) then flatten the .fdf on the .pdf(job.pdf). So irregardless of where the fields are located on each document the information on the fdf would populate the pdf by field names?
Try mPDF. It generates PDFs from HTML and CSS. It doesn't understand everything you might want, but for documents with relatively simple formatting it's good.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Website screenshots using PHP
how can i take a screen shot and save it in PHP? I wana take a screen shot a users screen and save it to user's machine when he/she clicks on save button. Is there any way to do this??
You can't do this in PHP.
You could do this using HTML5/Javascript, something like HTML2Canvas does.
Your problem with that would be compatibility with older browsers. So using this would depend on who the website is aimed at.
You have to understand one thing that PHP is a server side script and nothing to do with real time browser needs. You may try JavaScript with some library like jQuery to capture the screenshot. Then you may pass that image via AJAX and there, you can definitely use PHP to save the image into your server directory.
this stackoverflow question may help you.