Creating interactive reports in PDF - apache-flex

I want to create reports that can be drilled down by the readers - but the reports have to be PDF. I have two options:
Link from the PDF to an online report tool
Make the reports themselves interactive
I like #2...
I believe I can do this with Adobe AIR (Flex, Flash + Adobe Reader 9 or higher).
There are tools that can create PDF documents programatically (AIR?, AlivePDF)
There are frameworks in Adboe that are ideal for reports and charts (Flex)
And PDF documents can contain flash content (Adobe Reader 9+)
My questions are:
If I have an interactive Flash component in a PDF document and I go to print, what will print? Will the current view of he Flash print?
If I want to drill down, all the data has to be in the PDF document (it has to be stand alone). This is fine... but how to do I put the data in the PDF programatically? Is this done with Flex and AlivePDF?
I saw an online sample of an interactive charting report in a PDF document, but now I can't find it. :( I would love to find something again if you know of one.
I feel that I may have all the pieces, but not understanding correctly how they all go together. Any ideas?

Answer to question 3: Currently AlivePDF does not allow you to embed Flash content into a generated PDF. The generated PDFs can include text, images, simple graphics, and certain non-visual features such as bookmarks.

PDF's have JavaScript as a native control language now. With it, you can embed "links" that jump to other pages, etc.
Theoretically, you can call web services from within a PDF using JS and process the responses, perhaps even dynamically filling page areas.
BUT
PDF's are good for providing a document that looks and prints the same everywhere. They are also good for fill-in forms. They are NOT built for "drill-down" on the client side. Can you check the goals of the project to see why they want dynamic PDF's ? If they want portability (i.e. without a web connection), perhaps you can give them what they want with an AIR application and an XML file.
Cheers

we developed interactive content reports for PDF/flashpaper/etc using flex as a front-end but handle the actual report creation server-side using coldfusion's cfdocument/cfpdf (or Itext if we really need insane levels of placement/control/etc.). basically the user chooses the content & the cf app on the backend lays it out & sends back the report.

Related

Embedding / exporting PowerPoint presentations to Plone web site

What are my options to embed private PowerPoint presentations on Plone site
Presentations would be behind Plone log-in
Integrate some sort of presentation viewer which can input PPT presentations
Preferably have own content type for the presentations where one could include necessary Javascript and other components needed to integrate the viewer
Presentations would be viewable directly in a browser (Flash, Javascript, IFRAME any solution accetable as long as it is cross-platform)
File converter (thru PDF?) or external service (slideshare.com) can be used, as long as data stays private
In the worst case is to have MS Office scripting which exports presentations as PNGs, but still one would need the viewer library.
I just created a product called collective.documentviewer that is able to convert these into a viewable format in plone.
http://pypi.python.org/pypi/collective.documentviewer/1.3a1
Can convert word, powerpoint, excel, maybe others. Uses the document cloud software http://www.documentcloud.org/home.
Worst case: You can "save as" many jpeg-s or png-s by selection file-save as. No scripts needed for this.
This won't be too easy, but you could use LibreOffice to convert presentations to Flash-animations and provide JavaScript-controls for those. Of course, this would require LibreOffice to be found on the server. Unoconv may provide helpful examples for how to use LibreOffice's Python-bindings.
I've not looked into this closely, but per http://blog.slideshare.net/2007/11/05/the-wait-of-over-introducing-private-sharing-of-slideshows-on-slideshare/, it does appear that slideshare.net supports private slideshows, which apparently can be embedded in a private page. So this might be a simple approach that outsources the hard parts while retaining privacy.

Building a bespoke PDF brochure via web form or CMS

I'd like to set up a CMS that allows clients to generate a PDF brochure from a series of text inputs and text areas (rich text editor). Clients would fill out text inputs and then select (via a check box) which contents should appear in the exported PDF. This would then stitch together a PDF brochure containing pages only applicable to the options chosen by the client.
All the content is in a CMS with web pages and pdfs built on the fly as per the client's choices. A change in the content is then reflected immediately in the published docs meaning no redundant, out of date pdfs and the benefit of all the tools within the CMS (workflow, publishing dates, security, etc).
Does anyone know of any tools that do this?
Appreciate any help.
well your question require a lot of work to be done. I had similar requirement and what i have done i can brief here. I created multiple views which lets me select their columns and i have used my own rules for differentiating columns from test like {view.columnname}. when your save all information i have used itextsharp for pdf generation.
There is plenty of information on itextsharp.
You might be able to do this with design tools and reporting software, plugged into your CMS of choice. For example, you could use Wordpress, and then design your PDF output using iReport, and run it with Jasper. You'd have to work on the bit to translate user inputs to a query passed to the report, but that shouldn't be too much work.
One issue is that, regardless of the work you put into the design, when you attempt to share it, it wont look like a brochure at all, only sequential single page PDFs. As an alternative I found a website where you can upload or design your brochure, it can then be downloaded and shared as a flippable, digital brochure. If you are interested check out https://simplebooklet.com/learn/animated-tri-folds.php

ASP.NET website, server-side DOCX to PDF conversion

I've been having a heckuva time with this problem, and there seems to be a lot of noise out there in search engines in getting to the bottom of it, so forgive me if I've missed a silver bullet out there.
The base need is that I have to generate a PDF document that has both static and dynamic elements. I started to do this by having a PDF template with all the static content, and then I wanted to inject various dynamic elements into it. The problem is that PDFs are not meant to be manipulated that way, and depending on the size of the dynamic text I put in there, might overflow text on other pages. I was using iTextSharp but can't get past this problem.
A possible fallback is to generate a DOCX, which I've done before, and then convert it into a PDF on the backend. The only libraries I've found to do this are paid apps (like Aspose). There are examples out there that convert to PDF without these libraries, but they seem to require a client-side application. I'm doing this via IIS.
To make a long story longer...are there free libraries that will convert a DOCX file to a PDF server-side without launching client applications to do so?
There are a few choices here:
build a COM interop class that will perform read and 'Save As' functions on your .docx. The MSDN link you gave doesn't require to be run client-side, but rather have the Office assemblies in the GAC or in your ASP.NET's bin directory.
buy a third party component to do the work for you. Here's just one example with no guarantees.
I'm not familiar with any good free ones, but we used Aspose.Words to achieve something similar to what you describe. We keep Word templates with static text and mail-merge fields. The templates can be regular Word documents, they don't have to be .dot templates. Mail-merge fields can be either single fields or repeatable data in tables so you can easily generate pretty complex documents without doing dynamic document editing. (Which is always an option)
Using Aspose for this was so friction free that I would suggest using Aspose unless the cost (which is significant) is a show-stopper. The support is also good which is always an added bonus.
There are always some caveats...
I would have liked more control over the PDF compatability of the generated PDFs. We had some issues with older clients reading the generated PDFs.
Mail-merge is not fun. Complex mail-merge expressions was time consuming to get right.
I just found very simple solution to convert any files from command-line using LibreOffice:
soffice.exe --headless --convert-to pdf file.xls
(google for the rest)

HTML document to PDF?

I've got an ASP.NET web page that is a dynamically generated report. For business reasons, this exact report needs to be produced as a PDF. What's the best way to do this? Setting the selected printer to Adobe PDF is not an option.
Learn to programmatically create PDFs from scratch? Is there a way to render it in some browser control, then save the ouput?
wkhtmltopdf - I compiled it in Windows and it works great. It uses WebKit (Safari, Chrome, etc.) to render an HTML page into PDF, and it is free!
If the report is a grid (probably is), this blog post using iTextSharp may help. iTextSharp is good and the most complete PDF API for C# that I've seen.
I don't know if ABCpdf .NET is free but I've heard good things about it. I think it can render HTML files to PDF's directly.
http://www.websupergoo.com/abcpdf-5.htm
I've used PDFsharp (assuming you're using C# in conjunction with ASP) and it works well. It doesn't render HTML as far as I know though.
http://pdfsharp.com/PDFsharp/
Last year, I did a project with PDFs, and I just learned the PDF format, for which I am very glad.
The PDF specification is available freely, and PDF is quite accessible and easy to understand as a programmer. A PDF is a plain-text document, optionally compressed. Each page is a Cartesian plane, on which you draw geometric shapes one-by-one. It is low level and tailor-made for software-generation. Obviously there are advanced things like glyphs and things, but like any well-architected technology, you can stick to the abstraction layers if you want.
Whether to do direct PDF depends on the complexity of your documents. For basic stuff with like simple graphics, text, and images (for example, an invoice is a good candidate), then I would just write PDF directly. You'll get good experience and you will be in full control.
For more complicated things like tables and pie graphs (for which PDF is too low-level to write directly), then I would look into a library or toolkit of some kind.
Have you looked at SQL Server Reporting Services? If you are using MSSQL 2005/2008 then you probably already have reporting services and you just need to configure it. You can host your reports there and in just a few lines of code get the report as a PDF file.
//create the web request for the report based on a URL that will define export
//format, parameter values, etc.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(reportUrl);
//send creditials if necessary
request.Credentials = new NetworkCredential(userName, password);
//response will contain the PDF file as a stream
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Here is a link that might help as well
You didn't mention you if you are looking for an open source solution or a $$ one?
But here's an open source converter: http://sourceforge.net/projects/itextsharp/
which is fairly decent.

Any way to build Google Docs like viewer for PDF files?

Does anyone think it is possible to build a Google Docs style PDF document viewer, which will convert a document to a format that doesn't require Adobe Reader on the client machine?
If so, any references to point to? Either a place that had done it, or an explanation of how to do it.
I've done a lot of research regarding this matter and I hope I can help.
Good old Macromedia used to market Flash Paper, which was supposed to be a PDF Adobe Reader killer as it allowed any webmaster to embed and display PDF docs online using Flash. But that was before they sold out to Adobe and Flash Paper was soon put on a shelf and forgotten in favor of Adobe's priorities.
However, Today there are a so many ground-breaking alternatives...
As a user has mentioned above you can use Scribd.com (the wanna-be YouTube for documents). But they're not the only service (and certainly not the ones most ahead of the curve).
Here are my two favorites:
Issuu (http://www.issuu.com)
Mygazines (http://www.mygazines.com/)
I enjoy Mygazines's flash user interface the most (it's also faster) but it costs $99. It's pretty impressive. Depending on what you want to do that price tag can be worth it.
Issuu however, has won me over recently with their Smartlook Platform: http://issuu.com/smartlook
Here's a sample of Smartlook setup on a website:
http://www.ismartlook.com/
Plus it's completely free, which is nice.
A third alternative, which I've considered using myself is this free and open source code made by this guy named samurajdata. He calls it psview (PostScript Viewer). Anyone can download the source code and see it in action here:
http://view.samurajdata.se/
The converted PDFs losses quality as it converts to image fie, but it's fast and easy to setup.
I hope this helps!
You may try Doconut.com looks pretty same as Google Docs viewer. It is available for asp.net 4.0, apart from PDF it can also show all office formats, tiff, dwg, psd etc.. However it is a paid library.
If I understand you correctly you only want to view these files and not edit them.
Google already makes a best effort at providing PDF files found in it's search results as HTML. This doesn't always work. You can try it out by setting up a gmail account, mailing all your PDF files to it, and then using all the "View attachment as HTML" links in the messages.
Your other options are to take the source material and make it into HTML as say LaTeX2HTML does for LaTeX documents, or to convert the PDF into one of: a raster image (tiff, DjVu, etc), or a vector image (PostScript, SVG, SWF).
If the input to this process starts with the PDF files, you have very limited options, especially if the contents of the PDFs are just raster images (say scanned pages).
Personally I'd advocate for creating the PDFs from their source and trying to use Flash Paper to create an SWF out of them too as Flash Paper will pretend to be a printer. Because some 98% of browsers have Flash 9 or greater.
Have you seen Scribd?
You can just use the Google Docs Viewer which also supports PDF documents. It allows you to embed it in your web page and point to the URL where the PDF is located (which doesn't have to be on the Google servers).
Example:
http://docs.google.com/viewer?embedded=true&url=http%3A%2F%2Fwww.domain.com%2Fdocument.pdf
There is the Internet Archive BookReader available. It's a nice book viewer implemented in javascript (jQuery), so the client doesn't need a PDF reader nor Flash. Though it needs images for the book pages, you can easily connect it to your own image server, so you may try to convert a PDF to images via ASP.NET (or any other tool like XPDF). I found that this is simpler to implement than actually implementing an images viewer.
Also, it seems to support search highlighting (try it here), but I haven't investigated exactly which metadata are needed and in what format.
The last release file contains a simple example on how to use it. More details and examples can be found in the first link.
Try converting them from PDF to TIFF. Tiff supports multiple pages and is widely supported.
If formatting isn't that important, and your PDFs are structured right (ie actually contain text, not images of text), an alternate could be to convert to HTML. The tools from Aspose are pretty good.
I'm wondering why you would want to do that. PDF is such a general and widely supported format that if you try to avoid it you're limited to:
A more obscure or less well supported format (dvi, svg until it gets better support)
Converting to text/HTML like Google does with less than perfect results
Converting to an image format like TIFF which bumps up file sizes and removes all the niceties of PDF like real, selectable text and hyperlinks
If you don't want your users to have to install Adobe Reader (understandable), there are many free lightweight PDF viewers available (Foxit Reader for example), I'm sure many of these have browser embedding capabilities.
Am I missing something here? Google Docs DOES support PDF. Simply upload the PDF file.
Some other alternatives depending upon what you're looking to do:
RAD PDF - ASP.NET component for displaying PDF documents, forms, etc. Also allows PDF searching, bookmarks, text selection, and basic editing.
Atalasoft - ASP.NET component for image viewing, but also allows PDF use as an image. Doesn't support any PDF features beyond simple viewing.

Resources