原創|產品更新|編輯:李顯亮|2020-10-09 09:57:10.510|閱讀 637 次
概述:office文檔組件開發控件Spire.Office for Java 3.9.4現已正式發布。此次更新的版本擁有許多新功能,與此同時,一些在加載、操作和轉換Word、Excel、PDF和Presentation文檔及掃描條形碼時出現的問題也得以成功解決,歡迎下載體驗。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
你在尋找支持在Java中用編程方法處理各類格式文檔的API嗎?好巧,Java版企業級文檔管理組合套包Spire.Office 2020全新上線!Word、Excel、PPT、PDF、條形碼等格式一網打盡。
目前,Spire.Office for Java 迎來了v3.9.4版的更新。此次更新的版本擁有許多新功能,例如,Spire.Doc for Java支持比較兩個Word文檔和清除單元格背景;Spire.PDF for Java支持將SVG轉換到PDF;Spire.XLS for Java支持將Excel轉換到TIFF;Spire.Presentation for Java支持更新PPT文檔中的Video視頻數據;Spire.Barcode for Java支持設置條碼頂部文本的排列方式。與此同時,一些在加載、操作和轉換Word、Excel、PDF和Presentation文檔及掃描條形碼時出現的問題也得以成功解決。點擊下方按鈕即可下載試用↓↓↓
免費下載Spire.Office for Java v3.9.4
新功能及問題修復詳情,請參閱如下內容。
新功能:
Document doc1 = new Document(); doc1.loadFromFile(inputFile_1); Document doc2 = new Document(); doc2.loadFromFile(inputFile_2); doc1.compare(doc2, "E-iceblue"); doc1.saveToFile(outputFile);
tablecell.getCellFormat().clearBackground();
doc.saveToImages(pageIndex, pageCount, ImageType.Bitmap, dpiX, dpiY);
優化:
問題修復:
新功能:
PdfDocument doc = new PdfDocument(); doc.loadFromSvg(inputFile_svg); doc.saveToFile(outputFile);
PdfDocument doc1 = new PdfDocument(); doc1.loadFromSvg(inputFile_svg); PdfDocument doc2 = new PdfDocument(); doc2.loadFromFile(inputFile_pdf); doc2.getPages().get(0).getCanvas().drawTemplate(doc1.getPages().get(0).createTemplate(), new Point2D.Float(10,10), new Dimension(100,100) ); doc2.saveToFile(outputFile, FileFormat.PDF); doc1.close(); doc2.close();
PdfDocument pdf = new PdfDocument(); pdf.loadFromFile(inputFile); pdf.getConvertOptions().setConvertToWordUsingFlow(true); pdf.saveToFile(outputFile_doc, FileFormat.DOC);
PdfDocument pdf = new PdfDocument(); pdf.loadFromFile(inputFile); pdf.saveToFile(outputPath, FileFormat.XLSX);
問題修復:
新功能:
workbook.getConverterSetting().setXDpi(300); workbook.getConverterSetting().setYDpi(300); Worksheet sheet; for (int i = 0; i < wb.getWorksheets().size(); i++) { sheet = wb.getWorksheets().get(i); sheet.saveToImage(outputFile + i + ".png"); }
問題修復:
新功能:
File file = new File("videoPath"); FileInputStream fileInputStream = new FileInputStream(file); byte[] data = new byte[(int)file.length()]; fileInputStream.read(data); VideoCollection videos = presentation.getVideos(); VideoData videoData = videos.append(data); IVideo iVideo = (IVideo) presentation.getSlides().get(0).getShapes().get(0); iVideo.setEmbeddedVideoData(videoData);
for (int i = 0; i < presentation.getSlides().getCount(); i++) { ISlide slide = presentation.getSlides().get(i); for (int j = 0; j < slide.getShapes().getCount(); j++) { IShape shape = slide.getShapes().get(j); if (shape instanceof IAudio) { String audioPartName = ((IAudio) shape).getData().getPartName(); } if (shape instanceof IVideo) { String videoPartName = ((IVideo) shape).getEmbeddedVideoData().getPartName(); } }
for (int i = 0; i < slide.getTimeline().getMainSequence().getCount(); i++) { AnimationEffect animationEffect = slide.getTimeline().getMainSequence().get(i); AnimationAmountType amount = animationEffect.getAmount(); }
Presentation presentation = new Presentation(); presentation.loadFromFile("data/animation.pptx"); for (int c = 0; c < presentation.getSlides().getCount(); c++) { ISlide slide = presentation.getSlides().get(c); for (int i = 0; i < slide.getTimeline().getMainSequence().getCount(); i++) { AnimationEffect animationEffect = slide.getTimeline().getMainSequence().get(i); //預設類型,比如Entrance,Emphasis,Exit,Path String presetClassType = animationEffect.getPresetClassType().getName(); //獲取動畫效果類型 AnimationEffectType animationEffectType= animationEffect.getAnimationEffectType(); //獲取目標Shape Shape shape = animationEffect.getShapeTarget(); //獲取動畫效果子類型 String subType = animationEffect.getSubtype().getName(); //獲取Color Color color = animationEffect.getColor(); //當動畫效果類型為Faded_Zoom時,獲取vanishing point(消失點) if (animationEffectType.equals(AnimationEffectType.FADED_ZOOM)) { String vanishingPointName = animationEffect.getVanishingPoint().getName(); } //獲取WAVE動畫效果 if (animationEffectType.equals(AnimationEffectType.WAVE)) { TextAnimationCollection textAnimations = slide.getTimeline().getTextAnimations(); if (textAnimations.size() > 0) { for (int j = 0; j < textAnimations.size(); j++) { ParagraphBuildType buildType = textAnimations.get(j).getParagraphBuildType(); } } } } }
優化:
問題修復:
新功能:
int width = 399; int height = 159; BarcodeSettings bs = new BarcodeSettings(); bs.setType(BarCodeType.UPCA); bs.setUnit(GraphicsUnit.Pixel); bs.setWideNarrowRatio(0.5f); bs.setTextFont(new Font("Arial", Font.PLAIN,20 )); String data = "602318275035"; bs.setData(data); bs.setData2D(data); bs.setShowTextOnBottom(true); bs.setTopText(data); bs.setShowTopText(true); bs.setTextAlignment(StringAlignment.Center); bs.setTopTextAligment(StringAlignment.Center); bs.setTopTextFont(new Font("Arial", Font.PLAIN, 20)); bs.setAutoResize(false); bs.setX(3.0f); bs.setBarHeight(height * 0.6f); bs.setImageHeight(height); bs.setImageWidth(width); BarCodeGenerator barCodeGenerator = new BarCodeGenerator(bs); BufferedImage bufferedImage = barCodeGenerator.generateImage(); ImageIO.write(bufferedImage, "png", new File("result.png"));
barsetting.setBottomText("EAN"); barsetting.setBottomTextFont(new Font("fangsong", Font.BOLD, 25)); barsetting.setBottomTextColor(Color.BLACK); barsetting.setShowBottomText(true); barsetting.setBottomTextAlignment(StringAlignment.Center);
問題修復:
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn