Spire.Office for Android via Java 8.4.1 is released

Spire.Office for Android via Java 8.4.1 is released

2024-06-03 09:46:31

We are excited to announce the release of Spire.Office for Android via Java 8.4.1. In this version, Spire.PDF for Android via Java supports a number of new features, including converting PDF to SVGZ and PPTX and comparing PDF files; Spire.Presentation for Android via Java enhances the conversion from PPTX to PDF. Moreover, some known issues are fixed successfully in this version. More details are listed below.

Click the link to download Spire.Office for Android via Java 8.4.1:

Here is a list of changes made in this release

Spire.PDF for Android via Java

Category ID Description
New feature - Supports converting PDF to PPTX.
String input = "data/JavaPDFSample_1.pdf";
String output = "output/toPPTX.pptx";
//Load a pdf document
PdfDocument doc = new PdfDocument();
doc.loadFromFile(input);
//Convert to pptx file.
doc.saveToFile(output, FileFormat.PPTX);
doc.close();
New feature - Supports image compression.
PdfCompressor compressor = new PdfCompressor(inputFile);
compressor.getOptions().getImageCompressionOptions().setCompressImage(true);
compressor.getOptions().getImageCompressionOptions().setResizeImages(true);
compressor.getOptions().getImageCompressionOptions().setImageQuality(ImageQuality.High);
compressor.compressToFile(outputFile);
New feature - Adds a new method pdf.getDocumentInformation() to get the Metadata data, and deprecated XmpMetadata.
PdfDocument doc = new PdfDocument();
doc.loadFromFile(inputFile);
StringBuilder builder = new StringBuilder();
builder.append("Author:" + doc.getDocumentInformation().getAuthor() + "\r\n");
builder.append("Title: " + doc.getDocumentInformation().getTitle() + "\r\n");
builder.append("Creation Date: " + doc.getDocumentInformation().getCreationDate() + "\r\n");
builder.append("Subject: " + doc.getDocumentInformation().getSubject() + "\r\n");
builder.append("Producer: " + doc.getDocumentInformation().getProducer() + "\r\n");
builder.append("Creator: " + doc.getDocumentInformation().getCreator() + "\r\n");
builder.append("Keywords: " + doc.getDocumentInformation().getKeywords() + "\r\n");
builder.append("Modify Date: " + doc.getDocumentInformation().getModificationDate() + "\r\n");
builder.append("Customed Property's value: " + doc.getDocumentInformation().getCustomProperty("Field1"));
FileWriter fw = new FileWriter(new File(outputFile), true);
BufferedWriter bw = new BufferedWriter(fw);
bw.write(builder.toString());
bw.flush();
bw.close();
fw.close();
New feature SPIREPDF-6190 Support setting encryption options when encrypting PDF documents.
PdfDocument pdfdoc = new PdfDocument();
pdfdoc.loadFromFile(inputFile);
PdfSecurityPolicy securityPolicy = new PdfPasswordSecurityPolicy("123", "e-iceblue");
securityPolicy.setEncryptionAlgorithm(PdfEncryptionAlgorithm.AES_128);
securityPolicy.setEncryptMetadata(false);
pdfdoc.encrypt(securityPolicy);
pdfdoc.saveToFile(outputFile);
New feature - Supports determining if a PDF document stream is encrypted.
FileInputStream stream_1 = new FileInputStream(new File(inputFile_1));
boolean isPasswordProtected_1 = PdfDocument.isPasswordProtected(stream_1);
New feature - Add a new method to convert PDF to Word.
PdfToWordConverter convert = new PdfToWordConverter(inputFile);
convert.saveToDocx(outputFile);
New feature - Supports comparing PDF documents.
PdfDocument pdf1 = new PdfDocument(inputFile_1);
PdfDocument pdf2 = new PdfDocument(inputFile_2);
PdfComparer compare = new PdfComparer(pdf1, pdf2);
compare.getOptions().setPageRanges(0, pdf1.getPages().getCount() - 1, 0, pdf2.getPages().getCount() - 1);
compare.compare(outputFile);
New feature - Supports converting PDF documents to SVGZ documents.
PdfDocument pdf = new PdfDocument(inputFile);
pdf.saveToFile(outputFile, FileFormat.SVGZ);
Bug SPIREPDF-5639 Fixes the issue that adding new custom properties would cause loss of existing custom properties.
Bug - Fixes the issue that the program did not prompt an error when the open password and the permission password were the same.

Spire.Presentation for Android via Java

Category ID Description
Bug SPIREPPT-2404
SPIREPPT-2526
Fixes the issue that the application threw an "AbstractMethodError" exception when converting PPTX documents to PDF