How to export chart table data to PDF in extjs? - java

I try to export my chart table data from DB but have no idea how to export PDF.
Have any suggestion use to export chart table data by using existing extjs information to PDF file? Urgent..!

I don't think extjs has anything built-in to create pdfs. So you will either need to create it on the server or maybe you can use a client side js libary for pdf generation (e.g. http://code.google.com/p/jspdf/)

Generally, you would need your server to assist with this. What kind of server do you use?
Otherwise, you could try https://github.com/mozilla/pdf.js

I am researching about this, I think you first have to convert your chart into a picture and then use a PDF generator library and include this picture on it.
To convert chart to picture:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/charts/Area.js
To generate PDF on c# if you are using it on server side it could be pdfsharp or itext

Related

How can I get a preview image of an excel document?

I've got an excel document and i need to take an image of the first sheet and use it to put in the icon of JLabel. How can I do it?
I don't think Apache POI provides anything here as it is not concerned about displaying the data, only about retrieving and updating the data in the Excel Workbook.
So basically only Excel and other office applications like LibreOffice know how to actually display the data.
A few alternative options that come to my mind:
Use some other software to display the contents as a web-page and use Selenium to take a screenshot, see e.g. Take a screenshot with Selenium WebDriver
Programmatically open the file in Excel on a Windows box, then use some screenshot utility with automation support

How to display MS-Excel and PDF document in web browser?

In the project I'm currently working on need to display pdf or excel files to users in their web browser.
We are using java to build up server side and jquery as main js lib for front-end.
What should I do to make this possible?
Or say, what jar or js do I need to rely on (perferably a js lib, but, well.. I have no clue right now..)?
Thanks in advance. :)
It's simple buddy, follow these steps:
Open http://www.scribd.com/
Sign up
Sign in
Upload your excel or pdf file
Get it's iframe code
Place the iframe code in your webpage.
Done
Here are some few clews :
For pdf you can use the built-in of your browser if any, or you could use pdf.js.
For Microsoft documents, you should use Apache POI on server side, and maybe convert it in an other format like csv or json to send it back to your js client
You can make use Jquery datatables tool, to enable export to PDF/ excel. I have used this in earlier project, works very well. It's best part is it is configurable.
http://www.datatables.net/

Displaying PDF document in a Java(SE) Standalone Application

Am working on a Java application that requires me to display PDF documents within the application. Am not sure if Java currently supports this or will i need to get a Java library to get this done.
Please, i need advise on how to go about this.
Thanks in advance.
See pdf-renderer
The PDF Renderer is just what the name implies: an open source, all Java library which renders PDF documents to the screen using Java2D.

Extract text from PDF (google app engine)

Is there any free Java library for extracting text from PDF, that is compatible with Google Application Engine?
I've read about PDFJet, but it can't read PDF, can it?
Is there perhaps other way how to extract text from PDF? I tried http://www.pdfdownload.org/, unfortunately they don't handle non-English characters correctly.
iText now has a text parsing module (I'm one of the parser authors). See the com.itextpdf.text.pdf.parser.PdfContentReaderTool class for an example of how to use it.
PdfBox does not run on GAE. It uses not-allowed java classes.
(GAE only permits these http://code.google.com/appengine/docs/java/jrewhitelist.html)
I have partially modified a very old version of PdfBox (0.7.3) to be GAE complaiant. Now I'm able to extract text from PDF (whole page or rectangular area). I only modified a minumum part of the pdf text extraction and not the whole PdfBox. :)
The idea was to remove refences to java.awt.retangle & C. using my own "rectangle" class.
More info: http://fhtino.blogspot.com/2010/04/pdfbox-text-extration-gae.html
I modified the latest (1.8.0-Snapshot) version to run on Google AppEngine. Had to disable one Unit-Test, but it runs fine for simple text extraction.
Following the simple try-fail-fix approach i had to modify 5 files in total. Pretty doable.
You'll also have to explicitly use a RandomAccessBuffer, like Fabrizio explained.
For the extra lazy, heres the compiled jar, dependencies for text extraction, and the patch. Note that it might not work for every usecase (i.e. rectangle based extraction). Used it to extract text of a whole page.
https://docs.google.com/folder/d/0B53n_gP2oU6iVjhOOVBNZHk0a0E/edit
I know there is http://pdfbox.apache.org/index.html
Apache PDFBox is an open source Java
PDF library for working with PDF
documents. This project allows
creation of new PDF documents,
manipulation of existing documents and
the ability to extract content from
documents.
but I've never tested it.
Last month, I'd just finished extracting text from pdf file in my project. I used XPDF tool for getting text, and text coordinates, but I used it in Xcode (Objective-C). This tool was open source, written by C++, and able to be encoded in many language. However, I didn't know whether XPdf would be work on your java, or not. Anyway, You can try this tool.

Insert Image into Excel - Java

I am working on a java web application where i have to show an image on excel file.
i used the java file iopo to write the image to the excel file.
Issue is when the user mail this to client the image does not show up
Is there any way to embed the image into the excel file using java with/without using any external API.
You can use Apache POI: http://poi.apache.org
See especially http://poi.apache.org/spreadsheet/quick-guide.html#Images
You must use an external library as there is no standard Excel API for Java.
You should use something along the lines of JExcelAPI.

Categories