Dynamic PDF features - pdf

I've been asked to write a program which generates reports in the form of PDF files. There are two main dynamic features which have been asked for, which I'm not sure are even possible:
1) The report contains a table with several columns. Users should be able to click on the column header to sort the table rows by the values in that column.
I've never seen a PDF file that users can click on to re-sort table results, but I'm told that this is possible.
2) The report should have a dropdown box which users can select to toggle which rows of the table are displayed or hidden.
I'm fairly sure that this isn't possible to do in a PDF file, though I've been told otherwise.
So my question is, which of these things are even possible, and what library should I use for generating PDF files? (The library can be in any programming language.)

Don't use PDF as a substitute for html/CSS/JavaScript/etc. PDF is best when it's used as an immutable document format, not as a poor man's web page. Sure, you can put your foot in a box and call it a shoe, but it's really just a box.

Have a look at
Sorting tables in dynamic PDF on the Adobe Developer Connection website.
You can also download a ready-to-study sample PDF with that feature built in.

I would look at Acrobat. There is a JavaScript implementation for it.
http://www.adobe.com/devnet/acrobat/javascript.html

For Java there are the following tools / libraries that are very good and stable:
JasperReports - you design your report in a graphical designer and then populate it with data programatically.
The other is iText. It works on the lower lavel (actualy JasperReports is built on top of it for the PDF part), so it might support the requested sorting options.

Yes, all of those dynamic features are possible with an XFA PDF form (created in LiveCycle Designer) and scripting ( JavaScript). We have examples of sorting rows in tables and hiding and showing sub-forms at http://www.pdfscripting.com , but you must be a member to access them (not free). You may be able to find free sample files doing an internet search for XFA PDFs or LiveCycle Designer PDFs- not sure but it is possible at any rate.
Dimitri
WindJack Solutions
http://www.windjack.com

Related

How do I make an offline front end for over 50 pdf documents?

I have over 50 training documents (PDFs) at work. I would like to create a 'front end' that a user can 'run', which would provide a convenient access portal to all the PDFs available.
This needs to be able to be dropped on to my work colleagues laptops (they don't have Office on there but do have Acrobat). And it also needs to be able to be edited/added to as more PDF training materials are created.
I know that I could create a Word document that contained links to the PDFs, then convert that to a PDF itself. Or I could create an offline web page that linked to them, but I wondered if there was a better solution?
Like a way to compile an executable that would bring up a front-end and contain all the PDF files? I've seen similar things for car-repair manuals years ago, where you insert a CD, run an executable and get a nice front-end that essentially just allows you to browse PDF manuals.
Anyone know if this is possible and, if so, how to go about it?
Or does anyone know another viable solution to this?
Thanks
There are indeed various possibilities, depending on what the users have (Acrobat or Reader), and how you can control the distribution.
a) You create a front end PDF document which has links or buttons to open the subsequent documents residing in a subfolder or on the same level as the front end document.
b) You create a front end PDF document into which you embed the subsequent documents as Data Objects. You have buttons which export/open the embedded documents in a different window.
c) You create a front end PDF document into which you embed the subsequent documents as File Attachments (part of the Comments tools). You have buttons which open the embedded documents.
d) You would create a PDF Portfolio in Acrobat, containing the subsequent documents, and maybe provide an overview page from which you can open the documents.
Of these three approaches, a) would run in the biggest number of supporting PDF viewers, in particular also mobile devices. The downside is that you have the subsequent documents around loosely, and your users may mess up with them.
The most elegant (and app-like) approach would be b). However, it requires smart PDF viewers, and you would have to make sure that the user's viewer is not too dumb.
Approach c) would be a compromise between integrity and portability, and approach d) would be quite nice for distributing, but does require a PDF viewer by Adobe, and may most likely not work in any mobile viewer.

writing text to a pdf file

I have several pdf files (about 20) and very month or so I need to change spme fields with new data. This is a very time consuming task and would like to know if there is an easy way via some sort of application where users can change the name of the variables that have to be stored into the different pdf files. This would be an enormous time saver. thanks for any help.
there are lots of solutions for this.. if you are willing to write some code things can get really interesting.
a simple solution would be to create a template pdf file with placeholder fields (like #{name}, #{age} etc.,), when a new pdf needs to be created using new values you can simple use itest to edit the pdf & replace the placeholders with actual values.
you can also use jasperreports for this but it would be an overkill for just 20 odd documents.
if you are interested in a sample program i'd be happy to provide you one.
If you have form fields in the PDF file then you may use Aspose.Pdf (.NET or Java version) to fill data into those fields programmatically. You can either fill the fields using individual values or import the data from the XML/FDF/XFDF files etc. You can take a template PDF and save the output PDF files with different values. Please see if this might help in your scenario.
Disclosure: I work as developer evangelist at Aspose.

I need a (preferably free) PDF/Word generator .Net component that can work from a document template

I'm looking for a .Net component that will allow me to generate Word and/or PDF documents.
This must work on the server without MS Office installation. Preferably free. Also, it needs to be able to generate the documents based on an existing template of some sort i.e. I don't want to generate the whole document from scratch but allow a number of different templates that all have similar content that comes from elsewhere (e.g. database, XML files etc).
My initial investigations have turned up iTextSharp (but not sure if it can work from templates).
Any help that can expedite my investigation time will be much appreciated.
Thanks
I use ActivePDF at work with .NET - give it some HTML and it will output a pdf doc. However it isn't free - but we did look at a few other ways and this was 1
http://pdfcrowd.com/html-to-pdf-api/
It doesn't do word documents but converts html (your template) to pdf

Generating PDF documents from LISP

I want to generate a technical report from lisp (AllegroCL in my case) and I studied various packages/project to help me do this.
Requirements:
Need to generate a PDF
May create an intermediate format like RTF, Restructured TEXT, HTML, Word DOC or Latex
Need to be flexible to be able to add content throughout my application
Need to handle Multi-Page, Headers, Footers, Tables, inclusion of Images.
Possibilities:
cl-pdf and cl-typesetting: I checked this one out and it works for now, but is there a better alternative?
Some Latex generator, but ???
Question:
Do you know alternatives to easily generate (PDF) reports from lisp. What is the best workflow to go for?
we are using cl-pdf and cl-typesetting for the last 3 years and it has numerous issues... (like its confusion around encodings, or silently not rendering things that don't fit, or...) so, i don't recommend new development based on them.
currently we are in the process of moving all our export mechanisms to open document format. openoffice is all happy with it, and there's a plugin for ms office, too.
there's .fodt, the so called flat open document text format, which is a mere xml file describing a document. generating it is as easy as generating xml files.
you can also make parts of your document read-only with a password (insert a section and mark it read-only and protected by a password. when generating the xml, you can generate random hashes as password...).

Generate PDF from structured data

I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form.
Currently our graphic designer creates these PDF files in Photoshop manually after getting the content as a MS Word Document. But usually, there are more than 20 revisions of the content; small changes here and there, spelling corrections, etc.
The 2 disadvantages are:
1) The graphic designer's time is unnecessarily occupied. The first version is the only one he/she should have to work on.
2) The PDF file becomes the document which now has the final revised content, and the initial content is out of sync with it. So if the initial content needs to be somewhere else (like on a website), we need to recreate it from the PDF file.
Generating the PDF file will help me solve both these problems. Perhaps some way in which the graphic designer creates a "Template" and then puts in tags/holders and maps these tags/holders to the relevant data.
Thanks :-)
There are some tools out there for doing this. XSL-FO is useful. Here is a tutorial for creating a pdf from xml (or xhtml) with cocoon. Also see Apache FOP.
You could format your SQL data as XML and still use the same templates this way.
I use the ReportLab python library for this. It could perhaps solve your problem, but you will need to do some work...
In the past I have written scripts that spit out LaTeX then used texi2pdf to solve this kind of problem.
Take a look at iReport and JasperReports at http://jasperforge.org.
iReport lets you design reports, and then you can either programatically fill it with the JasperReports library (Java), or just use iReport to manually create the report.
I have only used it for tabular data, but I don't think there would be any problem for other types of documents.
You could create a form and populate the entries programmatically using a pdf library like iText (Java).
You could look at doing the workflow in PostScript which is plain text that you can easily compose from fragments. Then you can use any free tool to convert to PDF.
Take a look at Prince XML. This tool allows to generate PDF based on XML or HTML and CSS.
A possible way is to use a template engine, like FreeMarker or StringTemplate: these are often used to generate HTML, but they are flexible enough to output any format, actually.
The problem is to make a PDF template, I suppose. Perhaps you can take a sample output and edit it to replace data with placeholders to be filled by the template engine. Might not be trivial!
Sounds like a job that SQL Server Reporting Services can handle quite easily.
Reporting Services allows you to query the data, define the layout, and export to PDF without any intervention. The PDF output can be distributed via email, stored on a file share, and accessed via a page on the report server.
It can handle XML data sources too.
Another approach to generating a PDF file from data is to use prawn, which is based on ruby. I was very pleasantly surprised by how much functionality is included in prawn. It may take some investment up front but this approach will give you a lot of flexibility.
You can combine CSStoXSLFO with XEP from RenderX for high quality output. With this solution you can merge XML data into an XHTML template, which is decorated with CSS. It can also generate charts with the fantastic JFreeChart library. CSS3 page media features are supported.