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
Related
I am developing a password manager within Eclipse and I am using Windowbuilder to help. I am using SWT, and am trying to make use of an Excel file which would store information such as usernames, passwords and additional notes
This is what I have so far when the program is launched
The left part, where there is a patch of white is where I want a menu to navigate through the Excel file, but I can not start that yet as I do not know how to actually display the Excel file. The area on the right which is not being used is where I want the information to be displayed
This is a sketch of what I would want it to be similar to
The Excel file can be any type, as long as it works with the GUI. Any help would be appreciated
one suggestion is to create a workbook with multiple sheets by the name of your menu like Gmail, accounts etc. then create columns by name of the information you want to store which would be website, username, password etc. Then Use apache POI to read the file in java. This Tutorial will help you in reading the excel file.
Regarding display of excel file, You can use Table Editor to display your data.
I am trying to create Java program, which can read multiple pdf files and merge them into a single pdf file.
Then print the PDF but while printing i need to merge multiple pdf pages in a single page and print.
Even if it is a new pdf created, that is fine for me.
I need some open source java pdf manipulation library to handle this.
I know one solution is while printing, select multiple printing option for muliple pages to one sheet. But the printer i can access doesn't have such capabilities.
Can anybody suggest some solution for this or is it possible in any other programming language?
I haven't been able to find a way to download all pages of a the sheet.
Right now I'm using this link to download the sheet as a txtfile (later I modify it easily to be compatible with JSON): https://docs.google.com/spreadsheets/d/PAGELINK/gviz/tq
This only downloads the first page of the sheet. Is there a particular link where I can download the WHOLE sheet (all pages)?
I'm not using google-sheets-api.
EDIT:I am trying to download it through my android app. Sorry if I was not clear.
At this time there is not a build-in single "link" to download all the sheets in text format but you could create an app that provides that. One alternative among others is to create web app by using Google Apps Script.
I'm trying to find a way to copy the whole slide, and paste it with the formatting of 'as an image' to a blank slide, using POI's APIs.
The reason why I'm trying to do this is because I want to save each slide as an image.
The POI's Slide.draw() API by itself does not do a very good job of saving the slides' contents to images.
For example it cannot draw the following two types of objects:
Tables created on PowerPoint
Charts pasted from Excel
Is there any way to 'copy' and 'paste with formatting (as an image)' via POI, just like you do these two operations on MS PowerPoint running on a Windows, in order to save the slides as they are?
Since Slide.draw() works just fine with images, once I paste all the objects as a single flat image onto a slide (using POI), I'll be good to go.
Or if there is a better way to save the slides contents as intact as possible, could you please let me know?
The license which comes along with the method needs to be Apache license or otherwise something more permissive.
Also, I read the following post:
Programmatically extracting slides as images from a PowerPoint presentation (.PPT)
unoconv is GPL-licensed, so it is not an option for us.
JODConverter is LGPL-licensed; I'm not sure if it's acceptable so I will talk to my boss and check.
Then I ran the POI as a command line tool, as suggested by Michael,
but I ended up getting the same problem (tables and pasted Excel charts
do not show up in the saved images.)
Thanks.
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