Spire.PDF for Java 11.6.2 enhances the conversion form PDF to PDFA3B and PDFA1A
We are delighted to announce the release of Spire.PDF for Java 11.6.2. This version enhances the conversion from PDF to PDFA3B and PDFA1A as well as OFD to PDF. Besides, some known issues are fixed successfully in this version, such as the issue that the font was incorrect when replacing text. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug | SPIREPDF-7485 | Fixed the issue that spaces were lost after converting PDF to PDFA3B. |
| Bug | SPIREPDF-7497 | Fixed the issue that signatures were lost after converting PDF to PDFA1A. |
| Bug | SPIREPDF-7506 | Fixed the issue that the program threw NullPointerException after converting OFD to PDF. |
| Bug | SPIREPDF-7524 | Fixed the issue that fonts were incorrect after replacing text. |
| Bug | SPIREPDF-7530 | Fixed the issue that table layouts were incorrect after creating booklets using PdfBookletCreator. |
How to Read Excel Files in Java (XLS/XLSX) – Complete Guide

Reading Excel files using Java is a common requirement in enterprise applications, especially when dealing with reports, financial data, user records, or third-party integrations. Whether you're building a data import feature, performing spreadsheet analysis, or integrating Excel parsing into a web application, learning how to read Excel files in Java efficiently is essential.
In this tutorial, you’ll discover how to read .xls and .xlsx Excel files using Java. We’ll use practical Java code examples which also cover how to handle large files, read Excel files from InputStream, and extract specific content line by line.
Table of Contents
- 1. Set Up Your Java Project
- 2. How to Read XLSX and XLS Files in Java
- 3. Best Practices for Large Excel Files
- 4. Full Example: Java Program to Read Excel File
- 5. Summary
- 6. FAQ
1. Set Up Your Java Project
To read Excel files using Java, you need a library that supports spreadsheet file formats. Spire.XLS for Java offers support for both .xls (legacy) and .xlsx (modern XML-based) files and provides a high-level API that makes Excel file reading straightforward.
Add Spire.XLS to Your Project
If you're using Maven, add the following to your pom.xml:
<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.xls</artifactId>
<version>16.6.5</version>
</dependency>
</dependencies>
If you're not using Maven, you can manually download the JAR from the official Spire.XLS website and add it to your classpath.
For smaller Excel processing tasks, you can also choose Free Spire.XLS for Java.
2. How to Read XLSX and XLS Files in Java
Java programs can easily read Excel files by loading the workbook and iterating through worksheets, rows, and cells. The .xlsx format is commonly used in modern Excel, while .xls is its older binary counterpart. Fortunately, Spire.XLS supports both formats seamlessly with the same code.
Load and Read Excel File (XLSX or XLS)
Here’s a basic example that loads an Excel file and prints its content:
import com.spire.xls.*;
public class ReadExcel {
public static void main(String[] args) {
// Create a workbook object and load the Excel file
Workbook workbook = new Workbook();
workbook.loadFromFile("data.xlsx"); // or "data.xls"
// Get the first worksheet
Worksheet sheet = workbook.getWorksheets().get(0);
// Loop through each used row and column
for (int i = 1; i <= sheet.getLastRow(); i++) {
for (int j = 1; j <= sheet.getLastColumn(); j++) {
// Get cell text of a cell range
String cellText = sheet.getCellRange(i, j).getValue();
System.out.print(cellText + "\t");
}
System.out.println();
}
}
}
You can replace the file path with an .xls file and the code remains unchanged. This makes it simple to read Excel files using Java regardless of format.
The Excel file being read and the output result shown in the console.

Read Excel File Line by Line with Row Objects
In scenarios like user input validation or applying business rules, processing each row as a data record is often more intuitive. In such cases, you can read the Excel file line by line using row objects via the getRows() method.
for (int i = 0; i < sheet.getRows().length; i++) {
// Get a row
CellRange row = sheet.getRows()[i];
if (row != null && !row.isBlank()) {
for (int j = 0; j < row.getColumns().length; j++) {
String text = row.getColumns()[j].getText();
System.out.print((text != null ? text : "") + "\t");
}
System.out.println();
}
}
This technique works particularly well when reading Excel files in Java for batch operations or when you only need to process rows individually.
Read Excel File from InputStream
In web applications or cloud services, Excel files are often received as streams. Here’s how to read Excel files from an InputStream in Java:
import com.spire.xls.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class ReadExcel {
public static void main(String[] args) throws FileNotFoundException {
// Create a InputStream
InputStream stream = new FileInputStream("data.xlsx");
// Load the Excel file from the stream
Workbook workbook = new Workbook();
workbook.loadFromStream(stream);
System.out.println("Load Excel file successfully.");
}
}
This is useful when handling file uploads, email attachments, or reading Excel files stored in remote storage.
Read Excel Cell Values in Different Formats
Once you load an Excel file and get access to individual cells, Spire.XLS allows you to read the contents in various formats—formatted text, raw values, formulas, and more.
Here's a breakdown of what each method does:
CellRange cell = sheet.getRange().get(2, 1); // B2
// Formatted text (what user sees in Excel)
String text = cell.getText();
// Raw string value
String value = cell.getValue();
// Generic object (number, boolean, date, etc.)
Object rawValue = cell.getValue2();
// Formula (if exists)
String formula = cell.getFormula();
// Evaluated result of the formula
String result = cell.getEnvalutedValue();
// If it's a number cell
double number = cell.getNumberValue();
// If it's a date cell
java.util.Date date = cell.getDateTimeValue();
// If it's a boolean cell
boolean bool = cell.getBooleanValue();
Tip: Use getValue2() for flexible handling, as it returns the actual underlying object. Use getText() when you want to match Excel's visible content.
You May Also Like: How to Write Data into Excel Files in Java
3. Best Practices for Reading Large Excel Files in Java
When your Excel file contains tens of thousands of rows or multiple sheets, performance can become a concern. To ensure your Java application reads large Excel files efficiently:
- Load only required sheets
- Access only relevant columns or rows
- Avoid storing entire worksheets in memory
- Use row-by-row reading patterns
Here’s an efficient pattern for reading only non-empty rows:
for (int i = 1; i <= sheet.getRows().length; i++) {
Row row = sheet.getRows()[i];
if (row != null && !row.isBlank()) {
// Process only rows with data
}
}
Even though Spire.XLS handles memory efficiently, following these practices helps scale your Java Excel reading logic smoothly.
See also: Delete Blank Rows and Columns in Excel Using Java
4. Full Example: Java Program to Read Excel File
Here’s a full working Java example that reads an Excel file (users.xlsx) with extended columns such as name, email, age, department, and status. The code extracts only the original three columns (name, email, and age) and filters the output for users aged 30 or older.
import com.spire.xls.*;
public class ExcelReader {
public static void main(String[] args) {
Workbook workbook = new Workbook();
workbook.loadFromFile("users.xlsx");
Worksheet sheet = workbook.getWorksheets().get(0);
System.out.println("Name\tEmail\tAge");
for (int i = 2; i <= sheet.getLastRow(); i++) {
String name = sheet.getCellRange(i, 1).getValue();
String email = sheet.getCellRange(i, 2).getValue();
String ageText = sheet.getCellRange(i, 3).getValue();
int age = 0;
try {
age = Integer.parseInt(ageText);
} catch (NumberFormatException e) {
continue; // Skip rows with invalid age data
}
if (age >= 30) {
System.out.println(name + "\t" + email + "\t" + age);
}
}
}
}
Result of Java program reading the Excel file and printing its contents. 
This code demonstrates how to read specific cells from an Excel file in Java and output meaningful tabular data, including applying filters on data such as age.
5. Summary
To summarize, this article showed you how to read Excel files in Java using Spire.XLS, including both .xls and .xlsx formats. You learned how to:
- Set up your Java project with Excel-reading capabilities
- Read Excel files using Java in row-by-row or stream-based fashion
- Handle legacy and modern Excel formats with the same API
- Apply best practices when working with large Excel files
Whether you're reading from an uploaded spreadsheet, a static report, or a stream-based file, the examples provided here will help you build robust Excel processing features in your Java applications.
If you want to unlock all limitations and experience the full power of Excel processing, you can apply for a free temporary license.
6. FAQ
Q1: How to read an Excel file dynamically in Java?
To read an Excel file dynamically in Java—especially when the number of rows or columns is unknown—you can use getLastRow() and getLastColumn() methods to determine the data range at runtime. This ensures that your program can adapt to various spreadsheet sizes without hardcoded limits.
Q2: How to extract data from Excel file in Java?
To extract data from Excel files in Java, load the workbook and iterate through the cells using nested loops. You can retrieve values with getCellRange(row, column).getValue(). Libraries like Spire.XLS simplify this process and support both .xls and .xlsx formats.
Q3: How to read a CSV Excel file in Java?
If your Excel data is saved as a CSV file, you can read it using Java’s BufferedReader or file streams. Alternatively, Spire.XLS supports CSV parsing directly—you can load a CSV file by specifying the separator, such as Workbook.loadFromFile("data.csv", ","). This lets you handle CSV files along with Excel formats using the same API.
Q4: How to read Excel file in Java using InputStream?
Reading Excel files from InputStream in Java is useful in server-side applications, such as handling file uploads. With Spire.XLS, simply call workbook.loadFromStream(inputStream) and process it as you would with any file-based Excel workbook.
Spire.PDF for Python 11.6.1 supports converting PDF to Markdown
We are pleased to announce the release of Spire.PDF for Python 11.6.1. This version introduces support for the Linux Aarch64 platform and adds the highly anticipated PDF to Markdown conversion feature. Additionally, several known issues have been resolved, including a critical bug encountered during OFD to PDF conversion. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREPDF-6436 | Adds support for Linux Aarch64 platform. |
| New feature | SPIREPDF-7508 | Supports converting PDF to Markdown. |
| Bug | SPIREPDF-6746 | Fixes the issue where converting OFD to PDF throws an "Arg_NullReferenceException" error. |
| Bug | SPIREPDF-6999 | Fixes the issue that causes incorrect retrieval of signature fields in PDF documents. |
| Bug | SPIREPDF-7047 | Fixes the issue where extracting text from PDF results in incomplete content. |
| Bug | SPIREPDF-7052 | Fixes the issue where retrieving bold formatting in searched text throws an exception. |
| Bug | SPIREPDF-7103 | Fixes the issue where converting PDF to Linearized PDF throws an "AttributeError". |
How to Read PDFs in Java: Extract Text, Images, and More

In today's data-driven landscape, reading PDF files effectively is essential for Java developers. Whether you're handling scanned invoices, structured reports, or image-rich documents, the ability to read PDFs in Java can enhance workflows and reveal critical insights.
This guide will walk you through practical implementations using Spire.PDF for Java to master PDF reading in Java. You will learn to extract searchable text, retrieve embedded images, read tabular data, and perform OCR on scanned PDF documents.
Table of Contents:
- Java Library for Reading PDF Content
- Extract Text from Searchable PDFs
- Retrieve Images from PDFs
- Read Table Data from PDF Files
- Convert Scanned PDFs to Text via OCR
- Conclusion
- FAQs
Java Library for Reading PDF Content
When it comes to reading PDF in Java, choosing the right library is half the battle. Spire.PDF stands out as a robust, feature-rich solution for developers. It supports text extraction, image retrieval, table parsing, and even OCR integration. Its intuitive API and comprehensive documentation make it ideal for both beginners and experts.
To start extracting PDF content, download Spire.PDF for Java from our website and add it as a dependency in your project. If you’re using Maven, include the following in your pom.xml:
<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.pdf</artifactId>
<version>11.5.2</version>
</dependency>
</dependencies>
Below, we’ll explore how to leverage Spire.PDF for various PDF reading tasks.
Extract Text from Searchable PDFs in Java
Searchable PDFs store text in a machine-readable format, allowing for efficient content extraction. The PdfTextExtractor class in Spire.PDF provides a straightforward way to access page content, while PdfTextExtractOptions allows for flexible extraction settings, including options for handling special text layouts and specifying areas for extraction.
Step-by-Step Guide
- Initialize a new instance of PdfDocument to work with your PDF file.
- Use the loadFromFile method to load the desired PDF document.
- Loop through each page of the PDF using a for loop.
- For each page, create an instance of PdfTextExtractor to facilitate text extraction.
- Create a PdfTextExtractOptions object to specify how text should be extracted, including any special strategies.
- Call the extract method on the PdfTextExtractor instance to retrieve the text from the page.
- Write the extracted text to a text file.
The example below shows how to retrieve text from every page of a PDF and output it to individual text files.
import com.spire.pdf.PdfDocument;
import com.spire.pdf.PdfPageBase;
import com.spire.pdf.texts.PdfTextExtractOptions;
import com.spire.pdf.texts.PdfTextExtractor;
import com.spire.pdf.texts.PdfTextStrategy;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class ExtractTextFromSearchablePdf {
public static void main(String[] args) throws IOException {
// Create a PdfDocument object
PdfDocument doc = new PdfDocument();
// Load a PDF file
doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\Input.pdf");
// Iterate through all pages
for (int i = 0; i < doc.getPages().getCount(); i++) {
// Get the current page
PdfPageBase page = doc.getPages().get(i);
// Create a PdfTextExtractor object
PdfTextExtractor textExtractor = new PdfTextExtractor(page);
// Create a PdfTextExtractOptions object
PdfTextExtractOptions extractOptions = new PdfTextExtractOptions();
// Specify extract option
extractOptions.setStrategy(PdfTextStrategy.None);
// Extract text from the page
String text = textExtractor.extract(extractOptions);
// Define the output file path
Path outputPath = Paths.get("output/Extracted_Page_" + (i + 1) + ".txt");
// Write to a txt file
Files.write(outputPath, text.getBytes());
}
// Close the document
doc.close();
}
}
Result:

Retrieve Images from PDFs in Java
The PdfImageHelper class in Spire.PDF enables efficient extraction of embedded images from PDF documents. It identifies images using PdfImageInfo objects, allowing for easy saving as standard image files.
Step-by-Step Guide
- Initialize a new instance of PdfDocument to work with your PDF file.
- Use the loadFromFile method to load the desired PDF.
- Instantiate PdfImageHelper to assist with image extraction.
- Loop through each page of the PDF.
- For each page, retrieve all image information using the getImagesInfo method.
- Loop through the retrieved image information, extract each image, and save it as a PNG file.
The following example extracts all embedded images from a PDF document and saves them as individual PNG files.
import com.spire.pdf.PdfDocument;
import com.spire.pdf.PdfPageBase;
import com.spire.pdf.utilities.PdfImageHelper;
import com.spire.pdf.utilities.PdfImageInfo;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class ExtractAllImages {
public static void main(String[] args) throws IOException {
// Create a PdfDocument object
PdfDocument doc = new PdfDocument();
// Load a PDF document
doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\Input.pdf");
// Create a PdfImageHelper object
PdfImageHelper imageHelper = new PdfImageHelper();
// Declare an int variable
int m = 0;
// Iterate through the pages
for (int i = 0; i < doc.getPages().getCount(); i++) {
// Get a specific page
PdfPageBase page = doc.getPages().get(i);
// Get all image information from the page
PdfImageInfo[] imageInfos = imageHelper.getImagesInfo(page);
// Iterate through the image information
for (int j = 0; j < imageInfos.length; j++)
{
// Get a specific image information
PdfImageInfo imageInfo = imageInfos[j];
// Get the image
BufferedImage image = imageInfo.getImage();
File file = new File(String.format("output/Image-%d.png",m));
m++;
// Save the image file in PNG format
ImageIO.write(image, "PNG", file);
}
}
// Clear up resources
doc.dispose();
}
}
Result:

Read Table Data from PDF Files in Java
For PDF tables that need conversion to structured data, PdfTableExtractor intelligently recognizes cell boundaries and relationships. The resulting PdfTable objects maintain the original table organization, allowing for cell-level data export.
Step-by-Step Guide
- Initialize an instance of PdfDocument to handle your PDF file.
- Use the loadFromFile method to open the desired PDF.
- Instantiate PdfTableExtractor to facilitate table extraction.
- Iterate through each page of the PDF to extract tables.
- For each page, retrieve tables into a PdfTable array using the extractTable method.
- For each table, iterate through its rows and columns to extract data.
- Write the extracted data to individual text files.
This Java code extracts table data from a PDF document and saves each table as a separate text file.
import com.spire.pdf.PdfDocument;
import com.spire.pdf.utilities.PdfTable;
import com.spire.pdf.utilities.PdfTableExtractor;
import java.io.FileWriter;
public class ExtractTableData {
public static void main(String[] args) throws Exception {
// Create a PdfDocument object
PdfDocument doc = new PdfDocument();
// Load a PDF document
doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\Input.pdf");
// Create a PdfTableExtractor instance
PdfTableExtractor extractor = new PdfTableExtractor(doc);
// Initialize a table counter
int tableCounter = 1;
// Loop through the pages in the PDF
for (int pageIndex = 0; pageIndex < doc.getPages().getCount(); pageIndex++) {
// Extract tables from the current page into a PdfTable array
PdfTable[] tableLists = extractor.extractTable(pageIndex);
// If any tables are found
if (tableLists != null && tableLists.length > 0) {
// Loop through the tables in the array
for (PdfTable table : tableLists) {
// Create a StringBuilder for the current table
StringBuilder builder = new StringBuilder();
// Loop through the rows in the current table
for (int i = 0; i < table.getRowCount(); i++) {
// Loop through the columns in the current table
for (int j = 0; j < table.getColumnCount(); j++) {
// Extract data from the current table cell and append to the StringBuilder
String text = table.getText(i, j);
builder.append(text).append(" | ");
}
builder.append("\r\n");
}
// Write data into a separate .txt document for each table
FileWriter fw = new FileWriter("output/Table_" + tableCounter + ".txt");
fw.write(builder.toString());
fw.flush();
fw.close();
// Increment the table counter
tableCounter++;
}
}
}
// Clear up resources
doc.dispose();
}
}
Result:

Convert Scanned PDFs to Text via OCR
Scanned PDFs require special handling through OCR engine such as Spire.OCR for Java. The solution first converts pages to images using Spire.PDF's rendering engine, then applies Spire.OCR's recognition capabilities via the OcrScanner class. This two-step approach effectively transforms physical document scans into editable text while supporting multiple languages.
Step 1. Install Spire.OCR and Configure the Environment
- Download Spire.OCR for Java and add the Jar file as a dependency in your project.
- Download the model that fits in with your operating system from one of the following links, and unzip the package somewhere on your disk.
- Configure the model in your code.
OcrScanner scanner = new OcrScanner();
configureOptions.setModelPath("D:\\win-x64");// model path
For detailed steps, refer to: Extract Text from Images Using the New Model of Spire.OCR for Java
Step 2. Convert a Scanned PDF to Text
This code example converts each page of a scanned PDF into an image, applies OCR to extract text, and saves the results in a text file.
import com.spire.ocr.OcrException;
import com.spire.ocr.OcrScanner;
import com.spire.ocr.ConfigureOptions;
import com.spire.pdf.PdfDocument;
import com.spire.pdf.graphics.PdfImageType;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class ExtractTextFromScannedPdf {
public static void main(String[] args) throws IOException, OcrException {
// Create an instance of the OcrScanner class
OcrScanner scanner = new OcrScanner();
// Configure the scanner
ConfigureOptions configureOptions = new ConfigureOptions();
configureOptions.setModelPath("D:\\win-x64"); // Set model path
configureOptions.setLanguage("English"); // Set language
// Apply the configuration options
scanner.ConfigureDependencies(configureOptions);
// Load a PDF document
PdfDocument doc = new PdfDocument();
doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\Input.pdf");
// Prepare temporary directory
String tempDirPath = "temp";
new File(tempDirPath).mkdirs(); // Create temp directory
StringBuilder allText = new StringBuilder();
// Iterate through all pages
for (int i = 0; i < doc.getPages().getCount(); i++) {
// Convert page to image
BufferedImage bufferedImage = doc.saveAsImage(i, PdfImageType.Bitmap);
String imagePath = tempDirPath + File.separator + String.format("page_%d.png", i);
ImageIO.write(bufferedImage, "PNG", new File(imagePath));
// Perform OCR
scanner.scan(imagePath);
String pageText = scanner.getText().toString();
allText.append(String.format("\n--- PAGE %d ---\n%s\n", i + 1, pageText));
// Clean up temp image
new File(imagePath).delete();
}
// Save all extracted text to a file
Path outputTxtPath = Paths.get("output", "extracted_text.txt");
Files.write(outputTxtPath, allText.toString().getBytes());
// Close the document
doc.close();
System.out.println("Text extracted to " + outputTxtPath);
}
}
Conclusion
Mastering how to read PDF in Java opens up a world of possibilities for data extraction and document automation. Whether you’re dealing with searchable text, images, tables, or scanned documents, the right tools and techniques can simplify the process.
By leveraging libraries like Spire.PDF and integrating OCR for scanned files, you can build robust solutions tailored to your needs. Start experimenting with the code snippets provided and unlock the full potential of PDF processing in Java!
FAQs
Q1: Can I extract text from scanned PDFs using Java?
Yes, by combining Spire.PDF with Spire.OCR. Convert PDF pages to images and perform OCR to extract text.
Q2: What’s the best library for reading PDFs in Java?
Spire.PDF is highly recommended for its versatility and ease of use. It supports extraction of text, images, tables, and OCR integration.
Q3: Does Spire.PDF support extraction of PDF elements like metadata, attachments, and hyperlinks?
Yes, Spire.PDF provides comprehensive support for extracting:
- Metadata (title, author, keywords)
- Attachments (embedded files)
- Hyperlinks (URLs and document links)
The library offers dedicated classes like PdfDocumentInformation for metadata and methods to retrieve embedded files ( PdfAttachmentCollection ) and hyperlinks ( PdfUriAnnotation ).
Q4: How to parse tables from PDFs into CSV/Excel programmatically?
Using Spire.PDF for Java, you can extract table data from PDFs, then seamlessly export it to Excel (XLSX) or CSV format with Spire.XLS for Java. For a step-by-step guide, refer to our tutorial: Export Table Data from PDF to Excel in Java.
Get a Free License
To fully experience the capabilities of Spire.PDF for Java without any evaluation limitations, you can request a free 30-day trial license.
Python Tutorial: Delete Text Boxes in PowerPoint Automatically
Text boxes are one of the most common elements used to display content in PowerPoint. However, as slides get frequently edited, you may end up with a clutter of unnecessary text boxes. Manually deleting them can be time-consuming. This guide will show you how to delete text boxes in PowerPoint using Python. Whether you want to delete all text boxes, remove a specific one, or clean up only the empty ones, you'll learn how to do it in just a few lines of code — saving time and making your workflow much more efficient. 
- Install the Python Library
- Delete All Text Boxes
- Delete a Specific Text Box
- Delete Empty Text Boxes
- Compare All Three Methods
- FAQs
Install the Python Library for PowerPoint Automation
To make this task easier, installing the right Python library is essential. In this guide, we’ll use Spire.Presentation for Python to demonstrate how to automate the removal of text boxes in a PowerPoint file. As a standalone third-party component, Spire.Presentation doesn’t require Microsoft Office to be installed on your machine. Its API is simple and beginner-friendly, and installation is straightforward — just run:
pip install spire.presentation
Alternatively, you can download the package for custom installation. A free version is also available, which is great for small projects and testing purposes.
How to Delete All Text Boxes in PowerPoint
Let’s start by looking at how to delete all text boxes — a common need when you're cleaning up a PowerPoint template. Instead of adjusting each text box and its content manually, it's often easier to remove them all and then re-add only what you need. With the help of Spire.Presentation, you can use the IAutoShape.Remove() method to remove text boxes in just a few lines of code. Let’s see how it works in practice. Steps to delete all text boxes in a PowerPoint presentation with Python:
- Create an instance of Presentation class, and load a sample PowerPoint file.
- Loop through all slides and all shapes on slides, and check if the shape is IAutoShape and if it is a text box.
- Remove text boxes in the PowerPoint presentation through IAutoShape.Remove() method.
- Save the modified PowerPoint file.
The following is a complete code example for deleting all text boxes in a PowerPoint presentation:
from spire.presentation import *
# Create a Presentation object and load a PowerPoint file
presentation = Presentation()
presentation.LoadFromFile("E:/Administrator/Python1/input/pre1.pptx")
# Loop through all slides
for slide in presentation.Slides:
# Loop through all shapes in the slide
for i in range(slide.Shapes.Count - 1, -1, -1):
shape = slide.Shapes[i]
# Check if the shape is IAutoShape and is a text box
if isinstance(shape, IAutoShape) and shape.IsTextBox:
# Remove the shape
slide.Shapes.Remove(shape)
# Save the modified presentation
presentation.SaveToFile("E:/Administrator/Python1/output/RemoveAllTextBoxes.pptx", FileFormat.Pptx2013)
presentation.Dispose()

Warm Tip: When looping through shapes, use reverse order to avoid skipping any elements after deletion.
How to Delete a Specific Text Box in PowerPoint
If you only need to remove a few specific text boxes — for example, the first text box on the second slide — this method is perfect for you. In Python, you can first locate the target slide by its index, then identify the text box by its content, and finally remove it. This approach gives you precise control when you know exactly which text box needs to be deleted. Let’s walk through how to do this in practice. Steps to delete a specific text box in PowerPoint using Python:
- Create an object of Presentation class and read a PowerPoint document.
- Get a slide using Presentation.Slides[] property.
- Loop through each shape on the slide and check if it is the target text box.
- Remove the text box through IAutoShape.Remove() method.
- Save the modified PowerPoint presentation.
The following code demonstrates how to delete a text box with the content "Text Box 1" on the second slide of the presentation:
from spire.presentation import *
# Create a new Presentation object and load a PowerPoint file
presentation = Presentation()
presentation.LoadFromFile("E:/Administrator/Python1/input/pre1.pptx")
# Get the second slide
slide = presentation.Slides[1]
# Loop through all shapes on the slide
for i in range(slide.Shapes.Count - 1, -1, -1):
shape = slide.Shapes[i]
# Check if the shape is a text box and its text is "Text Box 1"
if isinstance(shape, IAutoShape) and shape.IsTextBox:
if shape.TextFrame.Text.strip() == "Text Box 1":
slide.Shapes.Remove(shape)
# Save the modified presentation
presentation.SaveToFile("E:/Administrator/Python1/output/RemoveSpecificTextbox.pptx", FileFormat.Pptx2013)
presentation.Dispose()
How to Delete Empty Text Boxes in PowerPoint
Another common scenario is removing all empty text boxes from a PowerPoint file — especially when you're cleaning up slides exported from other tools or merging multiple presentations and want to get rid of unused placeholders. Instead of checking each slide manually, automating the process with Python allows you to quickly remove all blank text boxes and keep only the meaningful content. It’s a far more efficient approach. Steps to delete empty text boxes in PowerPoint file using Python:
- Create an object of Presentation class, and load a PowerPoint file.
- Loop through all slides and all shapes on slides.
- Check if the shape is a text box and is empty.
- Remove text boxes in the PowerPoint presentation through IAutoShape.Remove() method.
- Save the modified PowerPoint file.
Here's the code example that shows how to delete empty text boxes in a PowerPoint presentation:
from spire.presentation import *
# Create a Presentation instance and load a sample file
presentation = Presentation()
presentation.LoadFromFile("E:/Administrator/Python1/input/pre1.pptx")
# Loop through each slide
for slide in presentation.Slides:
# Iterate through shapes
for i in range(slide.Shapes.Count - 1, -1, -1):
shape = slide.Shapes[i]
# Check if the shape is a textbox and its text is empty
if isinstance(shape, IAutoShape) and shape.IsTextBox:
text = shape.TextFrame.Text.strip()
# Remove the shape if it is empty
if not text:
slide.Shapes.Remove(shape)
# Save the result file
presentation.SaveToFile("E:/Administrator/Python1/output/RemoveEmptyTextBoxes.pptx", FileFormat.Pptx2013)
presentation.Dispose()

Compare All Three Methods: Which One Should You Use?
Each of the three methods we've discussed has its own ideal use case. If you're still unsure which one fits your needs after reading through them, the table below will help you compare them at a glance — so you can quickly pick the most suitable solution.
| Method | Best For | Keeps Valid Content? |
|---|---|---|
| Delete All Text Boxes | Cleaning up entire templates or resetting slides | ❌ No |
| Delete Specified Text Box | When you know exactly which text box to remove (e.g., slide 2, shape 1) | ✅ Yes |
| Delete Empty Text Boxes | Cleaning up imported or merged presentations | ✅ Yes |
Conclusion and Best Practice
Whether you're refreshing templates, fine-tuning individual slides, or cleaning up empty placeholders, automating PowerPoint with Python can save you hours of manual work. Choose the method that fits your workflow best — and start making your presentations cleaner and more efficient today.
FAQs about Deleting Text Boxes in PowerPoint
Q1: Why can't I delete a text box in PowerPoint?
A: One common reason is that the text box is placed inside the Slide Master layout. In this case, it can’t be selected or deleted directly from the normal slide view. You’ll need to go to the View → Slide Master tab, locate the layout, and delete it from there.
Q2: How can I delete a specific text box using Python?
A: You can locate the specific text box by accessing the slide and then searching for the shape based on its index or text content. Once identified, use the IAutoShape.Remove() method to delete it. This is useful when you know exactly which text box needs to be removed.
Q3: Is it possible to remove a text box without deleting the content?
A: If you want to keep the content but remove the text box formatting (like borders or background), you can extract the text before deleting the shape and reinsert it elsewhere — for example, as a plain paragraph. However, PowerPoint doesn’t natively support detaching text from its container without removing the shape.
How to Extract Text from Image Using Python (OCR Code Examples)

Extracting text from images using Python is a widely used technique in OCR-driven workflows such as document digitization, form recognition, and invoice processing. Many important documents still exist only as scanned images or photos, making it essential to convert visual information into machine-readable text.
With the help of powerful Python libraries, you can easily perform text extraction from image files with Python — even for multilingual documents or layout-sensitive content. In this article, you’ll learn how to use Python to extract text from an image, through practical OCR examples, useful tips, and proven methods to improve recognition accuracy.
The guide is structured as follows:
- Powerful Python Library to Extract Text from Image
- Step-by-Step: Python Code to Extract Text from Image
- Real-World Use Cases for Text Extraction from Images
- Supported Languages and Image Formats
- How to Improve OCR Accuracy (Best Practices)
- FAQ
Powerful Python Library to Extract Text from Image
Spire.OCR for Python is a powerful OCR library for Python, especially suited for applications requiring structured layout extraction and multilingual support. This Python OCR engine supports:
- Text recognition with layout and position information
- Multilingual support (English, Chinese, French, etc.)
- Supports multiple image formats including JPG, PNG, BMP, GIF, and TIFF
Setup: Install Dependencies and OCR Models
Before extracting text from images using Python, you need to install the spire.ocr library and download the OCR model files compatible with your operating system.
1. Install the Spire.OCR Python Package
Use pip to install the Spire.OCR for Python package:
pip install spire.ocr
2. Download the OCR Model Package
Download the OCR model files based on your OS:
- Windows: win-x64.zip
- Linux: linux.zip
- macOS: mac.zip
- linux_aarch: linux_aarch.zip
After downloading, extract the files and set the model path in your Python script when configuring the OCR engine.
Step-by-Step: Python Code to Extract Text from Image
In this section, we’ll walk through different ways to extract text from images using Python — starting with a simple plain-text extraction, and then moving to more advanced structured recognition.
Basic OCR Text Extraction (Image to Plain Text)
Here’s how to extract plain text from an image using Python:
from spire.ocr import *
# Create OCR scanner instance
scanner = OcrScanner()
# Configure OCR model path and language
configureOptions = ConfigureOptions()
configureOptions.ModelPath = r'D:\OCR\win-x64'
configureOptions.Language = 'English'
scanner.ConfigureDependencies(configureOptions)
# Perform OCR on the image
scanner.Scan(r'Sample.png')
# Save extracted text to file
text = scanner.Text.ToString()
with open('output.txt', 'a', encoding='utf-8') as file:
file.write(text + '\n')
Optional: Clean and Preprocess Extracted Text (Post-OCR)
After OCR, the output may contain empty lines or noise. This snippet shows how to clean the text:
# Clean extracted text: remove empty or short lines
clean_lines = [line.strip() for line in text.split('\n') if len(line.strip()) > 2]
cleaned_text = '\n'.join(clean_lines)
# Save to a clean version
with open('output_clean.txt', 'w', encoding='utf-8') as file:
file.write(cleaned_text)
Use Case: Useful for post-processing OCR output before feeding into NLP tasks or database storage.
Here’s an example of plain-text OCR output using Spire.OCR:

Extract Text from Image with Coordinates
In forms or invoices, you may need both text content and layout. The code below outputs each block’s bounding box info:
from spire.ocr import *
scanner = OcrScanner()
configureOptions = ConfigureOptions()
configureOptions.ModelPath = r'D:\OCR\win-x64'
configureOptions.Language = 'English'
scanner.ConfigureDependencies(configureOptions)
scanner.Scan(r'sample.png')
text = scanner.Text
# Extract block-level text with position
block_text = ""
for block in text.Blocks:
rectangle = block.Box
block_info = f'{block.Text} -> x: {rectangle.X}, y: {rectangle.Y}, w: {rectangle.Width}, h: {rectangle.Height}'
block_text += block_info + '\n'
with open('output.txt', 'a', encoding='utf-8') as file:
file.write(block_text + '\n')
Extract Text from Multiple Images in a Folder
You can also batch process a folder of images:
import os
from spire.ocr import *
def extract_text_from_folder(folder_path, model_path):
scanner = OcrScanner()
config = ConfigureOptions()
config.ModelPath = model_path
config.Language = 'English'
scanner.ConfigureDependencies(config)
for filename in os.listdir(folder_path):
if filename.lower().endswith(('.png', '.jpg', '.jpeg')):
image_path = os.path.join(folder_path, filename)
scanner.Scan(image_path)
text = scanner.Text.ToString()
# Save each result as a separate file
output_file = os.path.splitext(filename)[0] + '_output.txt'
with open(output_file, 'w', encoding='utf-8') as f:
f.write(text)
# Example usage
extract_text_from_folder(r'D:\images', r'D:\OCR\win-x64')
The recognized text blocks with position information are shown below:

Real-World Use Cases for Text Extraction from Images
Python-based OCR can be applied in:
- ✅ Invoice and receipt scanning
- ✅ Identity document OCR (passport, license)
- ✅ Business card digitization
- ✅ Form and survey data extraction
- ✅ Multilingual document indexing
Tip: For text extraction from PDF documents instead of images, you might also want to explore this tutorial on extracting text from PDF using Python.
Supported Languages and Image Formats
Spire.OCR supports multiple languages and a wide range of image formats for broader application scenarios.
Supported Languages:
- English
- Simplified / Traditional Chinese
- French
- German
- Japanese
- Korean
You can set the language using configureOptions.Language.
Supported Image Formats:
- JPG / JPEG
- PNG
- BMP
- GIF
- TIFF
How to Improve OCR Accuracy (Best Practices)
For better OCR text extraction from images using Python, follow these tips:
- Use high-resolution images (≥300 DPI)
- Preprocess with grayscale, thresholding, or denoising
- Avoid skewed or noisy scans
- Match the OCR language with the image content
FAQ
How to extract text from an image in Python code?
To extract text from an image using Python, you can use an OCR library like Spire.OCR for Python. With just a few lines of Python code, you can recognize text in scanned documents or photos and convert it into editable, searchable content.
What is the best Python library to extract text from image?
Spire.OCR for Python is a powerful Python OCR library that offers high-accuracy recognition, multilingual support, and layout-aware output. It also works seamlessly with Spire.Office components, allowing full automation — such as saving extracted text to Excel, Word, or searchable PDFs. You can also explore open-source tools to build your Python text extraction from image projects, depending on your specific needs and preferences.
How to extract data (including position) from image in Python?
When performing text extraction from image using Python, Spire.OCR provides not just the recognized text, but also bounding box coordinates for each block — ideal for processing structured content like tables, forms, or receipts.
How to extract text using Python from scanned PDF files?
To perform text extraction from scanned PDF files using Python, you can first convert each PDF page into an image, then apply OCR using Spire.OCR for Python. For this, we recommend using Spire.PDF for Python — it allows you to save PDF pages as images or directly extract embedded images from scanned PDFs, making it easy to integrate with your OCR pipeline.
Conclusion: Efficient Text Extraction from Images with Python
Thanks to powerful libraries like Spire.OCR, text extraction from images in Python is both fast and reliable. Whether you're processing receipts or building an intelligent OCR pipeline, this approach gives you precise control over both content and layout.
If you want to remove usage limitations of Spire.OCR for Python, you can apply for a free temporary license.
Spire.PDF 11.6.0 enhances the conversion from PDF to images
We're pleased to announce the release of Spire.PDF 11.6.0. This version successfully fixes some known issues that occurred when converting PDF to images, loading and previewing PDF files. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug | SPIREPDF-7302 | Fixes the issue that converting PDF to images produced incorrect results. |
| Bug | SPIREPDF-7491 | Fixed the issue where the program threw an "ArgumentOutOfRangeException" error when loading a PDF file. |
| Bug | SPIREPDF-7525 | Fixed the issue where the program threw a "NullReferenceException" when calling the PdfDocument.Preview() method. |
Spire.Office 10.5.0 is released
We're pleased to announce the release of Spire.Office 10.5.0. This version adds many new features, for example, Spire.Doc supports writing MHTML format files; Spire.XLS supports detecting and deleting duplicate rows; Spire.PDF supports printing on Windows and Linux systems using .NET Standard DLL; Spire.Presentation supports inserting formulas in table cells. What’s more, a series of issues occurred when processing, converting Word/ Excel/ PDF/ PowerPoint files have been successfully fixed. More details are given below.
In this version, the most recent versions of Spire.Doc, Spire.PDF, Spire.XLS, Spire.Presentation, Spire.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, Spire.Barcode are included.
DLL Versions:
- Spire.Doc.dll: v13.5.11
- Spire.Pdf.dll: v11.5.9
- Spire.XLS.dll: v15.5.2
- Spire.Presentation.dll: v10.5.10
- Spire.Barcode.dll: v7.3.7
- Spire.Email.dll: v6.6.3
- Spire.DocViewer.Forms.dll: v8.8.4
- Spire.PdfViewer.Asp.dll: v8.1.3
- Spire.PdfViewer.Forms.dll: v8.1.3
- Spire.Spreadsheet.dll: v7.5.2
- Spire.OfficeViewer.Forms.dll: v8.8.0
- Spire.DataExport.dll: 4.9.0
- Spire.DataExport.ResourceMgr.dll: v2.1.0
Here is a list of changes made in this release
Spire.Doc
| Category | ID | Description |
| New feature | - | Supports writing MHTML format files. |
| Adjustment | - | Upgrades the version of HarfBuzzSharp and SkiaSharp on Net (net4.6, 4.8), NetCore, and NetStandard platforms. HarfBuzzSharp -> 8.3.0.1, SkiaSharp -> 3.116.1 |
| Adjustment | - | Optimized the waiting time for downloading images from a Uri. The Netstandard reference adjustment is as follows: <PackageReference Include="HarfBuzzSharp" Version="8.3.0.1" /> |
| Adjustment | - | Adds DLL for .NET 9.0 Framework and removes DLL for .NET 7.0 Framework. System.Drawing.Common >= 9.0.0 |
| Bug | SPIREDOC-10409 | Fixes the issue that the text filled in merged cells would cause the merge to be lost. |
| Bug | SPIREDOC-10867 | Fixes the issue that the content was incorrect when converting Word documents to PDF documents. |
| Bug | SPIREDOC-11072 | Fixes the issue that the URL failed to display after converting MarkDown to Word. |
| Bug | SPIREDOC-11081 | Fixes the issue that the program threw the "InvalidOperationException" exception when converting Word to HTML stream. |
| Bug | SPIREDOC-11081 | Fixes the issue that the program threw the "Object reference not set to an instance of an object" exception when loading Word document. |
| Bug | SPIREDOC-11094 | Fixes the issue that the program threw the "NullReferenceException" exception when converting MarkDown to Word. |
| Bug | SPIREDOC-10418 SPIREDOC-10762 |
Fixes the issue where inconsistent pagination occurred when converting Word to PDF. |
| Bug | SPIREDOC-11177 | Fixes the issue that font embedding was incorrect when converting Word to PDF. |
| Bug | SPIREDOC-11220 | Fixes the issue where the "Allow row to break across pages" setting was lost when loading saved documents. |
| Bug | SPIREDOC-11230 | Fixes the issue where the program threw "System.ArgumentException" when loading a Word document. |
| Bug | SPIREDOC-11253 | Fixes the issue where the values of content controls couldn't be modified. |
| Bug | SPIREDOC-11260 | Fixes the issue where the program threw "System.ArgumentException" when merging files. |
Spire.XLS
| Category | ID | Description |
| New feature | SPIREXLS-5695 | Supports the RANK.AVG formula.workbook.Worksheets[0].Range["E9"].Formula = "=RANK.AVG(10,A1:A6)"; |
| New feature | SPIREXLS-5696 | Supports the RANK.EQ formula.//Default descending order |
| New feature | SPIREXLS-5722 | Supports the PERCENTILE.INC formula.workbook.Worksheets[0].Range["D2"].Formula = "=PERCENTILE.INC(\"\", 0.3)"; |
| New feature | SPIREXLS-5723 | Supports the PERCENTILE.EXC formula.workbook.Worksheets[0].Range["D2"].Formula = "=PERCENTILE.EXC(\"\", 0.3)"; |
| New feature | SPIREXLS-5729 | Supports the BINOM.DIST formula.workbook.Worksheets[0].Range["D2"].Formula = "=BINOM.DIST(A7, A11, A12, FALSE)"; |
| New feature | SPIREXLS-5730 | Supports the BINOM.INV formula.workbook.Worksheets[0].Range["D2"].Formula = "=BINOM.INV(A7, A12, A13)"; |
| New feature | SPIREXLS-5734 | Supports the NEGBINOM.DIST formula.workbook.Worksheets[0].Range["C10"].Formula = "=NEGBINOM.DIST(10,5,1,TRUE)"; |
| New feature | SPIREXLS-5738 | Supports the BINOM.DIST.RANGE formula.workbook.Worksheets[0].Range["C6"].Formula = "=BINOM.DIST.RANGE(10, 2, 5)"; |
| New feature | SPIREXLS-5739 | Supports the BETA.DIST formula.workbook.Worksheets[0].Range["C7"].Formula = "=BETA.DIST(3, 0, 5, TRUE, 1, 5)"; |
| New feature | SPIREXLS-5740 | Supports the BETA.INV formula.workbook.Worksheets[0].Range["C7"].Formula = "=BETA.INV(0.685470581, 8, -1, 1, 3)"; |
| New feature | SPIREXLS-5742 | Supports the ROUNDBANK formula.workbook.Worksheets[0].Range["B3"].Formula = "=ROUNDBANK(1245585, -1)"; |
| New feature | SPIREXLS-5743 | Supports the GAMMA formula.workbook.Worksheets[0].Range["B3"].Formula = "=GAMMA(ss)"; |
| New feature | SPIREXLS-5744 | Supports the GAMMA.DIST formula.workbook.Worksheets[0].Range["B10"].Formula = "=GAMMA.DIST(10.0001131, 9, 0, TRUE)"; |
| New feature | SPIREXLS-5745 | Supports the GAMMA.INV formula.workbook.Worksheets[0].Range["B10"].Formula = "=GAMMA.INV(0.068094, 0, 2)"; |
| New feature | SPIREXLS-5748 | Supports the TAKE formula.workbook.Worksheets[0].Range["J16"].Formula = "=TAKE(A1:F6,3)"; |
| New feature | SPIREXLS-5751 | Supports the HSTACK formula.workbook.Worksheets[0].Range["G26"].Formula = "=HSTACK(E1:F7,G1:G6)"; |
| New feature | SPIREXLS-5697 | Supports auto-fitting row height in merged cells spanning multiple columns in a single row.Workbook workbook = new Workbook(); |
| New feature | SPIREXLS-5746 SPIREXLS-5768 SPIREXLS-5769 SPIREXLS-5774 | Supports the GAMMALN.PRECISE, LOGNORM.INV, LOGNORM.DIST, and GAUSS formulas.sheet.Range["C2"].Formula = "=GAUSS(A1)"; |
| New feature | SPIREXLS-5787 | Supports detecting and deleting duplicate rows.// Remove duplicate rows in the worksheet |
| New feature | SPIREXLS-5793 SPIREXLS-5797 SPIREXLS-5798 SPIREXLS-5801 | Supports new functions (TRIMRANGE, ERF.PRECISE, ERFC.PRECISE, and PERMUTATIONA).sheet.Range["A45"].Formula = "=TRIMRANGE(A1:H10, 1, 1)"; |
| Bug | SPIREXLS-5653 | Fixes the issue where content was not fully displayed when converting Excel to PDF. |
| Bug | SPIREXLS-5706 | Fixes the issue where the program threw an "ArgumentOutOfRangeException" when loading Excel documents. |
| Bug | SPIREXLS-5713 | Fixes the issue where incorrect data was generated when converting Excel to PDF. |
| Bug | SPIREXLS-5716 | Fixes the issue where charts were incorrect when converting Excel to PDF. |
| Bug | SPIREXLS-5719 | Fixes the issue where content was stretched when converting Excel to PDF. |
| Bug | SPIREXLS-5721 | Fixes the issue where the structure protection password was lost when saving Excel documents. |
| Bug | SPIREXLS-5735 | Fixes the issue where setting FormatConditionType.ColorScale had no effect or produced incorrect results. |
| Bug | SPIREXLS-5749 | Improves behavior to prevent throwing "InvalidOperationException: Cannot find font installed on the system" when no fonts are available on the system. |
| Bug | SPIREXLS-5555 | Fixes the issue where data was incomplete when converting Excel to PDF with the SheetFitToPage=true property. |
| Bug | SPIREXLS-5724 | Fixes the inconsistency issue when converting Excel to PDF. |
| Bug | SPIREXLS-5725 | Fixes the issue where the text was displayed incorrectly when converting Excel to PDF. |
| Bug | SPIREXLS-5767 | Fixes the issue that the XML data for ColumnWidth did not comply with OpenXML standards. |
| Bug | SPIREXLS-5775 | Fixes the issue that it was where failed to update the associated sheets when modifying the row count in a sheet. |
| Bug | SPIREXLS-5777 | Fixes the issue where shapes were incorrect in the saved Excel file. |
| Bug | SPIREXLS-5778 | Fixed the issue that the IFERROR formula returned incorrect values. |
| Bug | SPIREXLS-5785 | Fixes the issue that getting the font of cell text was incorrect. |
| Bug | SPIREXLS-5792 | Fixes the issue that the sorting results were incorrect. |
| Bug | SPIREXLS-5796 | Fixes the issue that the program threw “ArgumentOutOfRangeExceltion” when loading an Excel document. |
Spire.PDF
| Category | ID | Description |
| New feature | SPIREPDF-7372 | Supports retrieving PdfHideAction in buttons.//Initialize an instance of the PdfDocument instance |
| New feature | SPIREPDF-7376 SPIREPDF-7391 SPIREPDF-7467 | Supports printing on Windows and Linux systems using .NET Standard DLL.PdfDocument doc = new PdfDocument(); |
| Bug | SPIREPDF-6717 | Fixes the issue that removing the checkbox's background color and border did not take effect. |
| Bug | SPIREPDF-7348 | Fixes the issue that standards validation failed when converting PDF to A1A and A1B. |
| Bug | SPIREPDF-7352 | Fixes the issue that button field actions could not be obtained. |
| Bug | SPIREPDF-7355 | Fixes the issue that transparency was incorrect when setting background colors. |
| Bug | SPIREPDF-7356 | Fixes the issue that the number of annotations in a PDF document was not correctly retrieved. |
| Bug | SPIREPDF-7358 | Fixes the issue that extra content appeared when extracting text from PDF tables. |
| Bug | SPIREPDF-7366 | Fixes the issue that the program threw the exception System.NullReferenceException: "Object reference not set to an instance of an object." when getting the destination of bookmarks. |
| Bug | SPIREPDF-7375 | Fixes the issue that the multiline content added into textbox fields was being truncated. |
| Bug | SPIREPDF-7361 | Fixes the issue that adding PdfTextMarkupAnnotation produced incorrect effects. |
| Bug | SPIREPDF-7380 | Fixes the issue where the text was garbled when converting PDF to images. |
| Bug | SPIREPDF-7388 | Fixes the issue where the application threw the “NullReferenceException” when accessing PdfDocumentLinkAnnotationWidget.Destination. |
| Bug | SPIREPDF-7414 | Fixes the issue where the text was truncated when entering multi-line content into PdfTextBoxField. |
| Bug | SPIREPDF-7420 | Fixes the issue where the application threw the “PdfDocumentException” when using the PdfDocument.IsPasswordProtected() method. |
| Bug | SPIREPDF-7424 | Fixes the issue where the application threw the “ArgumentOutOfRangeException” when converting PDF to images. |
| Bug | SPIREPDF-7426 | Fixes the issue that the/DA structure was incorrect in TextBox fields. |
| Bug | SPIREPDF-7429 | Fixes the issue where the application threw the "Empty convert-string" error when saving PDF documents. |
| Bug | SPIREPDF-7431 | Fixes the issue where the result was incorrect when setting FieldsWidget.BorderColor = PdfRGBColor.Empty. |
| Bug | SPIREPDF-7239 | Fixes the issue that the characters of formulas were lost when converting PDF to XPS. |
| Bug | SPIREPDF-7437 | Fixes the issue that the program threw “Empty convert-string” error when saving PDF documents. |
| Bug | SPIREPDF-7441 | Fixes the issue that the program threw “IndexOutOfRangeException” error when converting PDF to PDFA3B. |
Spire.Presentation
| Category | ID | Description |
| New feature | SPIREPPT-2772 | Supports reading CustomerData of Shape.Presentation ppt = new Presentation(); |
| New feature | SPIREPPT-2782 | Supports inserting formulas in table cells.//Create a PPT document |
| New feature | - | Adds a new method ‘AddFromSVGAsShape()’ to convert SVG files into shapes.Presentation ppt = new Presentation(); |
| Bug | SPIREXLS-5749 | Fixes the issue that converting PPT to SVG resulted in incorrect shapes. |
| Bug | SPIREPPT-2663 | Fixes the issue where modifying data in PPT charts resulted in incorrect output. |
| Bug | SPIREPPT-2740 | Fixes the issue that converting PPT to PDF rendered incorrectly. |
| Bug | SPIREPPT-2751 | Fixes the issue where loading a PPT document threw a "FormatException." |
| Bug | SPIREPPT-2775 | Fixes the issue that inserting HTML content into a PPT document rendered incorrectly. |
| Bug | SPIREPPT-2421 | Fixes the issue where the text was garbled when converting PowerPoint to PDF. |
| Bug | SPIREPPT-2691 | Fixes the issue that the application threw a "System.NullReferenceException" error when adding a GroupShape to a new PowerPoint file. |
| Bug | SPIREPPT-2798 | Fixes the issue where the text was lost when converting PowerPoint to PDF. |
| Bug | SPIREPPT-2804 | Fixes the issue where opening a file saved using the Presentation.GetStream() method would cause an error. |
| Bug | SPIREPPT-2824 | Fixes the issue where the position of shapes changed after using the Ungroup() method. |
| Bug | SPIREPPT-2840 | Fixes the issue that the application threw a "NullReferenceException" error when converting PowerPoint to SVG. |
| Bug | SPIREPPT-2851 | Fixes the issue where the shapes were incorrect when converting PowerPoint to SVG. |
| Bug | SPIREPPT-2858 | Fixes the issue that there was incorrect text content when converting a specific PPT document to PDF. |
| Bug | SPIREPPT-2842 | Fixes the issue where Microsoft Powerpoint displayed an error message when opening a PPT file that was directly loaded and saved. |
Spire.PDFViewer
| Category | ID | Description |
| Bug | SPIREPDFVIEWER-592 | Fixes the issue of incorrect preview of PDF content. |
| Bug | SPIREPDFVIEWER-603 | Fixes the issue of incorrect horizontal and vertical scrollbar effects. |
| Bug | SPIREPDFVIEWER-606 | Fixes the issue that the control threw “NullReferenceException” after setting the “Anchor” property. |
Spire.DocViewer
| Category | ID | Description |
| Adjustment | - | Upgrades the versions of HarfBuzzSharp and SkiaSharp on .NET (.NET 4.6 and 4.8) and .NET Core platforms.HarfBuzzSharp->8.3.0.1、SkiaSharp->3.116.1 |
Spire.Barcode
| Category | ID | Description |
| Adjustment | - | Adds a DLL adapted to .NET 9.0 Framework, and removes a DLL adapted to .NET 7.0 Framework. |
| Adjustment | - | Upgrading the version of HarfBuzzSharp and SkiaSharp on .NET (net4.6, 4.8), NetCore, and NetStandard platforms.HarfBuzzSharp->8.3.0.1、SkiaSharp->3.116.1 |
Spire.Email
| Category | ID | Description |
| Adjustment | - | Adds DLL for .NET 9.0 Framework and removes DLL for .NET 7.0 Framework. |
| Adjustment | - | Upgrades the version of HarfBuzzSharp and SkiaSharp on Net (net4.6, 4.8), NetCore, and NetStandard platforms:HarfBuzzSharp->8.3.0.1、SkiaSharp->3.116.1 |
Spire.Doc 13.5.11 enhances the conversion from Word to PDF
We are delighted to announce the release of Spire.Doc 13.5.11. The latest version enhances the conversion from Word to PDF. Furthermore, some known bugs are fixed in the new version, such as the issue that the values of content controls couldn't be modified. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug | SPIREDOC-10418 SPIREDOC-10762 | Fixes the issue where inconsistent pagination occurred when converting Word to PDF. |
| Bug | SPIREDOC-11177 | Fixes the issue that font embedding was incorrect when converting Word to PDF. |
| Bug | SPIREDOC-11220 | Fixes the issue where the "Allow row to break across pages" setting was lost when loading saved documents. |
| Bug | SPIREDOC-11230 | Fixes the issue where the program threw "System.ArgumentException" when loading a Word document. |
| Bug | SPIREDOC-11253 | Fixes the issue where the values of content controls couldn't be modified. |
| Bug | SPIREDOC-11260 | Fixes the issue where the program threw "System.ArgumentException" when merging files. |
Spire.Office for Java 10.5.0 is released
We're pleased to announce the release of Spire.Office for Java 10.5.0. In this version, the Spire.PDF for Java supports using the byte[] certificate data when signing with ‘digitalsignatures.PdfCertificate’. Spire.Doc for Java supports excluding table objects during document comparison and setting underline color. In addition, many known issues that occurred when converting and processing Word/ Excel/ PDF/PowerPoint files have been successfully fixed. More details are listed below.
Here is a list of changes made in this release
Spire.Doc for Java
| Category | ID | Description |
| New feature | SPIREDOC-11111 | Supports excluding table objects during document comparison.
Compareoptions compareoptions = new Compareoptions(); compareoptions.setIgnoreTable(true); docunment.compare(docunment2, "Yang Merlin", compareoptions ); |
| New feature | SPIREDOC-10501 | Supports setting underline color.
textRange.getCharacterFormat().setUnderlineColor(Color.RED); |
| Bug | SPIREDOC-10310 | Fixes the issue where the text displayed incorrectly when converting Word to PDF. |
| Bug | SPIREDOC-11087 | Fixes the issue where reading the TOC of Word document returned null. |
| Bug | SPIREDOC-11093 | Fixes the issue where extra symbols appeared when reading the TOC of Word document. |
| Bug | SPIREDOC-11108 | Fixes the issue that incorrect content was retrieved when using the ‘BookmarksNavigator.getBookmarkContent()’ method. |
| Bug | SPIREDOC-11100 | Fixes the issue that LaTeX formulas rendered incorrectly. |
| Bug | SPIREDOC-11175 | Fixes the issue that it was failed to updating the Word page number fields. |
| Bug | SPIREDOC-11176 | Fixes the issue where an "ArrayIndexOutOfBoundsException" error occurred when creating a table of contents. |
| Bug | SPIREDOC-11178 | Fixes the issue that control content retrieval returned null. |
| Bug | SPIREDOC-11190 | Fixes the issue where the characters displayed incorrectly when converting Word to PDF. |
| Bug | SPIREDOC-11200 | Fixes the issue where the characters were lost when converting Word to PDF. |
| Bug | SPIREDOC-11204 | Fixes the issue where the headers were lost when converting Word to PDF. |
| Bug | SPIREDOC-11218 | Fixes the issue that the ‘Document.updateTOCPageNumbers()’ method did not take effect. |
| Bug | SPIREDOC-11224 | Fixes the issue that the font modifications did not apply. |
| Bug | SPIREDOC-11229 | Fixes the issue that the PDFs displayed incorrectly in Chrome and WPS after converting from a Word document. |
| Bug | SPIREDOC-11232 | Fixes the issue where a "NullPointerException" occurred when converting Word to PDF. |
| Bug | SPIREDOC-11250 | Fixes the issue that incorrect results were returned when calling the ‘Paragraph.getListText()’ method. |
Spire.XLS for Java
| Category | ID | Description |
| Bug | SPIREXLS-5737 | Fixes the issue that the program threw an exception when calling Worksheet.findAllString for specific documents. |
| Bug | SPIREXLS-5750 | Fixes the issue that the images shifted upward when converting specific Excel files to HTML. |
| Bug | SPIREXLS-5765 | Fixes the issue that the program threw “ArrayIndexOutOfBoundsException” when loading specific Excel files. |
| Bug | SPIREXLS-5773 | Optimizes the issue that the time consuming for specific Excel to HTML conversion was too much. |
| Bug | SPIREXLS-5786 | Fixes the issue that the program threw “Invalid end column index” when converting specific Excel files to HTML. |
Spire.PDF for Java
| Category | ID | Description |
| New feature | SPIREPDF-7460 | Supports using the byte[] certificate data when signing with "digitalsignatures. PdfCertificate".
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputFile);
FileInputStream instream = new FileInputStream(inputFile_pfx);
byte[] data = FileUtil.getStreamBytes(instream);
PdfCertificate x509 = new PdfCertificate(data, "e-iceblue");
PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(pdf, x509);
signatureMaker.makeSignature("signName");
pdf.saveToFile(outputFile, FileFormat.PDF);
pdf.dispose();
|
| Bug | SPIREPDF-7457 | Fixes the problem that the program threw “NullPointerException” when setting isFlatten(true). |
| Bug | SPIREPDF-7458 | Fixes the issue that some contents were incorrect after converting PDF to PDF/A. |
| Bug | SPIREPDF-7463 | Fixes the issue that the format and font were incorrect after converting PDF to PowerPoint. |
| Bug | SPIREPDF-7462 | Fixes the issue that the data extracted from tables was incorrect. |
| Bug | SPIREPDF-7353 SPIREPDF-7489 | Fixes the issue that the PDF to PDF/A validation failed. |
| Bug | SPIREPDF-7481 | Fixes the issue that content was lost when converting SVG to PDF. |
| Bug | SPIREPDF-7484 | Fixes the issue that the program threw a NullPointerException when adding annotations |
| Bug | SPIREPDF-7492 | Fixes the issue that extra horizontal lines appeared when converting a PDF to Word. |
Spire.Presentation for Java
| Category | ID | Description |
| Bug | SPIREPPT-2882 | Fixes the issue where the program threw an "Exception in thread "main" java.lang.NullPointerException" when adding Latex formulas. |
