Spire.Office for Java 9.7.0

release of Spire.Office for Java 9.7.0. This version contains many new features, such as Spire.Doc for Java supports embedding CSS and images when converting Word documents to HTML files in HTML Fixed format; Spire.Presentation for Java supports adding comments to specified text in PowerPoint; Spire.Barcode for Java supports obtaining barcode information, including barcode type, data value and vertex position information. In addition, many known issues have also been successfully fixed in this version. More details are listed below.


Here is a list of changes made in this release

Spire.Doc for Java

CategoryIDDescription
New featureSPIREDOC-10687Supports embedding CSS and images when converting Word documents to HTML files in HTML Fixed format.
String inputFile = "1.docx";
String outputFile ="1.html";
Document doc = new Document();
doc.loadFromFile(inputFile);
doc.getHtmlExportOptions().setCssStyleSheetType(CssStyleSheetType.Internal);
doc.getHtmlExportOptions().setImageEmbedded(true);
doc.saveToFile(outputFile, FileFormat.HtmlFixed);
doc.dispose();
BugSPIREDOC-9829
SPIREDOC-10609
Fixes the issue that the orientation of added images was incorrect.
BugSPIREDOC-10006
SPIREDOC-10636
SPIREDOC-10692
Fixes the issue that the size of OFD documents converted from Docx documents becomes bigger.
BugSPIREDOC-10327Fixes the issue that watermarks in HTML documents converted from Docx documents were lost.
BugSPIREDOC-10379
SPIREDOC-10509
SPIREDOC-10531
SPIREDOC-10650
Fixes an issue that content was lost after converting a Docx document to a PDF document.
BugSPIREDOC-10591Fixes an issue that the editing area was lost after converting an XML document to a Doc document.
BugSPIREDOC-10615Fixes the issue that the program threw an exception when converting Word to PDF under multi-threading.
BugSPIREDOC-10623Fixes the issue that page numbers were formatted incorrectly after converting Docx documents to PDF documents.
BugSPIREDOC-10627Fixes the issue that the program threw "The authentication or decryption has failed." error when converting Docx documents to PDF documents.
BugSPIREDOC-10634
SPIREDOC-10701
Fixes the issue that the program threw an exception when converting Word to OFD under multi-threading.
BugSPIREDOC-10670Fixes the issue that the text orientation changed after converting Docx documents to PDF documents.
BugSPIREDOC-10685
SPIREDOC-10697
Fixes the issue that the page numbers of requests after the second time were lost after adding a table of contents in a Web project.
BugSPIREDOC-10713Fixes the issue that font embedding failed when converting Docx documents to PDF documents.

Spire.PDF for Java

CategoryIDDescription
BugSPIREPDF-6804Fixes the error occurred when opening compressed PDF files.
BugSPIREPDF-6831Fixed the issue that the effect of the PdfInkAnnotation added to PDF was incorrect.
BugSPIREPDF-6856Fixes the issue that the program threw "NullPointerException" when obtaining the PDF JavaScript.
BugSPIREPDF-6865Fixes the issue that the program threw "java.lang.NoClassDefFoundError" when compressing images with the "ImageQuality.Medium" setting.
BugSPIREPDF-6870Fixed the issue that the size of PDF documents was not reduced after splitting.
BugSPIREPDF-6879Fixes the issue of creating a PdfActionAnnotation but retrieving its type as PdfTextWebLinkAnnotationWidget.
BugSPIREPDF-6886Fixes the issue that the program threw "NullPointerException" when replacing text in PDF.

Spire.Presentation for Java

CategoryIDDescription
New featureSPIREPPT-2559Supports adding comments to specified text in PowerPoint.
Presentation ppt = new Presentation();
ISlide slide = ppt.getSlides().get(0);
IAutoShape shape = ppt.getSlides().get(0).getShapes().appendShape(ShapeType.RECTANGLE, new Rectangle2D.Double(100, 250, 350, 200));
ppt.getSlides().get(0).getShapes().get(0).getLine().getFillFormat().getSolidFillColor().setColor(Color.white);
shape.getFill().setFillType(FillFormatType.SOLID);
shape.getFill().getSolidColor().setColor(Color.GRAY);
ParagraphEx paragraphEx = shape.getTextFrame().getTextRange().getParagraph();
PortionEx ex = new PortionEx("TextTextmdTextText\ttmdTextTextmdText\ttmdTextTextmdtEXT\ttTextmd");
paragraphEx.getTextRanges().append(ex);
ICommentAuthor commentAuthor = ppt.getCommentAuthors().addAuthor("test","12");
paragraphEx.addComment(commentAuthor,slide,shape,ex,"123");
String result = "result.pptx";
ppt.saveToFile(result, FileFormat.PPTX_2013);

Presentation ppt = new Presentation();
ppt.loadFromFile(inputFile);
ISlide slide = ppt.getSlides().get(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get(0);
ParagraphEx paragraphEx = shape.getTextFrame().getTextRange().getParagraph();
PortionEx portionEx = paragraphEx.getTextRanges().get(0);
ICommentAuthor commentAuthor = ppt.getCommentAuthors().addAuthor("test","18");
paragraphEx.addComment(commentAuthor,slide,shape,portionEx,"123456789");
String result = "result.pptx";
ppt.saveToFile(result, FileFormat.PPTX_2013);
BugSPIREPPT-2550Fixes the issue that the shape height was incorrect after adding content to the shape.
BugSPIREPPT-2560Fixes the issue that the effect of modifying the shape position was incorrect.
BugSPIREPPT-2561Fixes the issue that the greater-than and less-than symbols in Latex formulas were parsed incorrectly.

Spire.Barcode for Java

CategoryIDDescription
New featureSPIREBARCODE-258The BarcodeScanner class supports obtaining barcode information, including barcode type, data value and vertex position information.
BarcodeInfo[] infos = BarcodeScanner.scanInfo("barcode.png");
Point[] loaction = infos[0].getVertexes();
BarCodeReadType barCodeReadType = infos[0].getReadType();
String dataString =  infos[0].getDataString();
New feature-The BarcodeScanner class supports scanning Aztec type.
String[] s = BarcodeScanner.scan("AZTEC.png",BarCodeType.Aztec);
New feature-The BarcodeScanner class supports scanning with more overload settings.
Public static String[] scan(BufferedImage bitmap, java.awt.Rectangle rect, BarCodeType barcodeType, boolean IncludeCheckSum)
Public static String[] scan(String fileName, BarCodeType barcodeType, boolean IncludeCheckSum)
Public static String scanOne(String fileName, BarCodeType barcodeType, boolean IncludeCheckSum)
Public static String scanOne(InputStream stream, BarCodeType barcodeType, boolean IncludeCheckSum)
New feature-Adds external use enumerations.
com.spire.barcode.publics.drawing.FontStyle
com.spire.barcode.publics.drawing.GraphicsUnit
com.spire.barcode.publics.drawing.StringAlignment
New feature-Adjustments to the IBarCodeSettings interface.

Recycled:

public java.awt.Font getTopTextFont()
public java.awt.Font getBottomTextFont()
public java.awt.Font getTextFont()

Modified:

public void setBottomTextFont(java.awt.Font value)->public void setBottomTextFont(String familyName, float fontSize)
public void setTopTextFont(java.awt.Font value)->public void setTopTextFont(String familyName, float fontSize)
public boolean showBottomText->public boolean isShowBottomText()
public void setShowBottomText(boolean value) -> public void isShowBottomText(boolean value)
public com.spire.barcode.GraphicsUnit getUnit() -> public com.spire.barcode.publics.drawing.GraphicsUnit getUnit()
public void setUnit(com.spire.barcode.GraphicsUnit value) -> public void setUnit(com.spire.barcode.publics.drawing.GraphicsUnit value)
public void setTextFont(java.awt.Font value) -> public void setTextFont(String familyName, float fontSize)
public float getLeftMargin() ->The default value adjusted from 5 to 4. 

Newly Added:

public float getTopTextMargin()  
public void setTopTextMargin(float value)
public int getAztecErrorCorrection()
public void setAztecErrorCorrection(int value)
public int getAztecLayers()
public void setAztecLayers(int value)
public DataMatrixSymbolShape getDataMatrixSymbolShape()
public void setDataMatrixSymbolShape(DataMatrixSymbolShape value)
public ITF14BorderType getITF14BearerBars() 
public void setITF14BearerBars(ITF14BorderType value)
public void setTextFont(String familyName, float fontSize, com.spire.barcode.publics.drawing.FontStyle style)
public boolean isShowStartCharAndStopChar()
public void isShowStartCharAndStopChar(boolean value)
New feature-Adjustments to the BarcodeSettings class interfaces.

Recycled:

public java.awt.Font getTextFont()
public java.awt.Font getTopTextFont() 
public java.awt.Font getBottomTextFont()

Modified:

public void setTextFont(java.awt.Font value) -> public void setTextFont(String familyName, float sizePoints)
public com.spire.barcode.GraphicsUnit getUnit() -> public com.spire.barcode.publics.drawing.GraphicsUnit getUnit()
public void setUnit(com.spire.barcode.GraphicsUnit value) -> public void setUnit(com.spire.barcode.publics.drawing.GraphicsUnit value)
public com.spire.barcode.StringAlignment getTextAlignment() -> public com.spire.barcode.publics.drawing.StringAlignment getTextAlignment()
public void setTextAlignment(com.spire.barcode.StringAlignment value) -> public void setTextAlignment(com.spire.barcode.publics.drawing.StringAlignment value)
public com.spire.barcode.StringAlignment getTopTextAligment() -> public com.spire.barcode.publics.drawing.StringAlignment getTopTextAligment()
public void setTopTextAligment(com.spire.barcode.StringAlignment value) -> public void setTopTextAligment(com.spire.barcode.publics.drawing.StringAlignment value)
public void setBottomTextFont(java.awt.Font value) -> public void setBottomTextFont(String familyName, float fontSize)
public void setTopTextFont(java.awt.Font value) -> public void setTopTextFont(String familyName, float fontSize)
public boolean showBottomText->public boolean isShowBottomText()
public void setShowBottomText(boolean value) -> public void isShowBottomText(boolean value)
public com.spire.barcode.StringAlignment getBottomTextAlignment() -> public com.spire.barcode.publics.drawing.StringAlignment getBottomTextAlignment()
public void setBottomTextAlignment(com.spire.barcode.StringAlignment value) -> public void setBottomTextAlignment(com.spire.barcode.publics.drawing.StringAlignment value)
public float getLeftMargin() ->The default value adjusted from 5 to 4. 

Newly Added:

public float getTopTextMargin()
public void setTopTextMargin(float value)
public void setTextFont(String familyName, float sizePoints, com.spire.barcode.publics.drawing.FontStyle style)
public void setTopTextFont(String familyName, float fontSize, com.spire.barcode.publics.drawing.FontStyle style)
public void setITF14BearerBars(ITF14BorderType value)
public boolean isShowStartCharAndStopChar()
public void isShowStartCharAndStopChar(boolean value)
public int getAztecLayers()
public void setAztecLayers(int value)
public int getAztecErrorCorrection()
public void setAztecErrorCorrection(int value)
public DataMatrixSymbolShape getDataMatrixSymbolShape()
public void setDataMatrixSymbolShape(DataMatrixSymbolShape value)
public void setBottomTextFont(String familyName, float fontSize, com.spire.barcode.publics.drawing.FontStyle style)

Spire.OCR for Java

CategoryIDDescription
New feature-Adds the ConfigureOptions class and new method ConfigureDependencies(ConfigureOptions configureOptions), which supports configuring OCR models, languages, and dependency libraries.
import com.spire.ocr.*;
import java.awt.geom.Rectangle2D;

public class OCRTest {
    public static void main(String[] args) throws Exception{
        OcrScanner scanner = new OcrScanner();
        ConfigureOptions configureOptions = new ConfigureOptions("D:\\LanguageModel", "English");
        String dependencies = "dependencies/";
        configureOptions.setLibPath(dependencies);
        scanner.ConfigureDependencies(configureOptions);
        String imageFile = "Sample.png";
        scanner. scan(imageFile);
        String scannedText=scanner.getText().toString();

        StringBuilder stringBuilder=new StringBuilder();
        for(IOCRTextBlock blockItem :scanner.getText().getBlocks()){
            Rectangle2D rectangle2D=blockItem.getBox();
            stringBuilder.append(blockItem.getText() +","+ "X"+ rectangle2D.getX()+"; Y:"+rectangle2D.getY()+ "; Width:"+ rectangle2D.getWidth()+ "; Height:"+ rectangle2D.getHeight());
        }
    }
}
  • 21
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Spire.Office for Java是一款专业的Java Office组件,它包含了Spire.Doc for JavaSpire.XLS for JavaSpire.PDF for JavaSpire.Presentation for Java四个组件,可以帮助Java开发人员快速、高效地处理Word、Excel、PDF和PowerPoint文档。Spire.Office for Java具有丰富的API和功能,支持多种文档格式的读写、编辑、转换和打印,可以满足各种办公自动化需求。 ### 回答2: Spire.Office for Java是一个强大的Java办公组件套件,包括Spire.Doc for JavaSpire.XLS for JavaSpire.PDF for JavaSpire.BarCode for Java四个组件。它们可以帮助 Java 开发人员创建和编辑 Word、Excel、PDF 和条形码等文档格式,同时也支持在Java应用程序中读取、编辑和操作这些文档。 Spire.Doc for Java可以帮助Java开发人员对Word文档进行格式处理、页眉页脚、表格、图片、水印、批注等功能的添加,其支持Word 97-2016和Word for Office 365,还支持保存为PDF、HTML、EPUB等格式。 Spire.XLS for Java则是用于对Excel文件的读取、编辑和操作,支持Excel 97-2016和Excel for Office 365版本,能够操作各种Excel控件,在其中插入图表、公式、超链接、PivotTable等。不仅如此,它还支持写入数据和读取Excel文件的常见文件格式。 Spire.PDF for Java是一个功能强大的PDF组件,可用于创建、编辑、转换、打印、填充PDF表单等,同时还支持在PDF文件中添加和删除书签、注释、水印、图像等。 Spire.BarCode for Java可用于在Java应用程序中快速生成标准和自定义的条形码,包括二维码、一维码、PDF417、Data Matrix等条码,提供了大量的条码属性和功能,以满足开发人员的各种需求。 综上所述,Spire.Office for JavaJava开发人员提供了强大的文档处理功能,可用于实现各种文档编辑和生成需求,提高开发效率,同时也提高了文档处理的质量和准确性。 ### 回答3: Spire.Office for Java是一款Java开发平台的多功能办公套件,由E-iceblue公司开发,充分利用了Java的跨平台性,支持基于Windows,Linux等平台的Java开发环境。它包含了Word、Excel、PowerPoint、PDF等几十种最常用的功能,如文本管理,格式化,页面设计,图形处理,表格生成,公式计算等。 Spire.Office for Java不仅可以轻松实现Office文件的读写,同时还支持Office文件的转换、编辑、合并、分割、水印、签名等多种操作。用户可以在Java环境下创建和修改PDF文档和PDF表单,添加或删除文本、图片,调整表格格式,加密或解密文档等。 Spire.Office for Java除了提供丰富的API文档和示例代码,还有一个用户友好的可视化设计界面,帮助开发者轻松实现任何具体的应用场景。通过Spire.Office的一系列操作,开发人员可以快速构建高性能、易维护和灵活的Java应用程序,提高工作效率。 总之,Spire.Office for Java是一款适用于Java开发用户的全功能办公套件,能够轻松实现所有Office文件的操作,包括读写、转换、编辑、合并、分割、水印、签名等多种操作,同时还支持PDF文档和表单的创建和修改,使得Java开发者能够更加轻松地实现任何具体的应用场景。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值