Link to home
Start Free TrialLog in
Avatar of Marthaj
MarthajFlag for United States of America

asked on

Programmatically creating PDFs

I am seeking advice and suggestions concerning creating PDF documents. I researched many sites but thought I would ask you folks about it.
I will be extracting data from MS SQL Server - 2014 database from many tables to create/populate the PDF document which will be on our web server.
Basically, the user will click a button and code will generate the PDF file.
I can find my way around Java but client doesn't not want to use C or Net.
I use localhost - Win 10 - and mainly PHP - v5.6.25 (client version - no plans to upgrade - their web server is Linux) with Wampserver and Apache 2.4.23.
I have looked at Apache PDFBox - got confused about it. I also took a long peek at iText. I did request a quote but they have never responded to me.
The creation of the PDF document must be created programmatically.
Any thoughts - suggestions - advice would be appreciated.
thank you.
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,

Probably the easiest way is to use one of the PHP PDF Libraries. The general idea is that you generate a layout using HTML (populated with your DB data / maybe using HTML Tables etc) and then you export / save that HTML content directly to PDF. This is way easier than manually trying to place items on a PDF canvas using co-ordinates.

A couple spring to mind - DomPDF, TcPdf
Have you looked at the ssrs option if these are reports that are regularly generated?
Agree with Chris, php and Java include libtaries to create PDFs.
Are you pulling data usin jdbc or odbc from php?
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marthaj

ASKER

Wow !! Great resources to review and suggestions. I thank all of you folks. I am going to research the suggestions for the next two days and report back then with results. And then close out my question. Once again, thank you folks.
Stay tune for part 2 !!
Avatar of Marthaj

ASKER

Thank you all for responding - very helpful. I have settled on using FPDF - which seems to be very good.