Spire.Doc 14.9.1 supports retrieving, modifying, and copying themes of Word documents
We’re pleased to announce the release of Spire.Doc 14.9.1. This version brings powerful new capabilities for Word document theme management, alongside enhanced chart styling and font embedding controls for document export. Developers can now fully customize, duplicate and edit Word document themes programmatically to unify visual styles across multiple files.
Also, two critical conversion and page-deletion bugs have been resolved to enhance overall processing stability. More details are as follows.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREDOC-11492 | Added support for creating custom document themes.
// Create a new document and apply the theme
Document doc = new Document();
// Configure a custom theme
Theme theme = doc.Theme;
theme.MajorFonts.Latin = "Courier New"; // Set the heading font to Courier New
theme.MinorFonts.Latin = "Agency FB"; // Set the body font to Agency FB
ThemeColors colors = theme.Colors;
colors.Dark1 = Color.MidnightBlue;
colors.Light1 = Color.PaleGreen;
colors.Dark2 = Color.Indigo;
colors.Light2 = Color.Khaki;
colors.Accent1 = Color.OrangeRed;
colors.Accent2 = Color.LightSalmon;
colors.Accent3 = Color.Yellow;
colors.Accent4 = Color.Gold;
colors.Accent5 = Color.BlueViolet;
colors.Accent6 = Color.DarkViolet;
colors.Hyperlink = Color.Black;
colors.FollowedHyperlink = Color.Gray;
Section section = doc.AddSection();
// Create a heading and apply MajorFonts and the Accent1 color
Paragraph heading = section.AddParagraph();
heading.AppendText("Document Theme Test");
heading.ApplyStyle(BuiltinStyle.Heading1);
// Link the heading style to MajorFonts
ParagraphStyle heading1Style = (ParagraphStyle)doc.Styles["Heading 1"];
heading1Style.CharacterFormat.ThemeFont = ThemeFont.Major; // Use the Major theme font (heading font)
heading1Style.CharacterFormat.ThemeColor = ThemeColor.Accent1; // Use the Accent1 theme color
// Create a body paragraph and apply MinorFonts
Paragraph body = section.AddParagraph();
body.AppendText("This document uses a custom theme created programmatically.");
// Link the Normal style to MinorFonts
ParagraphStyle normalStyle = (ParagraphStyle)doc.Styles["Normal"];
normalStyle.CharacterFormat.ThemeFont = ThemeFont.Minor; // Use the Minor theme font (body font)
normalStyle.CharacterFormat.ThemeColor = ThemeColor.Text1; // Use the default text color
// Add a test paragraph to verify the theme color
Paragraph colorTest = section.AddParagraph();
TextRange textRange = colorTest.AppendText("Accent1 Color Test");
textRange.CharacterFormat.ThemeColor = ThemeColor.Accent1; // Use the Accent1 theme color directly
doc.SaveToFile(outputFile, FileFormat.Docx);
doc.Close();
|
| New Feature | SPIREDOC-11492 | Added support for copying the theme of an existing document to another.
// Load the source document and get its theme
Document sourceDoc = new Document();
sourceDoc.LoadFromFile("Theme.docx");
Theme sourceTheme = sourceDoc.Theme;
// Create a destination document
Document newDoc = new Document();
// Copy the source document's theme (theme fonts and colors) to the destination document
sourceDoc.CloneThemesTo(newDoc);
newDoc.SaveToFile("CopyTheme.docx", FileFormat.Docx);
|
| New Feature | SPIREDOC-11492 | Added support for retrieving and modifying document theme.
Document doc = new Document();
// Set the font faces of the document theme
doc.Theme.MinorFonts.Latin = "Algerian";
doc.Theme.MinorFonts.EastAsian = "Aharoni";
doc.Theme.MinorFonts.ComplexScript = "Andalus";
// Set the theme font and theme color of the style's character format
CharacterFormat font = ((ParagraphStyle)doc.Styles["Normal"]).CharacterFormat;
font.ThemeFont = ThemeFont.Minor;
font.ThemeColor = ThemeColor.Accent2;
// Get the theme font and theme color
ThemeFont themeFont = font.ThemeFont;
string fontName = font.FontName;
Color textColor = font.TextColor;
doc.SaveToFile("ThemeAttributes.docx", FileFormat.Docx);
|
| New Feature | SPIREDOC-11878 | Added support for the "embed only the characters used in the document" setting.
doc.setEmbedFontsInFile(true); doc.setSaveSubsetFonts(true); |
| New Feature | - | Added support for setting the fill format of charts and their data series.
// Create a document and add a column chart
Document doc = new Document();
Section section = doc.AddSection();
ShapeObject shape = section.AddParagraph().AppendChart(ChartType.Column, 500, 300);
Chart chart = shape.Chart;
chart.Series.Clear();
chart.Series.Add("Sales", new string[] { "Q1", "Q2", "Q3", "Q4" }, new double[] { 120, 90, 160, 200 });
// Chart area - solid fill
chart.Format.Fill.FillType = FillType.Solid;
chart.Format.Fill.Color = Color.OrangeRed;
chart.Format.Fill.Transparency = 0.3;
// Data points of the first series - linear gradient fill
Fill seriesFill = chart.Series[0].DataPoints.Format.Fill;
seriesFill.FillType = FillType.Shade;
seriesFill.GradientType = GradientFillType.Linear;
seriesFill.SetGradientDirection(GradientFillDirection.LinearUp);
seriesFill.GradientStops.Add(new GradientStop(0, Color.White));
seriesFill.GradientStops.Add(new GradientStop(1, Color.OrangeRed));
// Data labels - enable and use a solid fill
chart.Series[0].HasDataLabels = true;
chart.Series[0].DataLabels.Format.Fill.FillType = FillType.Solid;
chart.Series[0].DataLabels.Format.Fill.Color = Color.LightYellow;
doc.SaveToFile("ChartFill.docx", FileFormat.Docx);
// Create a document and add a line chart
Document doc = new Document();
Section section = doc.AddSection();
ShapeObject shape = section.AddParagraph().AppendChart(ChartType.Line, 500, 300);
Chart chart = shape.Chart;
chart.Series.Clear();
chart.Series.Add("Trend", new string[] { "Cat1", "Cat2", "Cat3", "Cat4" }, new double[] { 4.3, 2.4, 3.1, 5.2 });
// Chart area - border weight, dash style and solid color
chart.Format.Stroke.Weight = 2;
chart.Format.Stroke.DashStyle = DashStyle.Dash;
chart.Format.Stroke.Fill.FillType = FillType.Solid;
chart.Format.Stroke.Fill.Color = Color.Blue;
// Data series border - set through its data points
chart.Series[0].DataPoints.Format.Stroke.Fill.FillType = FillType.Solid;
chart.Series[0].DataPoints.Format.Stroke.Fill.Color = Color.Red;
chart.Series[0].DataPoints.Format.Stroke.Weight = 1.5;
// Start and end arrows on the axes
chart.AxisX.Format.Stroke.StartArrowType = ArrowType.Arrow;
chart.AxisX.Format.Stroke.EndArrowType = ArrowType.Arrow;
chart.AxisY.Format.Stroke.StartArrowType = ArrowType.Arrow;
chart.AxisY.Format.Stroke.EndArrowType = ArrowType.Arrow;
doc.SaveToFile("ChartStroke.docx", FileFormat.Docx);
|
| Bug Fix | SPIREDOC-12046 | Fixed the issue where extra pages were deleted when deleting pages in Word documents. |
| Bug Fix | SPIREDOC-12058 | Fixed the issue where some Symbol font characters were missing during Word to PDF conversion. |
Spire.PDF for Java 12.9.0 supports rich text and stream input
We're pleased to announce the release of Spire.PDF for Java 12.9.0. This version adds support for rich text in PdfGridCell and stream input for PdfToWordConverter, and fixes several known issues related to PDF to image conversion, PDF to PDF/A-2B conversion, JPMS module encapsulation compatibility, and PDF merging. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREPDF-8081 | Added a method to support adding rich text to PdfGridCell.
/ Add rich text
cellContent1.setRichText("<html><body><p style='color:black; font-size:14pt;'>Hello World</p></body></html>");
|
| New Feature | SPIREPDF-8127 | PdfToWordConverter now supports stream input.
InputStream fileStream = new FileInputStream(inputFile); PdfToWordConverter convert = new PdfToWordConverter(fileStream); convert.saveToDocx(outputFile); |
| Bug Fix | SPIREPDF-8140 | Fixed an issue where form content was lost when converting PDF to image. |
| Bug Fix | SPIREPDF-8143 | Fixed an issue where the program hung when converting PDF to PDF/A-2B. |
| Bug Fix | SPIREPDF-8146 | Fixed an IllegalAccessError compatibility issue caused by JPMS module encapsulation when running PDF features on JDK 9+. |
| Bug Fix | SPIREPDF-8149 | Fixed an issue where a NullPointerException was thrown when merging PDF documents. |
Spire.Office 11.8.0 is released
We're pleased to announce the release of Spire.Office 11.8.0. This version adds several new features. For example, Spire.XLS adds support for the TEXTSPLIT formula; Spire.Barcode synchronizes BarcodeSettings enumeration settings on the NETStandard platform. In addition, a series of issues that occurred when processing Word, Excel, PDF, and 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: 14.8.0
- Spire.Pdf.dll: 12.8.5
- Spire.XLS.dll: 16.8.2
- Spire.Presentation.dll: 11.8.4
- Spire.Barcode.dll: 7.5.8
- Spire.DocViewer.dll: 8.9.5
- Spire.Email.dll: 6.8.0
- Spire.OfficeViewer.dll: 8.8.1
- Spire.PdfViewer.Asp.dll: 8.3.0
- Spire.PdfViewer.Forms.dll: 8.3.0
- Spire.Spreadsheet.dll: 7.5.3
Here is a list of changes made in this release
Spre.Doc
| Category | ID | Description |
| Bug Fix | SPIREDOC-11385 | Fixed an issue where a “NullReferenceException” was thrown when retrieving the layout elements of a paragraph. |
| Bug Fix | SPIREDOC-11848 | Fixed an issue where the document layout was rendered incorrectly when converting Word documents to PDF. |
| Bug Fix | SPIREDOC-11981 | Fixed an issue where an “ArgumentOutOfRangeException” was thrown when converting Word documents to PDF. |
Spre.XLS
| Category | ID | Description |
| New Feature | SPIREXLS-6201 | Added support for the TEXTSPLIT formula.
sheet.getCellRange("A8").setFormula("=TEXTSPLIT(\"A,B,C\", \",\")");
|
| Bug Fix | SPIREXLS-6193 | Fixed an issue where the file content was corrupted when saving to an OFD stream. |
| Bug Fix | SPIREXLS-6194 | Fixed an issue where data was lost due to incorrect type inference when exporting mixed-type columns with KeepDataType enabled. |
| Bug Fix | SPIREXLS-6198 | Fixed an issue where formula calculation with CalculateAllValue returned "N/A" errors. |
Spire.Presentation
| Category | ID | Description |
| Bug Fix | SPIREPPT-3090 SPIREPPT-3115 | Fixed the issue where the content was inconsistent when converting PPTX to PDF. |
| Bug Fix | SPIREPPT-3146 | Fixed the issue where text content was rendered as <path> tags when converting PPTX to SVG. |
| Bug Fix | SPIREPPT-3158 | Fixed the issue where the content was incorrect when exporting shapes to SVG in PPTX. |
| Bug Fix | SPIREPPT-3087 | Fixes the issue where black boxes appear when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3107 | Fixes the issue where attachment names are garbled when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3170 | Fixes the issue where part of the text is covered when converting PowerPoint documents to PDF. |
| Bug Fix | SPIREPPT-3184 | Fixes the issue where some shapes are converted to NULL when calling SaveAsSvgInSlide to convert shapes to SVG. |
Spire.PDF
Class Name Adjustments
| Old | New |
| PdfTextMarkupAnnotationWidget | PdfTextMarkupAnnotation |
| PdfFreeTextAnnotationWidget | PdfFreeTextAnnotation |
| PdfTextAnnotationWidget | PdfTextAnnotation |
| PdfPopupAnnotationWidget | PdfPopupAnnotation |
| PdfLineAnnotationWidget | PdfLineAnnotation |
| PdfRubberStampAnnotationWidget | PdfRubberStampAnnotation |
| PdfPolyLineAnnotation | PdfPolylineAnnotation |
| PdfAttachmentAnnotation | PdfFileAttachmentAnnotation |
| PdfEmbeddedGoToAction | PdfGoToEmbeddedAction |
| PdfTextMarkupAnnotation | PdfHighlightAnnotation |
Property Adjustments
| Old | New | Description |
| xxx.Text | xxx.Contents | Annotation text content |
| xxx.Author | xxx.Title | Annotation author / title |
| xxx.Bounds | xxx.Rectangle | Annotation bounding rectangle |
| xxx.TextMarkupColor | xxx.Color | Highlight / markup color |
| xxx.Opacity | xxx.StrokingOpacity | Stroking opacity |
| xxx.LineEndingStyle | xxx.CalloutLineEndingStyle | Callout line ending style |
| xxx.CalloutLines | xxx.CalloutLine | Callout line points |
| xxx.BorderStyle / xxx.BorderWidth(lineBorder) | xxx.Border.Style / xxx.Border.Width | Line border style / width |
| xxx.BeginLineStyle / xxx.EndLineStyle | xxx.StartingStyle / xxx.EndingStyle | Line ending styles |
| xxx.InnerLineColor / xxx.BackColor | xxx.InteriorColor / xxx.Color | Line interior color / background color |
| xxx.LeaderLineExt | xxx.LeaderLineExtension | Leader line extension |
| xxx.BorderEffect = PdfBorderEffect.BigCloud | xxx.Border.Effect = PdfBorderEffect.Cloudy | Cloudy border effect |
| Category | ID | Description |
| Bug Fix | SPIREPDF-7681 | Fixes the issue where adding attachments failed. |
| Bug Fix | SPIREPDF-8080 | Fixes the issue where PdfGrayConverter.ToGrayPdf() produced incorrect effects. |
| Bug Fix | SPIREPDF-8122 | Fixes the issue where extracting images produced incorrect results. |
| Bug Fix | SPIREPDF-8114 | Fixed an issue where the program threw a “System.InvalidOperationException: can not convert to rectangle” error when converting PDF to images. |
| Bug Fix | SPIREPDF-8131 | Fixed an issue where characters overlapped when extracting text from PDF files. |
Spire.Barcode
| Category | ID | Description |
| New Feature | SPIREBARCODE-280 | Added support for synchronizing BarcodeSettings enumeration settings on the NETStandard platform.
setting.BorderDashStyle = Spire.Barcode.Publics.Drawing.DashStyle.DashDotDot; Spire.Barcode.Publics.Drawing.StringAlignment.Center; |
| Bug Fix | SPIREBARCODE-290 | Improved and optimized barcode recognition accuracy. |
| Bug Fix | SPIREBARCODE-295 SPIREBARCODE-289 | Fixes the issue where barcode and QR code recognition results were incorrect. |
Spire.Office for Java 11.8.0 is released
We are happy to announce the release of Spire.Office for Java 11.8.0. In this version, Spire.Doc for Java enhances Word to PDF and SVG conversion; Spire.XLS for Java fixes a project packaging issue in Vaadin 25 + Java 21; Spire. Presentation for Java enhances the conversion from PowerPoint to images; Spire.PDF for Java enhances the conversion from PDF to Word. Besides, many issues have been successfully fixed in this version. More details are listed below.
Here is a list of changes made in this release
Spire.Doc for Java
| Category | ID | Description |
| Bug Fix | SPIREDOC-12006 | Fixed an issue where a NullPointerException was thrown when converting Word documents to SVG. |
| Bug Fix | SPIREDOC-11950 SPIREDOC-12028 | Fixed an issue where the layout was inconsistent with the original document when converting Word documents to PDF. |
| Bug Fix | SPIREDOC-12039 SPIREDOC-12045 SPIREDOC-12056 | Fixed an issue where characters such as Hebrew were not rendered correctly when converting Word documents to PDF. |
Spire.XLS for Java
| Category | ID | Description |
| Bug Fix | SPIREXLS-6159 | Fixed an issue where project packaging failed in the Vaadin 25 + Java 21 environment because an internal class inherited from a final class. |
Spire.Presentation for Java
| Category | ID | Description |
| Bug Fix | SPIREPPT-3171 | Fixed the issue where text was offset when converting PowerPoint to images. |
Spire.PDF for Java
| Category | ID | Description |
| Bug Fix | - | Optimized PDF to Word conversion effects. |
| Bug Fix | SPIREPDF-8029 SPIREPDF-8117 | Fixes the issue where the program hangs when converting PDF to Word. |
| Bug Fix | SPIREPDF-8037 | Fixes the issue where footer styles are incorrect when converting PDF to Word. |
| Bug Fix | SPIREPDF-8039 | Fixes the issue where the program throws java.lang.OutOfMemoryError: Java heap space when converting OFD to Word. |
| Bug Fix | SPIREPDF-8045 | Fixes the issue where table formatting gets messed up when converting PDF to Word. |
Spire.XLS for Java 16.8.4 fixes a project packaging issue in Vaadin 25 + Java 21
We’re pleased to announce the release of Spire.XLS for Java 16.8.4. This version fixes an issue that caused project packaging to fail in the Vaadin 25 + Java 21 environment due to an internal class inheriting from a final class. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREXLS-6159 | Fixed an issue where project packaging failed in the Vaadin 25 + Java 21 environment because an internal class inherited from a final class. |
Spire.PDF for Java 12.8.20 enhances the conversion from PDF to Word
We’re pleased to announce the release of 12.8.20. This update focuses on resolving defects encountered during PDF and OFD to Word document conversion, delivering more stable running performance, and accurate layout restoration. More details are as follows.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREPDF-8029 SPIREPDF-8117 | Fixes the issue where the program hangs when converting PDF to Word. |
| Bug Fix | SPIREPDF-8037 | Fixes the issue where footer styles are incorrect when converting PDF to Word. |
| Bug Fix | SPIREPDF-8039 | Fixes the issue where the program throws java.lang.OutOfMemoryError: Java heap space when converting OFD to Word. |
| Bug Fix | SPIREPDF-8045 | Fixes the issue where table formatting gets messed up when converting PDF to Word. |
Spire. Presentation for Java 11.8.3 enhances the conversion from PowerPoint to images
We are pleased to announce the release of Spire.Presentation for Java 11.8.3. This version mainly fixes an issue while converting PowerPoint to images. Details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREPPT-3171 | Fixed the issue where text was offset when converting PowerPoint to images. |
Spire.Barcode 7.5.8 fixes the issue where barcode and QR code recognition results were incorrect
We're pleased to announce the release of Spire.Barcode 7.5.8. This version successfully fixes the issue where barcode and QR code recognition results were incorrect. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREBARCODE-295 SPIREBARCODE-289 | Fixes the issue where barcode and QR code recognition results were incorrect. |
Spire.Doc for Java 14.8.4 enhances Word to PDF and SVG conversion
We’re pleased to announce the release of Spire.Doc for Java 14.8.4. This version fixes several issues related to Word-to-SVG and Word-to-PDF conversion, including an exception when converting Word documents to SVG and inconsistent layouts when converting Word documents to PDF. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREDOC-12006 | Fixed an issue where a NullPointerException was thrown when converting Word documents to SVG. |
| Bug Fix | SPIREDOC-11950 SPIREDOC-12028 | Fixed an issue where the layout was inconsistent with the original document when converting Word documents to PDF. |
| Bug Fix | SPIREDOC-12039 SPIREDOC-12045 SPIREDOC-12056 | Fixed an issue where characters such as Hebrew were not rendered correctly when converting Word documents to PDF. |
Spire.Doc for Python 14.8.1 adds a new method for comparing objects between two paragraphs
We’re pleased to announce the release of Spire.Doc for Python 14.8.1. This version adds the Paragraph.ReferenceEquals method for comparing objects between two paragraphs. Besides, several known bugs have been successfully resolved. More details are as follows.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREDOC-11128 | Added the Paragraph.ReferenceEquals method for comparing objects between two paragraphs. |
| Bug Fix | SPIREDOC-11676 | Fixed the issue where an exception was thrown when adding comments under track revisions mode. |
| Bug Fix | SPIREDOC-11771 | Fixed the issue where the AppendChart method threw an AttributeError exception. |
| Bug Fix | SPIREDOC-11877 | Fixed the issue where the format of reply comments was incorrect. |
| Bug Fix | SPIREDOC-11886 | Fixed the issue where the result of adding ReplyComment was incorrect. |