Why do I, as a developer, have to go through so much trouble developing PDF download options for my clients when everyone in the world can simply hit Ctrl+P and life is good?
The current issue I’m working on is dealing with Google Charts, so I’m not stating that offering PDF downloads in general is relatively difficult. On the contrary, particular cases are more trouble than they seem to be worth.
See also: @media print {}
Update: With a little research, I was able to find a perfectly workable solution. “Just hit Ctrl+P” now sounds like a ridiculous thing to say. Thanks everyone for your input.
If you’re interested to know what I decided to do, I realized that Google Charts are output as SVG markup and I think I should be able to use TCPDF to render them in a PDF document.
3
You dont ‘have to’ do anything. But if you want to ensure the PDF looks exactly the same for each person who downloads it, you need to render it yourself. Otherwise you’re depending on various web browsers & print engines to render the PDF, and the results may not be that great.
And of course, you also cant assume that every device that might access the document is capable of printing or creating a pdf.
5
Web pages are not designed for print, they are designed to be rendered on a screen. As such, there’s no guarantee that it will even fit within the dimensions of a standard paper size. Printing web pages to paper when they are not designed to fit on paper usually results in a mess. Giving your web application the ability to render important pages that a user might want a hard-copy of (such as receipts of banking transactions, or tickets to events) as printer-friendly PDF makes it much easier for people to produce those hard copies.
4
In addition to the other answers, there is the fact that a great many people can’t just hit ctrl-p — for instance, I’m typing this on an iPad and do not have a printer that I can use from it. But I can save a pdf in GoodReader or DropBox and later transfer it to a computer with a printer.
In addition, the user may not want a hard copy so much as a permanent record — if I save something as a pdf, I can name it and store it where I can find it later (even without internet access). If I rely upon you as the company to keep track of it for me, then I’m in trouble when you keep it for X months and I need it X+1 months later (just had this exact problem with a copy of a check, kept online for 120 days, needed it after that. Fortunately, I FIRST needed it within the limit so I made a copy).