Spire.PDF for Python 12.6.2 supports configuring licenses via environment variables
We're pleased to announce the release of Spire.PDF for Python 12.6.2. This version supports configuring licenses via environment variables, with automatic recognition and loading of three specific variables: SPIRE_OFFICE_LICENSE_KEY, SPIRE_PDF_LICENSE_KEY, and SPIRE_LICENSE_KEY. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREPDF-8111 | Adds support for configuring licenses via environment variables, with automatic recognition and loading of the following three variables:
|
Spire.Presentation 11.6.6 adds default font configuration support
We’re pleased to announce the release of Spire.Presentation 11.6.6. This version adds support for configuring default fonts and fixes several issues related to PowerPoint conversion, including SVG text splitting, PDF chart formatting, shape mapping, text positioning, and image loss. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREPPT-3044 | Added support for configuring default fonts.
// Set default fonts
Presentation.SetDefaultLatinFontName("Arial");
Presentation.SetDefaultEastAsianFontName("Microsoft YaHei");
// Reset/restore the default font settings
Presentation.ResetDefaultEastAsianFontName();
Presentation.ResetDefaultLatinFontName();
|
| Bug Fix | SPIREPPT-3117 | Fixed an issue where words were split when converting PowerPoint documents to SVG. |
| Bug Fix | SPIREPPT-3125 | Fixed an issue where chart data formats were incorrect when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3130 | Fixed an issue where the shape corresponding to a retrieved image in a PowerPoint document was incorrect. |
| Bug Fix | SPIREPPT-3131 | Fixed an issue where text shapes were offset when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3139 | Fixed an issue where images were missing when converting PowerPoint documents to PDF. |
Spire.PDF 12.6.5 enhances the conversion from XPS to PDF
We are pleased to announce the release of Spire.PDF 12.6.5. In this version, several PDF Action-related class names and properties have been renamed, and the PDF Destination APIs have been refactored. In addition, issues encountered during XPS-to-PDF and PDF-to-PDF/X conversion have been resolved. Detailed updates are listed below.
Here is a list of changes made in this release
Adjustment
| Old class namespace | New class namespace | Old property name | New property name |
|---|---|---|---|
| PdfLaunchAction | PdfLaunchAction | IsNewWindow | NewWindow |
| PdfActionDestination | PdfPredefinedAction | ||
| PdfEmbeddedGoToAction | PdfEmbeddedGoToAction | IsNewWindow | NewWindow |
| PdfResetAction | PdfResetFormAction | ||
| PdfSubmitAction | PdfSubmitFormAction | ||
| PdfUriAction | PdfURIAction | Uri | URI |
| PdfFieldActions | PdfFormFieldAdditionalActions | ||
| PdfAnnotationActions | PdfAnnotationAdditionalActions | MouseEnter | OnEnter |
| MouseLeave | OnExit | ||
| MouseDown | OnMouseDown | ||
| MouseUp | OnMouseUp | ||
| GotFocus | OnReceiveFocus | ||
| LostFocus | OnLostFocus | ||
| Calculate | / | ||
| Validate | / | ||
| KeyPressed | / | ||
| Format | / | ||
| PdfDocumentActions | PdfDocumentAdditionalActions | Calculate | OnCalculate |
| Validate | OnValidate | ||
| KeyPressed | OnModifyCharacter | ||
| Format | OnFormat | ||
| MouseEnter | OnEnter | ||
| MouseLeave | OnExit | ||
| MouseDown | OnMouseDown | ||
| MouseUp | OnMouseUp | ||
| GotFocus | OnReceiveFocus | ||
| LostFocus | OnLostFocus |
| Old class name (Spire.Pdf.General namespace) | New class name (Spire.Pdf.Destinations namespace) | Old property name | New property name |
|---|---|---|---|
| PdfDestination | PdfDestination, PdfExplicitDestination |
||
| PdfDestination (Mode=Location) |
PdfXYZExplicitDestination | Location | Left, Top |
| Rectangle | / | ||
| Mode | Type | ||
| PdfDestination (Mode=FitToPage) |
PdfFitExplicitDestination | Location | / |
| Rectangle | / | ||
| Zoom | / | ||
| Mode | Type | ||
| PdfDestination (Mode=FitH) |
PdfFitHExplicitDestination | Location | Top |
| Rectangle | / | ||
| Zoom | / | ||
| Mode | Type | ||
| PdfDestination (Mode=FitR) |
PdfFitRExplicitDestination | Location | / |
| Rectangle | Left,Bottom, Right, Top | ||
| Zoom | / | ||
| Mode | Type | ||
| PdfDestination (Mode=FitV) |
PdfFitVExplicitDestination | Location | Left |
| Rectangle | / | ||
| Zoom | / | ||
| Mode | Type | ||
| PdfFitBExplicitDestination | |||
| PdfFitBVExplicitDestination | / | Left |
Bug Fix
| ID | Description |
| SPIREPDF-8034 | Fixed the issue where the resulting document reported an error when converting XPS to PDF. |
| SPIREPDF-8047 | Fixed the issue where characters overlapped when converting XPS to PDF. |
| SPIREPDF-8057 | Fixed the issue where image backgrounds turned black when converting PDF to the PdfX1A2001 standard. |
| SPIREPDF-8074 | Fixed the issue where the program threw a "The index can not be less then zero or greater then Count" exception when merging PDF documents. |
Spire.Doc 14.6.9 optimizes revision processing for Word to PDF conversion
We're pleased to announce the release of Spire.Doc 14.6.9. This version optimizes the revision functionality, resulting in improved outcomes when partially accepting revisions, and fixes an issue where the result was incorrect when converting Word to PDF after accepting revisions. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Optimization | - | Optimized the revision functionality, resulting in improved outcomes when partially accepting revisions. |
| Bug Fix | SPIREDOC-11907 | Fixed an issue where the result was incorrect when converting Word to PDF after accepting revisions. |
Spire.Doc for Python 14.6.1 improves document processing and chart operation capabilities
We're pleased to announce the release of Spire.Doc for Python 14.6.1. This version introduces several new interfaces for processing documents and charts. Key capabilities include extracting X-axis and Y-axis values from charts, directly exporting Word files to XLSX format, and inserting SmartArt graphics into paragraphs. Moreover, an issue that occurred when converting Word to PDF has also been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | - | The CharacterFormat class adds the Kerning property to support setting character kerning.
textRange.CharacterFormat.Kerning = kerningValue |
| New Feature | - | The Chart class adds a method to get the X-axis data values, and the ChartSeries class adds a method to get the Y-axis data values.
doc = Document()
doc.LoadFromFile(inputFile)
sb = []
number = 1
for i in range(doc.Sections.Count):
sec = doc.Sections.get_Item(i)
for j in range(sec.Paragraphs.Count):
paragraph = sec.Paragraphs.get_Item(j)
for k in range(paragraph.ChildObjects.Count):
obj = paragraph.ChildObjects[k]
if isinstance(obj, ShapeObject):
shape = obj
chart = shape.Chart
sb.append("\r\n\r\nPage " + str(number) + ":\r\n" + "Get all X-axis data:")
# X-axis
for x in range(chart.XValues.Count):
xVal = chart.XValues[x]
sb.append(str(xVal.StringValue) + " ")
# Y-axis of the first series
series = chart.Series[0]
sb.append("\r\nGet Y-axis data:")
for i in range(series.YValues.Count):
yVal = series.YValues.get_Item(i)
sb.append(str(yVal.Value) + " ")
number += 1
# Write to file
File.WriteAllText(outputFile, "".join(sb))
doc.Dispose()
|
| New Feature | - | Both the ChartDataLabel and ChartDataLabelCollection classes add the Position property to support setting the position of chart data labels.
chart.Series[0].DataLabels.Position = position |
| New Feature | - | The CompareOptions class adds multiple comparison option properties to support flexible ignoring of various elements or format changes during document comparison.
doc1 = Document() doc1.LoadFromFile(inputFile_1) doc2 = Document() doc2.LoadFromFile(inputFile_2) options = CompareOptions() options = CompareOptions() options.IgnoreCaseChanges = True options.IgnoreComments = True options.IgnoreFields = True options.IgnoreFootnotes = True options.IgnoreTables = True options.IgnoreTextboxes = True doc1.Compare(doc2, "user", DateTime(), options) # Save the comparison document doc1.SaveToFile(outputFile, FileFormat.Docx2013) doc1.Close() doc2.Close() |
| New Feature | - | The Document class adds the GetRevisionInfos method and the RevisionsView property to support obtaining document revision information and controlling the revision view.
doc = Document()
doc.LoadFromFile(inputFile)
revisionInfoCollection = doc.GetRevisionInfos()
sb = []
for revisionIndex in range(revisionInfoCollection.Count):
revisionInfo = revisionInfoCollection.get_Item(revisionIndex)
if revisionInfo.RevisionType == RevisionType.FormatChange:
if isinstance(revisionInfo.OwnerObject, TextRange):
text_range = revisionInfo.OwnerObject
sb.append("TextRange:" + text_range.Text + "\r\n")
doc.RevisionsView = RevisionsView.Original
sb.append("Original style: " + "isBold: " + str(text_range.CharacterFormat.Bold) + "; " + "TextColor: " + text_range.CharacterFormat.TextColor.ToString() + ", HighlightColor: " + text_range.CharacterFormat.HighlightColor.ToString() + ", FontName: " + str(text_range.CharacterFormat.FontName) + ", UnderlineStyle: " + str(text_range.CharacterFormat.UnderlineStyle) + "\r\n")
doc.RevisionsView = RevisionsView.Final
sb.append("Final style: " + "isBold: " + str(text_range.CharacterFormat.Bold) + "; " + "TextColor: " + text_range.CharacterFormat.TextColor.ToString() + ", HighlightColor: " + text_range.CharacterFormat.HighlightColor.ToString() + ", FontName: " + str(text_range.CharacterFormat.FontName) + ", UnderlineStyle: " + str(text_range.CharacterFormat.UnderlineStyle) + "\r\n")
File.WriteAllText(outputFile, "\n".join(sb))
doc.Close()
|
| New Feature | - | The SaveToFile method adds a new parameter to support directly saving Word documents as XLSX format.
document = Document() document.LoadFromFile(inputFile) document.SaveToFile(outputFile, FileFormat.XLSX) document.Close() |
| New Feature | - | The Document class adds the CompatibilityOptions property to support obtaining document compatibility options.
options = doc.CompatibilityOptions |
| New Feature | - | The Fill class adds the SetImage method and the FillType property to support setting fill images and obtaining fill types.
# add node
node_new = smartArt.Nodes.Add()
node_new.Text = "Map"
shapeProperties = node_new.ShapeProperties[0]
# Set the fill color of the shape
shapeProperties.Fill.FillType = FillType.Picture
picFileStream = Stream("Image/0.jpg")
# Set the image
shapeProperties.Fill.SetImage(picFileStream)
|
| New Feature | - | The Paragraph class adds the AppendSmartArt method to support appending SmartArt graphics in paragraphs.
shape = paragraph.AppendSmartArt(SmartArtType.RepeatingBendingProcess, 432, 252) |
| New Feature | - | The ParagraphFormat class adds the AdjustRightIndent method to support controlling whether to automatically adjust the right indent of a paragraph.
paragraph.Format.AdjustRightIndent = True |
| New Feature | - | The Shape class adds the HasSmartArt property and the SmartArt property to support determining whether a shape contains SmartArt and obtaining the object.
hasSmartArt=shape.HasSmartArt smartArt = shape.SmartArt |
| New Feature | - | The TableRow class adds the Hidden property to support setting or obtaining the hidden state of a table row.
firstRow.Hidden = True |
| New Feature | - | The ToPdfParameterList class adds the GeneratorName property to support customizing the generator name when converting Word to PDF.
doc = Document() toPdf = ToPdfParameterList() toPdf.GeneratorName = genName doc.LoadFromFile(inputFile) doc.SaveToFile(outputFile, toPdf) |
| Bug Fix | SPIREDOC-11858 | Fixed an issue where the program threw an “ArgNullReferenceException” when converting Word to PDF. |
Spire.XLS 16.6.1 enhances the conversion from an Excel chart to an image
We're pleased to announce the release of Spire.XLS 16.6.1. This version optimizes the conversion from an Excel chart to an image. Meanwhile, some issues that occurred when calculating formula values using CalculateAllValue and loading ODS files have also been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREXLS-6133 | Fixes the issue where an IndexOutOfRangeException was thrown when converting a chart to an image. |
| Bug Fix | SPIREXLS-6142 | Fixes the issue where the CalculateAllValue method returned incorrect formula calculation results. |
| Bug Fix | SPIREXLS-6144 | Fixes the issue where the CalculateAllValue method took too long to calculate formula values. |
| Bug Fix | SPIREXLS-6146 | Fixes the issue where a "Key cannot be null" exception was thrown when loading ODS files. |
Spire.OCR 2.2.12 improves image recognition formatting
We’re pleased to announce the release of Spire.OCR 2.2.12. This version fixes an issue where the OCR engine failed to preserve indentation and line spacing when recognizing images, further improving recognition results and document formatting retention. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREOCR-137 | Fixed an issue where the OCR engine failed to preserve indentation and line spacing when recognizing images. |
Spire.PDF for Java 12.6.1 supports SHA-256/SHA-512 digital signatures
We’re excited to announce the release of Spire.PDF for Java 12.6.1. This update introduces support for digitally signing PDFs with SHA-256/SHA-512 certificates and allows setting a fallback font when converting OFD to PDF. In addition, it resolves several issues related to PDF conversion and text extraction.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREPDF-7829 | Added support for signing with SHA-256/SHA-512 algorithm certificates.
public static void main(String[] args) throws IOException {
// Create pdf document
PdfDocument doc = new PdfDocument();
// Load file from disk
doc.loadFromFile("Sample.docx");
// Load the X509 certificate for signature
PdfPKCS7Formatter formatter = new PdfPKCS7Formatter(new PdfCertificate("gary.pfx", "e-iceblue"), false);
// Create an instance of PdfOrdinarySignatureMaker using the loaded document and certificate
PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(doc, formatter);
// Create an instance of PdfCustomSignatureAppearance as the appearance for the signature
IPdfSignatureAppearance signatureAppearance = new PdfCustomSignatureAppearance();
// Make the signature with a specified name and the custom appearance
signatureMaker.makeSignature("Signature", signatureAppearance);
// Iterate through all hash algorithm types
for (HashAlgorithmType hashAlg : HashAlgorithmType.values()) {
// Skip SM3 (case-insensitive)
if ("SM3".equalsIgnoreCase(hashAlg.name())) {
continue;
}
try {
// Set the current hash algorithm
formatter.getProperties().setHashAlgorithm(hashAlg);
String filePath = "AddImageSignature_" + hashAlg.name() + ".pdf";
doc.saveToFile(filePath, FileFormat.PDF);
System.out.println("Succeed:" + hashAlg.name());
} catch (Exception ex) {
System.out.println("Error HashAlgorithmType:" + hashAlg.name());
System.out.println("Error Info:" + ex.getMessage());
}
}
// Close the document
doc.close();
}
// Custom signature appearance implementation
public static class PdfCustomSignatureAppearance implements IPdfSignatureAppearance {
@Override
public void generate(PdfCanvas pdfCanvas) {
// Set font size
int fontSize = 10;
// Create Arial font
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", Font.PLAIN, fontSize), true);
// Set line height
float lineHeight = fontSize;
// Draw text string
pdfCanvas.drawString("AAAAAAAAAAA", font, PdfBrushes.getRed(), new Point.Float(0, 0));
// Draw image at specified position
pdfCanvas.drawImage(PdfImage.fromFile("E-iceblue logo.png"), new Point.Float(20, 0));
}
}
|
| New Feature | SPIREPDF-8077 | Added support for setting a fallback font when converting OFD to PDF.
OfdConverter converter = new OfdConverter(ofdFile.getAbsolutePath()); converter.getOptions().setDefaultFontName(fontName); converter.toPdf(PdfPath); |
| New Feature | SPIREPDF-8078 | Added a progress callback for OFD to PDF conversion.
CustomProgressNotifier progressNotifier =new CustomProgressNotifier(output_txt);
ofdConverter ofdconverter=new Ofdconverter(inputPath);
ofdconverter.registerProgressNotifier(progressNotifier);
ofdConverter.toPdf(outputPath);
CustomProgressNotifier progressNotifier2=new CustomProgressNotifier(output_txt2);
PdfToWordConverter converter=new PdfTowordConverter(inputPath2);
converter.registerProgressNotifier(progressNotifier2);
converter.saveToDocx(outputPath2)
|
| Bug Fix | SPIREPDF-8040 | Fixed the issue where loading a PDF without a permission password caused an exception. |
| Bug Fix | SPIREPDF-8060 | Fixed the issue where converting an image to PDF caused an exception. |
| Bug Fix | SPIREPDF-8065 | Fixed the issue where checkmarks were missing when converting PDF to PDFA. |
| Bug Fix | SPIREPDF-8067 | Fixed the issue where extracted PDF text contained garbled characters. |
| Bug Fix | SPIREPDF-8079 | Fixed the issue where PDF-to-SVG conversion displayed incorrect content in browsers. |
Spire.PDF for Python 12.6.0 Adds DataSource Support for PdfTable and PdfGrid
We're pleased to announce the release of Spire.PDF for Python 12.6.0. This version mainly exposes the DataSource property for both PdfTable and PdfGrid, enabling direct binding of structured data. Details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | - | Exposed the DataSource property for both PdfTable and PdfGrid, enabling direct binding of structured data.
# Create a PDF document
doc = PdfDocument()
# Get the first page
page = doc.Pages.Add()
# Set initial Y position
y = 320.0
# Draw title
brush1 = PdfBrushes.get_Black()
font1 = PdfTrueTypeFont("Arial", 16.0, PdfFontStyle.Bold, True)
format1 = PdfStringFormat(PdfTextAlignment.Center)
page.Canvas.DrawString("Country List", font1, brush1, page.Canvas.ClientSize.Width / 2, y, format1)
# Update Y position after title
y = y + font1.MeasureString("Country List", format1).Height
y = y + 5.0
# Prepare raw data
data = [
"Name;Capital;Continent;Area;Population",
"Argentina€;Buenos Aires;South America;2777815;32300003",
"Bolivia;La Paz;South America;1098575;7300000",
"Brazil;Brasilia;South America;8511196;150400000",
"Canada;Ottawa;North America;9976147;26500000",
"Chile;Santiago;South America;756943;13200000"
]
# Convert to 2D array
dataSource = [row.split(";") for row in data]
# Create table
table = PdfTable()
table.Style.CellPadding = 2
# Set alternate row font
font = PdfTrueTypeFont("Arial", 8.0, PdfFontStyle.Regular, True)
table.Style.AlternateStyle.Font = font
# Configure header
table.Style.HeaderSource = PdfHeaderSource.Rows
table.Style.HeaderRowCount = 1
table.Style.ShowHeader = True
# Bind data source
table.DataSource = data
# Draw table (Uncomment to enable)
result = table.Draw(page, PointF(60.0, y))
y = y + result.Bounds.Height + 5
# Draw footer note
brush2 = PdfBrushes.get_Gray()
font2 = PdfTrueTypeFont("Arial", 9.0, PdfFontStyle.Regular, True)
page.Canvas.DrawString(f"* {len(data) - 1} countries in the list.",
font2, brush2, 65.0, y)
# Save and close document
doc.SaveToFile(outputFile)
doc.Close()
# Create a PDF document
doc = PdfDocument()
# Add an A4 page with custom margins
page = doc.Pages.Add(PdfPageSize.A4(), PdfMargins(5.0))
# Initialize the grid and set cell padding
grid = PdfGrid()
grid.Style.CellPadding = PdfPaddings(10.0, 10.0, 10.0, 10.0)
# Prepare raw data
data = ["Name;Capital;Continent;Area;Population",
"Argentina;Buenos Aires;South America;2777815;32300003",
"Bolivia;La Paz;South America;1098575;7300000",
"Brazil;Brasilia;South America;8511196;150400000",
"Canada;Ottawa;North America;9976147;26500000",
"Chile;Santiago;South America;756943;13200000"
]
# Bind data source to the grid
grid.DataSource = data
# Center align text in all cells horizontally and vertically
for j in range(grid.Rows.Count):
cells = grid.Rows.get_Item(j).Cells
for k in range(cells.Count):
cells.get_Item(k).StringFormat = PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle)
# Draw the grid on the page
grid.Draw(page, PointF(0.0, 0.0));
# Save the document as a PDF
doc.SaveToFile(outputFile)
# Close the document
doc.Close()
|
Spire.Doc for Java 14.6.0 enhances the conversion from Word to PDF
We're pleased to announce the release of Spire.Doc for Java 14.6.0. This version enhances the conversion from Word to PDF and also fixes an issue where cross-reference fields were updated incorrectly. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREDOC-11785 | Fixed an issue where symbols wrapped incorrectly when converting Word to PDF. |
| Bug Fix | SPIREDOC-11908 | Fixed an issue where cross-reference fields were updated incorrectly. |
| Bug Fix | SPIREDOC-11920 | Fixed an issue where text positions were incorrect when converting Word to PDF. |
| Bug Fix | SPIREDOC-11947 | Fixed an issue where bullet styles were incorrect when converting Word to PDF. |