I want to generate interactive charts in PDF just like Google charts
but this is for embedding on web page I want to embed interactive chart in PDF. any help?
You specified Java, so I would say iText has some partial support for writing adobe-javascript actions. You must be aware that latest versions of itext uses AGPL license, so you must pay a commercial license if you want to use this in a commercial closed-source application.
Another option is to use Adobe Acrobat SDK, but I am not sure if you will be able to use it from Java.
You may also find this link useful: Acrobat JavaScript Scripting Guide - Adobe
This feature of the PDF specification (I mean embedded javascript) is not commonly used, so it might be a bit difficult to find start-up information and sample code.
Here you will find a few examples of interactive PDFs that use javascript, there is even an example of a flying helicopter in 3D, (it actually moves around while viewing the file).
Related
I'm looking for the best PDF generators for Angular and JAVA. If there's one that can be used in both would be great. The requirements I have on these PDF creators are:
OpenSource
Easy to use
Can be used on Enterprise level
Generate custom PDFs (not just print-outs of what’s on the screen)
So far I have on my list:
iText (discarded)
Apache POI
Aspose (discarded)
PDFBox
PDF Clown (discarded)
In angular if you have data on UI then you can use following libraries which have good provision to export pdf:
"jspdf": "^1.4.1"
"jspdf-autotable": "^2.3.4"
If you need customized reports and have dependency on backend then you can use Jasper Reports which can give more reach appearance.
I want to create a table programatically as like this PDF FCController.pdf.
As you see columns are Date, Name, Category, Amount. And I want to add a datepicker to change the list.
Can I generate a PDF as I said? Is it possible by Itext?
You want to embed a .swf file inside a PDF as a RichMedia annotation as explained in chapter 16 of "iText in Action - Second Edition". The book had two examples that showed you how to do this:
FestivalCalendar1 resulting in festival_calendar1.pdf
FestivalCalendar2 resulting in festival_calendar2.pdf
Although these examples work to some extend, I would urge you not to use this technology. Steve Jobs refused to support Flash on Apple devices and that started the decline of Flash as a technology. Adobe introduced support for Flash as RichMedia in PDF in one of their extensions to ISO-32000-1, but I know from insiders at Adobe that they regretted this. In any case: this functionality is not going to make it into ISO-32000-2 (PDF 2.0), which means that:
no other PDF viewers than Adobe Reader will have any interest in supporting this functionality, and
Adobe may decide to discontinue support for this functionality.
The example you've shared is nice, and it's not impossible to create such a PDF, but you should reconsider: it's not a future-proof solution.
In my application the user can configure their own table layouts to display the data on the screen, by choosing which colums in which order are to be shown. Now I want to give my users the possibility to export these tables to PDF. The tables should fill the page width completely and the columns should adjust their size depending on the content in the table, like e.g. HTML tables do.
Can you recomment a library or toolchain for this?
I checked Apache FOP, but their fo:tables do not support automatic table layout. Creating a Jasper Report dynamically also doesn't seem to fit, because I have to specify the exact column width there. So, does anyone have an idea how to achive this?
Open Source solutions with commercially friendly licenses like Apache or LGPL preferred.
ANSWER: There are no current tools that allow what I hoped for, so I mark this question as resolved.
iText is probably what you are looking for http://itextpdf.com/. Version 2.1.7 is free to use under the GPL lisence, for more info see this question What is latest version of itext that is not AGPL?. It will work for you need, I would recommend using their code samples on their web page. Most are applicable to version 2.1.7 although it is currently on version 5.
I would recommend you take a look at Flying Saucer. It is an open source project that uses iText PDF as its core rendering engine but it allows you to define very dynamic xhtml files as your rendering medium.
Benefits of using FS+iText using iText by itself
Allows for a much faster dev cycle for changes or new products
Very easy to add in consistent and complex styles using a language built exactly for it (HTML + CSS)
You can use the same HTML code to render your PDF as you use to view it online (if using web application)
Can render graphics using java.awt.Graphics class onto the PDF, meaning you can integrate any graphics library with FS to paint objects like graphs onto your PDF.
Downsides:
While it does a good job at rendering modern css styles it is not perfect. For instance when I used it the project required the border-radius style to be usable. It wasnt so I had to implement it.
Rendering times and memory consumption are increased (Although I have found it to be quite fast and memory efficient)
More libraires in your project.
Heres an example from the FS website if your ineterested.
https://github.com/flyingsaucerproject/flyingsaucer/blob/master/flying-saucer-examples/src/main/java/PDFRender.java
We are providing a thumbnail & preview functionality for rich powerpoint documents on our Java based site.
Currently, we are using iSpringConverter tool for converting the powerpoint documents to swf file.
The tool is licensed and windows based, and allows interaction through java.
This swf file is then launched on the client side as popups.
Can anyone suggest any other tools/frameworks/options/approaches used for implementing
- Generation of thumbnails and preview for powerpoints
- Viewers used, in case the preview is generated in some formats.
Any more ideas/suggestions.
Try SWFTOOLS, it works very well :)
You can make calls to it running command lines (using Process class).
I dont know if it transparently make thumbnails and etc... but I think you can done it by yourself using it.
hope it helps.
http://www.swftools.org/
You may try Aspose.Slides for Java to create thumbnails of the PowerPoint slides in your Java application. You can then show those images as a preview using any image control. This component doesn't require MS Office/Open Office etc. to be installed on your development or deployment machines for processing PowerPoint files. The API is quite simple and provides detailed documentation and help. Please see if this might help in your scenario.
Disclosure: I work as a developer evangelist at Aspose.
How can we create report in Java? Something like Crystal Reports in .net.
We have Jasper Report.
JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word.
Here is quick tutorial
Might be a duplicate of this question, BTW...
Anyways, here's my honest (yet biased) answer copied from there:
i-net Clear Reports (used to be i-net Crystal-Clear)
Simple and easy-to-use API of both the report engine and the Java report viewer.
Can export into any major format like PDF, HTML, SVG, XLS, etc., as well as into a Java applet viewer. (See samples)
Comes with a free and powerful graphical report template designer. (See video guide)
Installs as a WAR file on your application server or can be used as a library within your own application.
Great technical support (you usually get an answer in minutes or hours rather than days or weeks)
Charts based on JFreeChart (so includes Stock charts).
Can read Crystal Reports templates. (for a lot of customers, this is the killer feature since you don't have to re-create all your old Crystal Reports templates)
Great and competitive pricing - effectively costing "less than open source".
Free 90-day trial of the server component.
Free and fully functional report designer.
[full disclosure: Yes, I work for i-net software. But it's still my honest (though subjective and biased) answer to the question. ;)]
Try iRepor/JasperReports. I think is your best option as of today.
It's pretty mature, constantly updated (active), it supports StandAlone/Swing Applications, Web Applications, you can export to Excel/PDF, and integrates easily with major Appilcation Servers.
JasperReports is the Reporting Engine, and iReport is its IDE (Visual Report Editor).
BIRT is a very popular and powerful tool. Recommended.
Jasper report is indeed a powerfull tool, but sometimes to much work to create a report.
I would recommend to look also to POI and Docx4j. With those you can include a template with headers and entreprise style. You can build the file with simple statements but with Docx4j you can also replace tags (templating) in your .docx file by a element of choosing.
The docx4j(ava) documentation is available here: https://www.docx4java.org/forums/