Slashdot Mirror


ActivePDF-like Reports w/ Apache?

Martin71a asks: "I have recently been tasked with managing our website. I come from a mainframe and VB background and have a team of 3 people to work with. Our manager is having us switch from IIS to an Apache web server later this year. In the more immediate future, I need a solution to distribute print to our customers through our website. Previously, we had developed our reports using HTML, but we need more professional looking reports with more basic printing functionality, such as paging, built in. We have been testing ActivePDF in which we develop the reports in Crystal then use ActivePDF to send [those reports] to a virtual PDF printer, which allows the user to view them. We like the solution because it doesn't require our customer to download anything, other than a PDF viewer. We've also experimented with Crystal Enterprise, although it was an older version that required either a Java plug-in, or ActiveX download. My concern is that AcitvePDF does not appear to be supported for an Apache server. Does any know of a similar solution that would be appropriate for an Apache server?"

25 of 63 comments (clear)

  1. PHP + PDF generation by DamienMcKenna · · Score: 4, Informative

    Use PHP for your report generation and use its PDFlib support to output the final result to a PDF file, which you then shuffle off to the user. Et voila!

    Damien

    1. Re:PHP + PDF generation by BoomerSooner · · Score: 4, Informative

      My problem is finding a server that will populate the pre-drawn PDF form fields like ActivePDF. Until I can just Call objPDF.SetFormField("fieldName", value, 0) like in ActivePDF I'm stuck as well.

      Anyone know something that does that and flattens remaining form fields (to limit size)?

    2. Re:PHP + PDF generation by crisco · · Score: 2, Informative

      PHP's PDF Forms support seems centered around Adobe's FDF toolkit. This article and the PHP manual should be enough to get you started, if only for the right search terminology to get you closer to your application.

      --

      Bleh!

    3. Re:PHP + PDF generation by TaQ · · Score: 2, Informative

      Please check http://phpreports.sf.net.
      Soon delivering PDFs and all the output formats you guys can imagine. ;-)

  2. PHP + FPDF by octover · · Score: 4, Informative

    http://www.fpdf.org/ it is a completely contained PDF system for PHP. I haven't used it a lot but I've heard it is a lot more sane to use than PDF Lib plus it doesn't require you to compile in the library.

    1. Re:PHP + FPDF by tweder · · Score: 5, Informative

      I have used about every PDF library for PHP under the sun, so here's my $0.02.

      pdflib - SUCKS, the API is a pain in the ass. I liken it to doing your own dental work -- in the dark. You can circumvent this a little using the pc4p wrapper, but it's fickle.

      fpdf - It's pretty good, although it doesn't natively support any sane ways of dealing with text in tables - I was trying to use it to generate PDF invoices and quotations. It would barf and break columns when my text should wrap to the next line. The only way around this would be writing custom extensions to the class.

      r&os - This is what I really recommend using. Like fpdf, it doesn't require any additional libraries to be installed - everything runs within PHP itself. The documentation is pretty good and I've really enjoyed using it.

    2. Re:PHP + FPDF by Phil+John · · Score: 3, Informative

      I agree with the r&os idea, however, if you are going to be producing bajilions of pdf's dynamically you're going to want a beefy server. If, on the other hand, you are simply delivering xxx copies of the same PDF you can use PHP's output buffering and cache the whole thing:

      ob_start();
      -do pdf creation and output here-
      $pdfcontents=ob_get_contents();
      ob_end_clean();
      $fp=fopen("/path/to/pdf/file.pdf","w[b]");
      fwrite($pdfcontents);
      fclose($fp);

      You only need the b in the fopen if you are running php/apache on windows as a file needs to be explicitly binary on that platform.

      --
      I am NaN
  3. try this by farmy4700 · · Score: 3, Informative

    You might look into Stellent, we started using it here at my office and it works pretty good.

    --
    The phone is ringing, I cannot linger, watch out butt here comes my finger.
  4. PDF's in Apache? No problem by toygeek · · Score: 3, Informative

    There are tons of Perl, PHP, and other packages out there for creating PDF files from some sort of input. I found everything you'd need here at http://sourceforge.net/search/. Just do a search for "PDF" like I did. I *know* you'll find something there. Sourceforge.net and google.com are your friends! Hope this helps!

  5. Same Problem by justanyone · · Score: 4, Informative


    I work at a large bank. We had reports we needed to produce in PDF format with nice graphics. We tried many solutions including print-to-HTML from Excel, Crystal Reports, Ephiphany, and Insightful's S-Plus.

    The best solution for a compact format was a scripted solution (VBA / COM) that prints XLS, DOC, PPT, etc. to a file with thus creating a postscript file, then using ghostscript to convert .ps to .pdf, then moving the files to a Solaris Apache webserver.

    S-Plus required lots of programming and display was not compact enough. Ephiphany likewise. Crystal has a HUGE HUGE IMMENSE VAST WAY-BIG Learning curve and still didn't do what we wanted. Alas.

    For all it's worth.
    -- Kevin J. Rice, justanyone.com

    1. Re:Same Problem by justanyone · · Score: 2, Informative

      Sorry to give the idea that Crystal is this memorization-intensive product. Not the case. I just found it to be quite non-intuitive, and limited from doing exactly what we wanted it to do.

      One of my teammates who I believed to be rather bright (but didn't work with her that long) was constantly harping on how it didn't work the way she expected it to, either.

      One thing she worked for a week on was a gui control that didn't look like it could be changed. Turns out Crystal had a 1 YES ONE pixel down-arrow for a dropdown box to select other various values. Yuck.

      We were trying to use it for some very complex reporting, that we ended up using about 400+ sql queries for in just one report (of about 20 in the project). The learning curve I'm mentioning was us trying to figure out how to put multiple reports together easily (not happening).

      It seems that for the simple stuff, Crystal can do well. The complex stuff (combinations of anything Crystal hasn't anticipated us doing) has a very sharp curve and is more than slightly frustrating. My learning curve reference meant getting to the end point requiring a lot of trial and error instead of reference material, intuitive interface, or quick-turnaround support.

      -- Kevin

  6. Apache FOP by mapMonkey · · Score: 5, Informative

    Take a look at Apache FOP, although your starting documents would have to be XML. The pros: buzzword compliant, and the project has a name similar to an old Soundgarden song!!

  7. PDF, XML, Java by fredrikr · · Score: 3, Informative
    Take a look at Big Faceless Report Generator. The Big Faceless Report Generator is a Java component for converting XML to PDF documents. Using JSP, ASP or similar technology, you can now create dynamic PDF reports as quickly and easily as HTML.
    Built on our popular Java PDF library, the Report Writer adds functionality including:
    • HTML-style Tables - auto-sized nested tables with full control over padding, margins and borders
    • Use cascading CSS2 stylesheets to control look and feel
    • Create inline graphs and charts with XML, direct from the database
    • Includes a servlet and a servlet filter for simple generation of PDF's from XML or JSP pages.
    • Auto pagination of content with page headers and footers
    • Familiar HTML syntax - <a>, <ul>, <p>, <table>, <td> and so on - simpler and faster than FOP
    • All the features of our PDF library - Unicode support, Encryption, TrueType fonts, Barcodes and more
  8. I will second the recommendation for FOP by janic · · Score: 2, Informative

    We are also using FOP.

    You can get thouroughly anal about positioning, attributes, etc.

    We are using it to generate Product spec sheets, provide a more "polished" look to invoices, order status inquiries... all sorts of stuff.

    The really nice thing is that because it's java, you can start messing with it now, then have a pretty simple conversion when you upgrade to apache.

    John

  9. Re:xml(dot)apache(dot)org by rodentia · · Score: 2, Informative

    I build all the reports for a market-leading commercial product in FOP and have been doing so since v0.20.3. All FO properties are not completely supported in current FOP, but it is not *buggy*. I have had to do a little code to help it around keeps (only supported on fo:table-row) but that's why they call it eXtensible.

    Performance is very robust. We build 400 page documents and batch runs of short reports customized for thousands of data points.

    --
    illegitimii non ingravare
  10. FPDF by ben_degonzague · · Score: 4, Informative

    I've been using this for the past year and its worked great. I use it with apache, php and mysql. A department has begun using it for their reports and is very happy.

    http://www.fpdf.org/

  11. Apache FOP + IText by adamshelley · · Score: 1, Informative

    Apache FOP and IText are great solutions.

  12. PHP+pdflatex by marind · · Score: 3, Informative

    I use a combination of PHP and pdflatex for report generation. I don't think there is a solution that gets you more "professional looking" output.

  13. CSS by TheTomcat · · Score: 4, Informative

    Have you evaluated CSS for the output?

    It's possible to switch "media" (from screen to print), and do absolute layout, without a second library.

    No vector art, but for layout, it can be done.

    S

  14. Another solution: Excel/Openoffice Calc by swillden · · Score: 2, Informative

    Another option that makes for flexible and interactive reports is to output a spreadsheet document rather than a PDF, complete with calculated fields and modifiable fields that allow the user to experiment with options (where appropriate). If you format them well, spreadsheets can print very nicely.

    You can generate documents in Microsoft Excel format using the Jakarta POI HSSF API, and of course OpenOffice Calc files are just XML documents zipped up with a manifest, easy to produce with just about any toolset.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  15. Reportman.sourceforge.net by Anonymous Coward · · Score: 2, Informative

    Reportman.sourceforge.net

    I use this in production at the hospital where I work. The project is mature, full featured, and free. It can work basicly as a Free replcement for Crystal.

  16. iText java libraries worked great by raygundan · · Score: 2, Informative

    I did something similar with the iText libraries for java. Generate PDF's to your heart's content-- place text and images into the page, flatten it, and *pop* out comes your document.

  17. mod_python and by Lomby · · Score: 3, Informative

    If I understand your requirements correctly, you may want to investigate the use of Python (in the form of Apache's mod_python) along with the ReportLab tools.
    You can find a nice article detailing its usage here

  18. You could write your own by Tom7 · · Score: 2, Informative

    The PDF spec is open, and fairly simple. I wrote my own PDF output code in less than a week, with the benefit that the PDFs were much smaller than those generated by general-purpose converters.

  19. Python + Reportlab by Dr.+Smeegee · · Score: 2, Informative
    One could try ReportLab, a Python module that allows one to create nice-looking pdf output from a python script. If you have some programming experience python should be fairly easy to pick up IMHO.

    Your apache install probably already has python enabled for cgi. You might consider modpython, which adds the interpreter in for quicker load times.

    Share and Enjoy!