The advantages of using an online document editor over a traditional desktop application include enhanced accessibility, seamless collaboration, automatic version control, cross-platform compatibility, and reduced hardware requirements. These features make online document editors a versatile and efficient choice for users who require the ability to access, edit, and share documents from anywhere.

This article demonstrates how to create and edit MS Word, Excel and PowerPoint documents online using the Spire.Cloud.Office document editor library.

Spire.Cloud.Office Document Editor

Spire.Cloud.Office is a feature-rich HTML-5 based document editor component that can be easily integrated into web applications. With the document editor component, your end-users can view, create, edit, and collaborate on diverse document types within a web browser.

To utilize the services offered by Spire.Cloud.Office, you will need to first install it on your system.

After the installation is complete, you can integrate Spire.Cloud.Office editor in your own web application or visit the example application hosted on port 3000 to explore the editor’s functionality.

The example page offers options to upload existing documents or create new ones. Spire.Office.Cloud supports loading DOC/DOCX, XLS/XLSX, and PPT/PPTX files, and exporting files to DOCX, XLSX, and PPTX formats.

Create & Edit Word, Excel, and PowerPoint Documents Online

Create a New Document

With the "Create Document", "Create Spreadsheet", and "Create Presentation" buttons on the example page, users can create a new Word document, a new Excel spreadsheet, and a new PowerPoint presentation, respectively.

Create & Edit Word, Excel, and PowerPoint Documents Online

Upon clicking "Create Document", a new Word document named "new.docx" will be generated, and the editor will launch with the blank document ready for editing.

Create & Edit Word, Excel, and PowerPoint Documents Online

Once you've finished editing the document, click "File" on the menu and you'll get the options to download the file and save it to your local folder in the desired format.

Create & Edit Word, Excel, and PowerPoint Documents Online

Alternatively, you can click "Save" to preserve the changes made to the "new.docx" document, which can be found on the example page.

Create & Edit Word, Excel, and PowerPoint Documents Online

Edit an Existing Document

On the example page, click the "Upload File" button to load an existing document for editing.

Create & Edit Word, Excel, and PowerPoint Documents Online

Once the file has been uploaded, it will appear on the example page. To open the document in the editor, click the computer icon in the "Editors" section.

Create & Edit Word, Excel, and PowerPoint Documents Online

Use the editing tools provided in the document editor to make any desired modifications to the file. Once you have finished making changes, save the updated document by clicking "File" and then selecting "Save".

Create & Edit Word, Excel, and PowerPoint Documents Online

Co-Edit a Document

Spire.Cloud.Office's real-time collaboration features enable multiple users to work on the same document simultaneously. Two different collaborative editing modes are available under the "Review" tab - "Editing Mode".

  • Fast Mode: All editors can see the changes made to the document in real-time as they are being typed or made.
  • Strict Mode: Changes made by editors are protected and only become visible to other editors after the document has been explicitly saved.

By default, the Fast mode is enabled.

Create & Edit Word, Excel, and PowerPoint Documents Online

When a document is being collaboratively edited by multiple users, any changes made by one editor are instantly reflected in the document interface for all other editors in real-time.

Create & Edit Word, Excel, and PowerPoint Documents Online

Adding and removing watermarks in PDF documents play a crucial role in document management, copyright protection, and information security. A watermark can serve as a visual marker, such as a company logo, copyright notice, or the word "Confidential", indicating the source, status, or ownership of the document.

Spire.PDF provides a method for adding watermarks by embedding watermark annotations within the PDF document. This approach affords the flexibility to remove the watermark post-insertion, offering users greater control and options. This article will introduce how to add or remove watermark annotations in PDF documents using Spire.PDF for Java in Java projects.

Install Spire.PDF for Java

First of all, you're required to add the Spire.Pdf.jar file as a dependency in your Java program. The JAR file can be downloaded from this link. If you use Maven, you can easily import the JAR file in your application by adding the following code to your project's pom.xml file.

<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>10.6.2</version>
    </dependency>
</dependencies>
    

Add Watermark Annotations to PDF in Java

Spire.PDF provides a method to add watermark annotations to PDF pages using the PdfWatermarkAnnotation object. Notably, watermarks added by this method can be easily removed later. Here are the key steps involved:

  • Initialize an instance of the PdfDocument class.
  • Load a PDF document using the PdfDocument.loadFromFile() method.
  • Create a PdfTrueTypeFont font object to draw the watermark text.
  • Create a Rectangle2D type object to define the boundary of the page.
  • Use a for loop to iterate over all PdfPageBase objects in the PDF document.
  • Create a PdfTemplate object for drawing the watermark, setting its size to match the current page.
  • Call a custom insertWatermark() method to draw the watermark content onto the PdfTemplate object.
  • Create a PdfWatermarkAnnotation object and define the position where the watermark should be placed.
  • Create a PdfAppearance object to configure the visual effects of the watermark.
  • Use the PdfAppearance.setNormal(PdfTemplate) method to associate the PdfTemplate object with the PdfAppearance object.
  • Use the PdfWatermarkAnnotation.setAppearance(PdfAppearance) method to associate the PdfAppearance object with the PdfWatermarkAnnotation object.
  • Add the watermark annotation to the page by calling PdfPageBase.getAnnotationsWidget().add(PdfWatermarkAnnotation).
  • Save the changes to a file using the PdfDocument.saveToFile() method.
  • Java
import com.spire.pdf.*;
import com.spire.pdf.annotations.*;
import com.spire.pdf.annotations.appearance.*;
import com.spire.pdf.graphics.*;
import java.awt.*;
import java.awt.geom.*;

public class AddWatermarkInPDF {
    public static void main(String[] args) {
        // Create a PdfDocument object
        PdfDocument pdfDocument = new PdfDocument();

        // Load the PDF document from a file
        pdfDocument.loadFromFile("Sample1.pdf");

        // Set the font style
        Font font = new Font("Arial", Font.PLAIN, 22);

        // Create a PdfTrueTypeFont object for subsequent text rendering
        PdfTrueTypeFont trueTypeFont = new PdfTrueTypeFont(font);

        // Get the page object
        PdfPageBase page;

        // Define the watermark text
        String watermarkAnnotationText = "ID_0";

        // Create a size object
        Dimension2D dimension2D = new Dimension();

        // Create a rectangle object
        Rectangle2D loRect = new Rectangle2D.Float();

        // Iterate through each page in the PDF
        for (int i = 0; i < pdfDocument.getPages().getCount(); i++) {
            // Get the current page
            page = pdfDocument.getPages().get(i);

            // Set the size object to the size of the current page
            dimension2D.setSize(page.getClientSize().getWidth(), page.getClientSize().getHeight());

            // Set the rectangle object frame, which is the entire page range
            loRect.setFrame(new Point2D.Float(0, 0), dimension2D);

            // Create a PdfTemplate object to draw the watermark
            PdfTemplate template = new PdfTemplate(page.getClientSize().getWidth(), page.getClientSize().getHeight());

            // Insert the watermark
            insertWatermark(template, trueTypeFont, "Non Editable");

            // Create a PdfWatermarkAnnotation object to define the watermark position
            PdfWatermarkAnnotation watermarkAnnotation = new PdfWatermarkAnnotation(loRect);

            // Create a PdfAppearance object to set the watermark appearance
            PdfAppearance appearance = new PdfAppearance(watermarkAnnotation);

            // Set the normal state template of the watermark
            appearance.setNormal(template);

            // Set the appearance to the watermark object
            watermarkAnnotation.setAppearance(appearance);

            // Set the watermark text
            watermarkAnnotation.setText(watermarkAnnotationText);

            // Set the watermark print matrix to control the watermark's position and size
            watermarkAnnotation.getFixedPrint().setMatrix(new float[]{1, 0, 0, 1, 0, 0});

            // Set the horizontal offset
            watermarkAnnotation.getFixedPrint().setHorizontalTranslation(0.5f);

            // Set the vertical offset
            watermarkAnnotation.getFixedPrint().setVerticalTranslation(0.5f);

            // Add the watermark to the page's annotation widget
            page.getAnnotationsWidget().add(watermarkAnnotation);
        }

        // Save the PDF document to a file
        pdfDocument.saveToFile("AddWatermark.pdf");

        // Close and release the PDF document resources
        pdfDocument.dispose();
    }

    static void insertWatermark(PdfTemplate template, PdfTrueTypeFont font, String watermark) {
        // Create a Dimension2D object to set the size of the watermark
        Dimension2D dimension2D = new Dimension();

        // Set the size of the watermark to half the width and one third the height of the template
        dimension2D.setSize(template.getWidth() / 2, template.getHeight() / 3);

        // Create a PdfTilingBrush object for repeating pattern fill of the watermark
        PdfTilingBrush brush = new PdfTilingBrush(dimension2D);

        // Set the transparency of the watermark to 0.3
        brush.getGraphics().setTransparency(0.3F);

        // Start a group of graphic state saves
        brush.getGraphics().save();

        // Translate the graphics context so its center aligns with the center of the watermark tile
        brush.getGraphics().translateTransform((float) brush.getSize().getWidth() / 2, (float) brush.getSize().getHeight() / 2);

        // Rotate the graphics context to tilt the watermark at 45 degrees
        brush.getGraphics().rotateTransform(-45);

        // Draw the watermark text in the graphics context using the specified font, color, and centered alignment
        brush.getGraphics().drawString(watermark, font, PdfBrushes.getGray(), 0, 0, new PdfStringFormat(PdfTextAlignment.Center));

        // End the group of graphic state saves and restore
        brush.getGraphics().restore();

        // Reset the watermark transparency to 1, i.e., completely opaque
        brush.getGraphics().setTransparency(1);

        // Create a Rectangle2D object to define the area for filling the watermark
        Rectangle2D loRect = new Rectangle2D.Float();

        // Set the fill area for the watermark to cover the entire size of the template
        loRect.setFrame(new Point2D.Float(0, 0), template.getSize());

        // Draw the watermark on the template using the watermark tile
        template.getGraphics().drawRectangle(brush, loRect);
    }
}

Java: Add or Remove Watermark Annotations in PDF Documents

Remove Watermark Annotations from PDF in Java

Spire.PDF can remove watermark annotations added to PDF pages via the PdfWatermarkAnnotation object. Here are the detailed steps:

  • Initialize an instance of the PdfDocument class.
  • Load a PDF document using the PdfDocument.loadFromFile() method.
  • Iterate over every PdfPageBase object in the PDF document using a for loop.
  • Retrieve all annotations on the current page using the PdfPageBase.getAnnotationsWidget() method.
  • Again, use a for loop to iterate over every annotation object on the current page, filtering out annotations of type PdfWatermarkAnnotationWidget.
  • Determine the target watermark annotation by invoking the PdfWatermarkAnnotationWidget.getText() method and perform the deletion operation.
  • Save the changes to a file using the PdfDocument.saveToFile() method.
  • Java
import com.spire.pdf.*;
import com.spire.pdf.annotations.*;

public class RemoveWatermarkFromPDF {
    public static void main(String[] args) {
        // Create a PdfDocument object
        PdfDocument pdfDocument = new PdfDocument();

        // Load the PDF document from a file
        pdfDocument.loadFromFile("Sample2.pdf");

        // Define a string ID to match and remove a specific watermark
        String id = "ID_0";

        // Iterate through every page in the PDF document
        for (int i = 0; i < pdfDocument.getPages().getCount(); i++) {
            // Get all annotations on the current page
            PdfAnnotationCollection annotationWidget = pdfDocument.getPages().get(i).getAnnotationsWidget();

            // Iterate through all annotations on the current page
            for (int j = 0; j < annotationWidget.getCount(); j++) {
                // Check if the current annotation is a watermark annotation
                if (annotationWidget.get(j) instanceof PdfWatermarkAnnotationWidget) {
                    // If the watermark text equals the ID, remove the watermark
                    if (annotationWidget.get(j).getText().equals(id)) {
                        annotationWidget.remove(annotationWidget.get(j));
                    }
                }
            }
        }

        // Save the modified PDF document to a new file
        pdfDocument.saveToFile("RemoveWatermark.pdf");

        // Dispose of the PdfDocument object resources
        pdfDocument.dispose();
    }
}

Java: Add or Remove Watermark Annotations in PDF Documents

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

Markdown is a lightweight markup language that is becoming increasingly popular for writing content on the web. It offers a simple and human-readable syntax for formatting text, adding links, images, lists, and more. Many websites and content management systems support Markdown, as it can be easily converted to HTML. On the other hand, Microsoft Word is a widely used word-processing software that utilizes its own proprietary file format. While Word offers robust formatting options, its files are not always compatible with other platforms or content management systems.

In certain scenarios, it is useful to convert between Word and Markdown file formats. It allows you to take advantage of Word's advanced editing tools while also being able to publish your content in a web-friendly Markdown format. In this article, we will demonstrate how to convert Markdown to Word DOC or DOCX and convert Word DOC or DOCX to Markdown in Python using Spire.Doc for Python.

Install Spire.Doc for Python

This scenario requires Spire.Doc for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.

pip install Spire.Doc

If you are unsure how to install, please refer to this tutorial: How to Install Spire.Doc for Python on Windows

Convert Markdown to Word in Python

You can load a Markdown file using the Document.LoadFromFile(fileName, FileFormat.Markdown) method and then convert it to Word DOC or DOCX format using the Document.SaveToFile(fileName, FileFormat.Doc) or Document.SaveToFile(fileName, FileFormat.Docx) method. The detailed steps are as follows.

  • Create an object of the Document class.
  • Load a Markdown file using the Document.LoadFromFile(fileName, FileFormat.Markdown) method.
  • Save the Markdown file to a Word DOC or DOCX file using Document.SaveToFile(fileName, FileFormat.Doc) or Document.SaveToFile(fileName, FileFormat.Docx) method.
  • Python
from spire.doc import *
from spire.doc.common import *

# Create an object of the Document class
document = Document()
# Load a Markdown file
document.LoadFromFile("input.md")

# Save the Markdown file to a Word DOCX file
document.SaveToFile("MdToDocx.docx", FileFormat.Docx)
# Save the Markdown file to a Word DOC file
document.SaveToFile("MdToDoc.doc", FileFormat.Doc)
document.Close()

Python: Convert Markdown to Word or Word to Markdown

Convert Word to Markdown in Python

You are also able to convert a Word DOC or DOCX file to Markdown format using the Document.SaveToFile(fileName, FileFormat.Markdown) method. The detailed steps are as follows.

  • Create an object of the Document class.
  • Load a Word DOC or DOCX file using the Document.LoadFromFile(fileName) method.
  • Save the Word DOC or DOCX file to a Markdown file using Document.SaveToFile(fileName, FileFormat.Markdown) method.
  • Python
from spire.doc import *
from spire.doc.common import *

# Create an object of the Document class
document = Document()
# Load a Word DOCX file
document.LoadFromFile("input.docx")
# Or load a Word DOC file
#document.LoadFromFile("input.doc")

# Save the Word file to a Markdown file
document.SaveToFile("WordToMarkdown.md", FileFormat.Markdown)
document.Close()

Python: Convert Markdown to Word or Word to Markdown

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

Converting a document from Word to TIFF can be useful when you need to share the content as an image file, such as for electronic forms, presentations, or publishing. The TIFF format preserves the visual layout and appearance of the document. Conversely, converting a TIFF image to a Word document can be helpful when you want to present information in the Word format.

This article demonstrates how to convert Word to TIFF and TIFF to Word (non-editable) using Python and the Spire.Doc for Python library.

Install the Required Libraries

This situation relies on the combination of Spire.Doc for Python and Pillow (PIL). Spire.Doc is used to read, create and convert Word documents, while the PIL library is used for handling TIFF files and accessing their frames.

The libraries can be easily installed on your device through the following pip commands.

pip install Spire.Doc
pip install pillow

Convert Word to TIFF in Python

To convert a Word document into a TIFF image, the initial step is to use the Spire.Doc library to load the Word document and transform the individual pages into image data streams. Then, you can leverage the functionality provided by the PIL to merge these separate image streams into a unified TIFF image.

The following are the steps to convert Word to TIFF using Python.

  • Create a Document object.
  • Load a Word document from a specified file path.
  • Iterate through the pages in the document.
    • Convert each page into an image stream using Document.SaveImageToSteams() method.
    • Convert the image stream into a PIL image.
  • Combine these PIL images into a single TIFF image.
  • Python
from spire.doc import *
from spire.doc.common import *

from PIL import Image
from io import BytesIO

# Create a Document object
doc = Document()

# Load a Word document
doc.LoadFromFile("C:\\Users\\Administrator\\Desktop\\Input.docx")

# Create an empty list to store PIL Images
images = []

# Iterate through pages in the document
for i in range(doc.GetPageCount()):

    # Convert a specific page to image stream
    with doc.SaveImageToStreams(i, ImageType.Bitmap) as imageData:

        # Open a specific image stream as a PIL image
        img = Image.open(BytesIO(imageData.ToArray())) 

        # Append the PIL image to list
        images.append(img)

# Save the PIL Images as a multi-page TIFF file
images[0].save("Output/ToTIFF.tiff", save_all=True, append_images=images[1:])

# Dispose resources
doc.Dispose()

Python: Convert Word to TIFF and TIFF to Word

Convert TIFF to Word in Python

By utilizing PIL library, you can load a TIFF file and break it down into separate PNG images for each frame. You can then utilize the Spire.Doc library to incorporate these separate PNG files as distinct pages within a Microsoft Word document.

To convert a TIFF image to a Word document using Python, follow these steps.

  • Create a Document object.
  • Add a section to it and set the page margins to zero.
  • Load a TIFF image.
  • Iterate though the frames in the TIFF image.
    • Get a specific frame, and save it as a PNG file.
    • Add a paragraph to the section.
    • Append the image file to the paragraph.
    • Set the page size to be the same as the image size.
  • Save the document to a Word file.
  • Python
from spire.doc import *
from spire.doc.common import *

from PIL import Image
import io

# Create a Document object
doc = Document()

# Add a section
section = doc.AddSection()

# Set margins to 0
section.PageSetup.Margins.All = 0.0

# Load a TIFF image
tiff_image = Image.open("C:\\Users\\Administrator\\Desktop\\TIFF.tiff")

# Iterate through the frames in it
for i in range(tiff_image.n_frames):

    # Go to the current frame
    tiff_image.seek(i)
    
    # Extract the image of the current frame
    frame_image = tiff_image.copy()

    # Save the image to a PNG file
    frame_image.save(f"temp/output_frame_{i}.png")

    # Add a paragraph
    paragraph = section.AddParagraph()

    # Append image to the paragraph
    image = paragraph.AppendPicture(f"temp/output_frame_{i}.png")

    # Get image width and height
    width = image.Width
    height  = image.Height

    # Set the page size to be the same as the image size
    section.PageSetup.PageSize = SizeF(width, height)

# Save the document to a Word file
doc.SaveToFile("Output/ToWord.docx",FileFormat.Docx2019)

# Dispose resources
doc.Dispose()

Python: Convert Word to TIFF and TIFF to Word

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

The ability to export data from Excel files to databases, and vice versa, has become a crucial functionality in data management. Exporting data from an Excel file to a database offers scalability and enhanced security, enabling efficient handling of large datasets and facilitating collaboration with concurrency control. Conversely, importing data from databases into Excel provides the familiar spreadsheet interface for data analysis, visualization, and presentation, making complex information accessible to users. With the powerful Python language, developers can easily automate the transfer of data between databases and spreadsheets.

This article demonstrates how to use Spire.XLS for Python to export data from a database to Excel files and import data from Excel files to a database with simple Python code, taking the SQLite database as the example.

Install Spire.XLS for Python

This scenario requires Spire.XLS for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.

pip install Spire.XLS

If you are unsure how to install, please refer to: How to Install Spire.XLS for Python on Windows

Export Data from a Database to an Excel File with Python

Spire.XLS for Python offers a range of classes, methods, and properties to create, read, and edit Excel workbooks. Developers can use the sqlite3 module from the Python standard library to read data from databases and utilize Spire.XLS for Python to create Excel files and write data into them, thereby enabling the export of database data to Excel worksheets.

The detailed steps are as follows:

  • Connect to a database.
  • Create an instance of Workbook class and clear the default worksheets.
  • Iterate through the tables in the database to get all the column names and the data in the columns.
  • Create a worksheet for each table using Workbook.Worksheets.Add() method, write the column names to the header row of the worksheet, and then write data to other rows through Worksheet.Range[].Value property.
  • Format the worksheet.
  • Save the workbook using Workbook.SaveToFile() method.
  • Python
from spire.xls import *
from spire.xls.common import *
import sqlite3

# Connect to database
conn = sqlite3.connect("Sales Data.db")
cursor = conn.cursor()

# Get all the table names in the database
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
tableNames = [name[0] for name in cursor.fetchall()]

# Create an Excel file
workbook = Workbook()
workbook.Worksheets.Clear()

# Iterate through each table in the database
for tableName in tableNames:
    # Get the column names of the table
    cursor.execute(f"PRAGMA table_info('{tableName}')")
    columnsInfo = cursor.fetchall()
    columnNames = [columnInfo[1] for columnInfo in columnsInfo]

    # Get the data of the table
    cursor.execute(f"SELECT * FROM {tableName}")
    rows = cursor.fetchall()
    
    # Create a worksheet
    sheet = workbook.Worksheets.Add(tableName)
    
    # Write the header to the worksheet
    for i in range(len(columnNames)):
        sheet.Range[1, i + 1].Value = columnNames[i]
    
    # Write the data to the worksheet
    for j in range(1, len(rows)):
        column = rows[j]
        for k in range(len(column)):
            sheet.Range[j + 1, k + 1].Value = column[k]
    
    # Format the worksheet
    sheet.AllocatedRange.Style.Font.FontName = "Times New Roman"
    sheet.AllocatedRange.Style.Font.Size = 12.0
    sheet.AllocatedRange.AutoFitRows()
    sheet.AllocatedRange.AutoFitColumns()

# Save the Excel file
workbook.SaveToFile("output/DataBaseToExcel.xlsx", FileFormat.Version2016)
workbook.Dispose()
conn.close()

Python: Export and Import Data Between Excel Files and Databases

Export Data from an Excel Worksheet to a Database with Python

Spire.XLS for Python can also assist developers in reading various types of data from Excel files, and then developers can use sqlite3 to write the data to a database. Below are the detailed steps:

  • Create an instance of Workbook class.
  • Load an Excel workbook using Workbook.LoadFromFile() method.
  • Connect to a database.
  • Iterate through the worksheets in the workbook.
  • Get a worksheet using Workbook.Worksheets.get_Item() method and get the name of the worksheet using Worksheet.Name property.
  • Get the data in the header row through Worksheet.Range[].Value property.
  • Create a table in the database with the worksheet name as the table name and create columns in the table with the header row data as the column names.
  • Get the values from the worksheet cells through Worksheet.Range[].Value property and write them to the corresponding position in the database table.
  • Commit the changes and close the connection.
  • Python
from spire.xls import *
from spire.xls.common import *
import sqlite3

# Create an instance of Workbook
workbook = Workbook()

# Load an Excel file
workbook.LoadFromFile("Sample.xlsx")

# Connect to database
conn = sqlite3.connect("output/Report.db")
cursor = conn.cursor()

for s in range(workbook.Worksheets.Count):
    # Get a worksheet
    sheet = workbook.Worksheets.get_Item(s)

    # Get the sheet name
    sheetName = sheet.Name
    sheetName = sheetName.replace(" ", "")

    # Get the data in the header row
    header = []
    for i in range(sheet.AllocatedRange.ColumnCount):
        headerValue = sheet.Range[1, i + 1].Value
        headerValue = headerValue.replace(" ", "")
        header.append(headerValue)

    # Create a database table
    createTableSql = f"CREATE TABLE IF NOT EXISTS {sheetName} ({', '.join([f'{header[i]} TEXT' for i in range(len(header))])})"
    cursor.execute(createTableSql)

    # Insert data into the database table
    for row in range(1, sheet.AllocatedRange.RowCount):
        data = []
        for col in range(sheet.AllocatedRange.ColumnCount):
            # Get the cell value
            value = sheet.Range[row + 1, col + 1].Value
            data.append(value)
        # Insert the cell values into the database table
        insertSql = f"INSERT INTO {sheetName} ({', '.join(header)}) VALUES ({', '.join(['?' for _ in data])})"
        cursor.execute(insertSql, data)
    
# Commit the changes and close the connection
conn.commit()
conn.close()

workbook.Dispose()

Python: Export and Import Data Between Excel Files and Databases

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

Thursday, 27 June 2024 06:55

Spire.Office 9.6.0 is released

We're pleased to announce the release of Spire.Office 9.6.0. This version adds many new features, for example, Spire.Doc supports AI features and saving the XML of the document's default font replacement rules; Spire.XLS supports converting Excel to Markdown format, Spire.PDF supports converting PDF to Markdown format. Meanwhile, a series of issues occurred when converting, manipulating and printing Word, Excel and PDF 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 v12.6.10.0
  • Spire.Pdf.dll v10.6.25.0
  • Spire.XLS.dll v14.6.6.0
  • Spire.Presentation.dll v9.5.3.0
  • Spire.Barcode.dll v7.2.9.0
  • Spire.Email.dll v6.5.10.0
  • Spire.DocViewer.Forms.dll v8.7.10.0
  • Spire.PdfViewer.Asp.dll v7.12.14.0
  • Spire.PdfViewer.Forms.dll v7.12.14.0
  • Spire.Spreadsheet v7.4.6.0
  • Spire.OfficeViewer.Forms.dll v8.7.12.0
  • Spire.DataExport.dll v4.9.0.0
  • Spire.DataExport.ResourceMgr.dll v2.1.0
Click the link to get the version Spire.Office 9.6.0:
More information of Spire.Office new release or hotfix:

Here is a list of changes made in this release

Spire.Doc

Category ID Description
New feature - Adds the Document.SaveFontFallbackRuleSettings() method to save the XML of the document's default font replacement rules.
Document document = new Document();
document.LoadFromFile(inputFile);
document.SaveFontFallbackRuleSettings("FontReplacementRuleSettings.xml");
New feature - Adds the Document.LoadFontFallbackRuleSettings() method to load custom font replacement rules in XML format for conversion.
Document document = new Document();
document.LoadFromFile(inputFile);
document.LoadFontFallbackRuleSettings(“CustomFontReplacementRuleSettings.xml”);
document.SaveToFile(outputFile, FileFormat.PDF);
New feature - Supports AI features: document generation, document polishing, document translation, abstract generation, summary creation, spelling check, object recognition, article continuation, as well as questions and answers.
Bug SPIREDOC-10196 Fixes the issue that the layout was incorrect when printing Word documents.
Bug SPIREDOC-10211 Fixes the issue that the fonts were incorrect after converting Word to HTML.
Bug SPIREDOC-10221 Fixes the issue that the contents were incorrect after converting Word to OFD.
Bug SPIREDOC-10353 Fixes the issue that the program threw a "System.NullReferenceException" when loading a Word document.
Bug SPIREDOC-10515 Fixes the issue that the program threw a "System.NullReferenceException" when converting a Word document to PDF.
Bug SPIREDOC-10425 Fixes the issue that the program threw "System.ArgumentNullException" error when converting Word documents to PDF.
Bug SPIREDOC-10544 Fixes the issue that the images were not displayed after converting HTML to Word.
Bug SPIREDOC-10554 Fixes the issue that images and hyperlinks were incorrect after converting Markdown to Docx.
Bug SPIREDOC-10587 Fixes the issue that the program threw "Unknown boolex value" error when converting Word to PDF.

Spire.XLS

Category ID Description
New feature - Supports converting Excel to Markdown format.
Workbook workbook = new Workbook();
workbook.LoadFromFile("input.xlsx");
workbook.SaveToFile("output.md",FileFormat.Markdown);
Bug SPIREXLS-5191 Fixes the issue that the application threw "ArgumentOutOfRangeException" when setting "horizontal" and "vertical" type borders.
Bug SPIREXLS-5243 Fixes the issue that the effect was incorrect when calling "Worksheet.Activate()" method.
Bug SPIREXLS-5262 Fixes the issue that the text content layout was incorrect when converting Excel to image.
Bug SPIREXLS-5265 Fixes the issue that the comment order in Excel was incorrect after sorting.
Bug SPIREXLS-5269 Fixes the issue that the font effect was incorrect when converting Excel to Html.
Bug SPIREXLS-5272 Fixes the issue that an error prompt appeared when opening the result document after adding a filter to an Excel PivotTable.
Bug SPIREXLS-5273 Fixes the issue that the cell color was lost when converting Excel to Html.
Bug SPIREXLS-5283 Fixes the issue that the cell icons were lost when converting Excel to Html.
Bug SPIREXLS-5217 Fixed the issue that the "Worksheet.SetLastRow()" method did not take effect.

Spire.PDF

Category ID Description
New feature - Supports converting PDF documents to Markdown files.
PdfDocument doc = new PdfDocument("input.pdf");
doc.SaveToFile("output.md", FileFormat.Markdown);
Bug SPIREPDF-6663 Fixes the issue that "System.ArgumentOutOfRangeException" was thrown when converting OFD to PDF.
Bug SPIREPDF-6678 Fixes the issue that lines were lost after converting PDF to Excel.
Bug SPIREPDF-6713 Fixes the issue that "System.NullReferenceException" was thrown when converting OFD to PDF.
Bug SPIREPDF-6719 Fixes the issue that the effect of font display was incorrect after converting OFD to PDF.
Bug SPIREPDF-6720 Fixes the issue that modifying the annotation text of PdfFreeTextAnnotation did not take effect.
Bug SPIREPDF-6739 Fixes the issue that "Schema namespace URI and prefix mismatch" was thrown when adding a watermark to a PDF file.
Bug SPIREPDF-6740 Fixes the issue that the result was incorrect when printing PDF files.
Bug SPIREPDF-6741 Fixes the issue that the text overlapped after converting PDF to images.
Bug SPIREPDF-6743 Fixes the issue that the pictures were not clear after converting OFD to PDF.
Bug SPIREPDF-6748 Fixes the issue that some contents were lost after drawing HTML contents on PDF.
Bug SPIREPDF-6770 Fixes the issue that the drawn text was lost after setting the transparency of PDF and then converting it to OFD.
Bug SPIREPDF-6771 Fixes the issue that "System.NullReferenceException" was thrown when the PdfDocument object was not released and called again.
Bug SPIREPDF-6721 Fixes the issue that the results of extracting images from PDF were incorrect.
Bug SPIREPDF-6775 Fixes the issue that the effect of setting "PdfButtonWidgetFieldWidget.SetButtonImage()" was incorrect.
Bug SPIREPDF-6791 Fixes the issue that the program suspended when using "IProgressNotifier".
Bug SPIREPDF-6793 Fixes the issue that characters were lost after converting XPS to PDF.
Bug SPIREPDF-6794 Fixes the issue that the signature verification was incorrect.
Bug SPIREPDF-6802 Fixes the issue that the effect of replacing PDF text content was incorrect.
Bug SPIREPDF-6803 Fixes the issue that the program threw a "System.NullReferenceException" when using PdfPageBase.CreateTemplate().
Bug SPIREPDF-6807 Fixes the issue that the program threw "System.NullReferenceException" when converting PDF to OFD.
Bug SPIREPDF-6808 Fixes the issue that stamps were lost after converting PDF to OFD.
Bug SPIREPDF-6816 Fixes the issue that the effect of PdfGrid.RepeatHeader settings was incorrect.
Bug SPIREPDF-6824 Fixes the issue that the program threw "System.StackOverflowException" when converting PDF to PDFA1A.
Thursday, 27 June 2024 01:05

Python: Split Excel Files

Working with large Excel workbooks can sometimes become unwieldy, especially when you need to share or distribute parts of the data independently. In these cases, it can be helpful to split your Excel file into multiple smaller files. This not only makes the individual files more manageable, but also allows you to better organize and share your data. In this article, we will demonstrate how to split an Excel file in Python using Spire.XLS for Python.

Install Spire.XLS for Python

This scenario requires Spire.XLS for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.

pip install Spire.XLS

If you are unsure how to install, please refer to this tutorial: How to Install Spire.XLS for Python on Windows

Split Excel by Worksheets in Python

If your Excel file contains multiple worksheets, you can easily split each sheet into an Excel file by using the Workbook.Worksheets.AddCopy() method provided by Spire.XLS for Python. The detailed steps are as follows.

  • Create an object of the Workbook class.
  • Load an Excel file using Workbook.LoadFromFile() method.
  • Iterate through the worksheets in the Excel file.
  • For each worksheet, create a new Workbook object for it.
  • Remove the default worksheets in the new workbook using Workbook.Worksheets.Clear() method.
  • Copy the worksheet to the new workbook using Workbook.Worksheets.AddCopy() method.
  • Save the new workbook to an Excel file using Workbook.SaveToFile() method.
  • Python
from spire.xls import *
from spire.xls.common import *

# Create an object of the Workbook class
workbook = Workbook()
# Load an Excel file
workbook.LoadFromFile("Sample.xlsx")

# Specify the folder path for the generated Excel files
folderPath = "C:\\Users\\Administrator\\Desktop\\Output\\"

# Iterate through all worksheets in the Excel file
for worksheet in workbook.Worksheets:
    # For each worksheet, create a new Workbook object
    newWorkbook = Workbook()
    # Remove the worksheets from the new workbook
    newWorkbook.Worksheets.Clear()

    # Copy the worksheet from the Excel file to the new workbook
    newWorkbook.Worksheets.AddCopy(worksheet)

    # Save the new workbook to the specified folder
    newWorkbook.SaveToFile(folderPath + worksheet.Name + ".xlsx", FileFormat.Version2016)

workbook.Dispose()

Python: Split Excel Files

Split Excel by Rows in Python

If you have a large worksheet where a specific number of rows represent a unique record or entry, you can extract these individual rows or records into separate Excel files for focused data analysis using the Worksheet.CopyRow() method. The detailed steps are as follows.

  • Create an object of the Workbook class.
  • Load an Excel file using Workbook.LoadFromFile() method.
  • Get the original worksheet where you want to copy rows from using Workbook.Worksheets[index] property.
  • Create a new Workbook object and remove the default worksheets from the new workbook using Workbook.Worksheets.Clear() method.
  • Add a new Worksheet to the new workbook using Workbook.Worksheets.Add() method.
  • Copy specific rows from the original worksheet to the new worksheet using Worksheet.CopyRow() method.
  • Copy Column widths from the original worksheet to the new worksheet.
  • Save the new workbook to an Excel file using Workbook.SaveToFile() method.
  • Python
from spire.xls import *
from spire.xls.common import *

# Create a Workbook object and load an Excel file
workbook = Workbook()
workbook.LoadFromFile("Sample.xlsx")
# Get the original (the 1st) worksheet
worksheet = workbook.Worksheets[0]
# Get the header row
header = worksheet.Rows[0]

# Specify the folder path for the generated Excel files
folderPath = "C:\\Users\\Administrator\\Desktop\\Output\\"

# Create a new Workbook object
newWorkbook1 = Workbook()
# Remove the default worksheets
newWorkbook1.Worksheets.Clear()
# Add a new worksheet
newWorksheet1 = newWorkbook1.Worksheets.Add("Sheet1")
# Copy rows 1-5 from the original worksheet to the new worksheet
for i in range(1, 6):
    worksheet.CopyRow(worksheet.Rows[i - 1], newWorksheet1, newWorksheet1.LastDataRow + 1, CopyRangeOptions.All)
# Copy column widths from the original worksheet to the new worksheet
for i in range(worksheet.Columns.Count):
    newWorksheet1.SetColumnWidth(i + 1, worksheet.GetColumnWidth(i + 1))
# Save the new workbook to the specified folder
newWorkbook1.SaveToFile(folderPath + "Rows1-5.xlsx", FileFormat.Version2016)
newWorkbook1.Dispose()

# Create a new Workbook object
newWorkbook2 = Workbook()
# Remove the default worksheets
newWorkbook2.Worksheets.Clear()
# Add a new worksheet
newWorksheet2 = newWorkbook2.Worksheets.Add("Sheet1")
# Copy header row from the original worksheet to the new worksheet
worksheet.CopyRow(worksheet.Rows[0], newWorksheet2, newWorksheet2.LastDataRow + 1, CopyRangeOptions.All)
# Copy rows 6-10 from the original worksheet to the new worksheet
for i in range(6, 11):
    worksheet.CopyRow(worksheet.Rows[i - 1], newWorksheet2, newWorksheet2.LastDataRow + 1, CopyRangeOptions.All)
# Copy column widths from the original worksheet to the new worksheet
for i in range(worksheet.Columns.Count):
    newWorksheet2.SetColumnWidth(i + 1, worksheet.GetColumnWidth(i + 1))
# Save the new workbook to the specified folder
newWorkbook2.SaveToFile(folderPath + "Rows6-10.xlsx", FileFormat.Version2016)
newWorkbook2.Dispose()

Python: Split Excel Files

Split Excel by Columns in Python

In addition to splitting by rows, you can also split an Excel file by columns using the Worksheet.CopyColumn() method. The detailed steps are as follows.

  • Create an object of the Workbook class.
  • Load an Excel file using Workbook.LoadFromFile() method.
  • Get the original worksheet where you want to copy columns from using Workbook.Worksheets[index] property.
  • Create a new Workbook object and remove the default worksheets from the new workbook using Workbook.Worksheets.Clear() method.
  • Add a new Worksheet to the new workbook using Workbook.Worksheets.Add() method.
  • Copy specific columns from the original worksheet to the new worksheet using Worksheet.CopyColumn() method.
  • Copy row heights from the original worksheet to the new worksheet.
  • Save the new workbook to an Excel file using Workbook.SaveToFile() method.
  • Python
from spire.xls import *
from spire.xls.common import *

# Create a Workbook object and load an Excel file
workbook = Workbook()
workbook.LoadFromFile("Sample.xlsx")
# Get the original (the 1st) worksheet
worksheet = workbook.Worksheets[0]

# Specify the folder path for the generated Excel files
folderPath = "C:\\Users\\Administrator\\Desktop\\Output\\"

# Create a new Workbook object
newWorkbook1 = Workbook()
# Remove the default worksheets
newWorkbook1.Worksheets.Clear()
# Add a new worksheet
newWorksheet1 = newWorkbook1.Worksheets.Add("Sheet1")
# Copy columns 1-2 from the original worksheet to the new worksheet
for i in range(1, 3):
    worksheet.CopyColumn(worksheet.Columns[i-1], newWorksheet1, newWorksheet1.LastDataColumn + 1, CopyRangeOptions.All)    
# Copy row heights from the original worksheet to the new worksheet
for i in range(worksheet.Rows.Count):
    newWorksheet1.SetRowHeight(i + 1, worksheet.GetRowHeight(i + 1))
# Save the new workbook to the specified folder
newWorkbook1.SaveToFile(folderPath + "Columns1-2.xlsx", FileFormat.Version2016)
newWorkbook1.Dispose()

# Create a new Workbook object
newWorkbook2 = Workbook()
# Remove the default worksheets
newWorkbook2.Worksheets.Clear()
# Add a new worksheet
newWorksheet2 = newWorkbook2.Worksheets.Add("Sheet1")
# Copy columns 3-5 from the original worksheet to the new worksheet
for i in range(3, 6):
    worksheet.CopyColumn(worksheet.Columns[i-1], newWorksheet2, newWorksheet2.LastDataColumn + 1, CopyRangeOptions.All)

# Copy row heights from the original worksheet to the new worksheet
for i in range(worksheet.Rows.Count):
    newWorksheet2.SetRowHeight(i + 1, worksheet.GetRowHeight(i + 1))
# Save the new workbook to the specified folder
newWorkbook2.SaveToFile(folderPath + "Columns3-5.xlsx", FileFormat.Version2016)
newWorkbook2.Dispose()

Python: Split Excel Files

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

Wednesday, 26 June 2024 09:36

Spire.Office for Java 9.6.0 is released

We are excited to announce the release of Spire.Office for Java 9.6.0. In this version, Spire.Doc for Java supports displaying a prompt message when a corresponding font is not found during conversion; Spire.Barcode for Java supports obtaining barcode information; Spire.PDF for Java enhances the conversion from PDF to OFD, Word, SVG and images. Besides, a lot of known issues are fixed successfully in this version. More details are listed below.

Click the link to download Spire.Office for Java 9.6.0:

Here is a list of changes made in this release

Spire.Doc for Java

Category ID Description
New feature SPIREDOC-10465 Supports displaying a prompt message when a corresponding font is not found during Word conversion.
Document doc = ConvertUtil.GetNewEngineDocument();
doc.loadFromFile(input);
HandleDocumentSubstitutionWarnings substitutionWarningHandler = new HandleDocumentSubstitutionWarnings();
doc.setWarningCallback(substitutionWarningHandler);
doc.saveToFile(output_1);
StringBuilder sb = new StringBuilder();
Iterator iterator = substitutionWarningHandler.FontWarnings.iterator();
while(iterator.hasNext()){
    System.out.println(((WarningInfo)iterator.next()).getDescription());
}
String s = substitutionWarningHandler.FontWarnings.get(0).getDescription();
WarningSource warningSource = substitutionWarningHandler.FontWarnings.get(0).getSource();
substitutionWarningHandler.FontWarnings.clear(); 
class HandleDocumentSubstitutionWarnings implements IWarningCallback
{
    public void warning(WarningInfo info) {
        if(info.getWarningType() == WarningType.Font_Substitution)
            FontWarnings.warning(info);
    }
    public WarningInfoCollection FontWarnings = new WarningInfoCollection();
}
Bug SPIREDOC-10413 Fixes the issue that the text shifted upwards when converting a Word document to PDF.
Bug SPIREDOC-10486 Fixes the issue that the content layout was inconsistent when converting a Word document to PDF.
Bug SPIREDOC-10504 Fixes the issue that the application threw a "'td' is expected" error when converting an HTML to Word.
Bug SPIREDOC-10589 Fixes the issue that text content was partially lost when converting a Word document to an image.
Bug SPIREDOC-10592 Fixes the issue that the application threw a "String index out of range: -1" error when converting a Word document to PDF

Spire.Barcode for Java

Category ID Description
New feature SPIREBARCODE-258 The 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.PDF for Java

Category ID Description
Bug SPIREPDF-6601 Optimizes the issue of font naming when converting PDF to SVG.
Bug SPIREPDF-6628 Fixes the issue that the application threw an exception when converting PDF to Word.
Bug SPIREPDF-6676 Optimizes the time-consuming for merging PDF files.
Bug SPIREPDF-6705 Fixes the issue that the PdfInkAnnotation added to PDF was lost after conversion to OFD.
Bug SPIREPDF-6709 Fixes the issue that the PdfInkAnnotation added to PDF was not rendered incorrectly.
Bug SPIREPDF-6747 Fixes the issue that the PdfTextExtractOptions.setExtractHiddenText(false) method didn’t take effect.
Bug SPIREPDF-6767 Fixes the issue that an error "StringIndexOutOfBoundsException" was thrown when extracting PDF tables.
Bug SPIREPDF-6781 Fixes the issue that text was overlapped after converting PDF to images.
Bug SPIREPDF-6796 Fixes the issue that an error "Width (48) and height (0) must be > 0" was thrown when compressing PDF.
Bug SPIREPDF-6810 Fixes the issue that bookmarks were lost after converting PDF to OPD.
Bug SPIREPDF-6821 Fixes the issue that content was lost when converting SVG to PDF.

Spire.XLS for Java

Category ID Description
Bug SPIREXLS-5223 Fixes the issue that the formula values were calculated incorrectly when transferring Excel to images.
Bug SPIREXLS-5238 Fixes the issue that the effect of setting "autoFitColumns()" was incorrect.
Bug SPIREXLS-5256 Fixes the issue that an exception "com.spire.xls.packages.spramg: Invalid cell name" was thrown when loading an Excel document.
Bug SPIREXLS-5263 Fixes the issue that annotations added by Microsoft 365 in Excel documents were lost after loading and saving.

Spire.Presentation for Java

Category ID Description
Bug SPIREPPT-2487 Fixes the issue that the links were missing when merging PowerPoint documents.
Bug SPIREPPT-2499 Fixes the issue that the chart dynamics were lost after loading and saving PowerPoint documents.
Bug SPIREPPT-2500 Fixes the issue that the program hanged when converting PowerPoint to PDF.
Bug SPIREPPT-2517 Fixes the issue that the application threw "DocumentEditException" when merging PowerPoint documents.
Bug SPIREPPT-2518 Fixes the issue that the fonts retrieved in shapes were incorrect.
Bug SPIREPPT-2519 Fixes the issue that the application threw "NullPointerException" when retrieving chart data sources in PowerPoint documents.
Bug SPIREPPT-2525 Fixes the issue that the application threw "outOfMemoryError" when converting PowerPoint to images.

We're pleased to announce the release of Spire.Doc for Python 12.6.0. This version supports loading, saving and converting Markdown documents, such as converting Word to Markdown,or Markdown to Word/PDF. In addition, it also fixes some issues that occurred when converting Word to PDF, Html to Word. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREDOC-10556 Supports loading, saving and converting Markdown documents.
document= Document()
#load .md file
document.LoadFromFile("input.md")
#save to .md file
document.SaveToFile("output.md", FileFormat.Markdown)
#save to .docx file
document.SaveToFile("output.docx", FileFormat.Docx)
#save to .doc file
document.SaveToFile("output.doc", FileFormat.Doc)
#save to .pdf file
document.SaveToFile("output.pdf", FileFormat.PDF)
 
document= Document()   
#load .docx file
document.LoadFromFile("input.docx")
#load .doc file
#document.LoadFromFile("input.doc")
#save to .md file
document.SaveToFile("output.md", FileFormat.Markdown)
Bug SPIREDOC-10321
SPIREDOC-10368
Fixes the issue that the bookmark content was incorrect when converting Word to PDF.
Bug SPIREDOC-10390 Fixes the issue that the program threw "InvalidOperation_EmptyStack" when converting Html to Word.
Bug SPIREDOC-10505 Fixes the issue that the content was incorrect after updating TableOfContents.
Bug SPIREDOC-10507 Fixes the issue that the images were not displayed when converting Html to Word.
Click the link to download Spire.Doc for Python 12.6.0:

We are glad to announce the release of Spire.PDF 10.6.25. This version enhances the conversion from PDF to OFD and PDFA1A as well as XPS to PDF. Besides, some known issues are fixed successfully in this version, such as the issue that the signature validation was incorrect. More details are listed below.

Here is a list of changes made in this release

Category ID Description
Bug SPIREPDF-6721 Fixes the issue that the results of extracting images from PDF were incorrect.
Bug SPIREPDF-6775 Fixes the issue that the effect of setting "PdfButtonWidgetFieldWidget.SetButtonImage()" was incorrect.
Bug SPIREPDF-6791 Fixes the issue that the program suspended when using "IProgressNotifier".
Bug SPIREPDF-6793 Fixes the issue that characters were lost after converting XPS to PDF.
Bug SPIREPDF-6794 Fixes the issue that the signature verification was incorrect.
Bug SPIREPDF-6802 Fixes the issue that the effect of replacing PDF text content was incorrect.
Bug SPIREPDF-6803 Fixes the issue that the program threw a "System.NullReferenceException" when using PdfPageBase.CreateTemplate().
Bug SPIREPDF-6807 Fixes the issue that the program threw "System.NullReferenceException" when converting PDF to OFD.
Bug SPIREPDF-6808 Fixes the issue that stamps were lost after converting PDF to OFD.
Bug SPIREPDF-6816 Fixes the issue that the effect of PdfGrid.RepeatHeader settings was incorrect.
Bug SPIREPDF-6824 Fixes the issue that the program threw "System.StackOverflowException" when converting PDF to PDFA1A.
Click the link to download Spire.PDF 10.6.25:
More information of Spire.PDF new release or hotfix:
Page 2 of 232