php and reports related informations needed

Posted on 2011-05-12
Medium Priority
Last Modified: 2012-06-27

Is there any printing methods available in php which can print a page in a given paper like A4 etc.

currently im using window.print option with javascript.

also which methods do you use to create reports, invoices etc...?


Question by:3xtr3m3d
  • 2

Accepted Solution

atipico earned 1000 total points
ID: 35748958
You won't find any native methods for printing on PHP, because PHP won't natively render screen-related information. It renders and outputs HTML data to the browser -- that's the reason it is a Pre-HTML-Processor.

There are, however, external libraries that can perform actions such as creating PDF files, etc. There might be a printing library, but I'm not sure
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 35749031
To expand a little bit on what @atipico said, PHP runs on the server so it can't be directly used to print on your computer.  You can use methods that run in your browser like javascript or the browser print functions like you are doing.  If it is your website, I also recommend that you look into creating PDFs.  Web pages and browsers are not oriented to paper pages.  It can be difficult to get them to print items from the screen the way you want.

Author Comment

ID: 35749270
Thanks for the info.  is there ways that can use instead of pdf?
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35749309
Your question is a little too general.  You can print from your browser but that only works well if you have simple pages that don't require exact positioning.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question