In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail "how Java turns Excel into a picture". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how Java turns Excel into pictures" can help you solve your doubts.
Java converts Excel into picture, html, XPS, XML, CSV
Through document format conversion, it can meet the needs of document operation in different office situations. This article describes how to convert Excel documents to other common document formats. Through the method in this article, you can support the conversion of Excel to different document formats, including PDF, pictures, html, XPS, XML, CSV, PCL, ODS, PostScript, and Office Excel, such as version97-2003 heroic version2007 mindversion2010version 2013recoversion2016 and so on. This paper introduces the specific conversion methods by taking several document formats as examples.
Using tools: Free Spire.XLS for Java (free version)
Download and import Jar files:
Method 1: the jar package can be downloaded from the official website. After downloading, extract the file and import the Spire.Xls.jar under the lib folder into the Java program. As shown below:
Method 2: it can be imported through maven warehouse.
Java code example (for reference)
Import com.spire.xls.*;public class ExcelToImg {public static void main (String [] args) {/ / load the Excel worksheet Workbook wb = new Workbook (); wb.loadFromFile ("test.xlsx"); / / get the worksheet Worksheet sheet = wb.getWorksheets () .get (0); / / call the method to save the Excel worksheet as picture sheet.saveToImage ("ToImg.png") / / call the method to save the specified Excel cell data range as a picture / / sheet.saveToImage ("ToImg2.png"); / / call the method to save the Excel as HTML sheet.saveToHtml ("ToHtml.html"); / / call the method to save the Excel as XPS sheet.saveToFile ("ToXPS.xps", String.valueOf (FileFormat.XPS)) / / call method to save Excel as CSV sheet.saveToFile ("ToCSV.csv", String.valueOf (FileFormat.CSV)); / / call method to save Excel as XML sheet.saveToFile ("ToXML.xml", String.valueOf (FileFormat.XML)); / / call method to save Excel as PostScript sheet.saveToFile ("ToPostScript.postscript", String.valueOf (FileFormat.PostScript)) / / call the method to save Excel as PCL sheet.saveToFile ("ToPCL.pcl", String.valueOf (FileFormat.PCL));}}
Document conversion result:
Read this, the "Java how to Excel into pictures" article has been introduced, want to master the knowledge of this article also need to practice and use to understand, if you want to know more about the article, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.