Spire.PDFViewer 8.2.6 adds support for “Find Previous” and “Find Next” functions
We’re pleased to announce the release of Spire.PDFViewer 8.2.6. This version adds support for the “Find Previous” and “Find Next” functions in Form, WPF, and MAUI. In addition, the method pdfDocumentViewer1.SearchText() has been deprecated and replaced with pdfDocumentViewer1.Find(). More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREPDFVIEWER-616 | Added support for “Find Previous” and “Find Next” functionsin Form, WPF, and MAUI. The pdfDocumentViewer1.SearchText() method has been deprecated and replaced with pdfDocumentViewer1.Find().private void Form1_Load(object sender, EventArgs e)
{
string pdfDoc = @"test.pdf";
if (File.Exists(pdfDoc))
{
this.pdfDocumentViewer1.LoadFromFile(pdfDoc);
this.pdfDocumentViewer1.Find("FindedText", Color.Empty);
}
}
private void before_Click(object sender, EventArgs e)
{
this.pdfDocumentViewer1.FindPrevious();
}
private void next_Click(object sender, EventArgs e)
{
this.pdfDocumentViewer1.FindNext();
}
|
Spire.Presentation 10.10.7 optimizes saving time when creating PowerPoint using templates
We're pleased to announce the release of Spire.Presentation 10.10.7. This version optimizes saving time when creating PowerPoint presentations using templates. Meanwhile, it adds support for setting table transparency and includes adjustments and several bug fixes that improve the overall performance and stability of the product. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Adjustment | — | Adjusted the usage of the AddDigitalSignature method.
Presentation ppt = new Presentation();
ppt.LoadFromFile("in.pptx");
//Add a digital signature,The parameters: string certificatePath, string certificatePassword, string comments, DateTime signTime
ppt.AddDigitalSignature("test.pfx", "e-iceblue", "111", DateTime.Now);
ppt.SaveToFile("result.pptx", Spire.Presentation.FileFormat.Pptx2016);
ppt.Dispose();
|
| New feature | SPIREPPT-3002 | Added support for setting transparency for tables.
table.Fill.Transparency = 0.5f; // Value range is 1-0, table default color is black // Need to set specific table color, set color code as follows: table[0, 0].FillFormat.FillType = Spire.Presentation.Drawing.FillFormatType.Solid; table[0, 0].FillFormat.SolidColor.Color = Color.Orange; |
| Bug | SPIREPPT-2887, SPIREPPT-2954, SPIREPPT-2989 | Fixed the issue with incorrect content when converting PPT to PDF. |
| Bug | SPIREPPT-2997 | Optimized saving time when creating PPT using templates. |
Spire.PDF for Java 11.10.3 supports setting column width for PdfTable.
We are excited to announce the release of Spire.PDF for Java 11.10.3. This version introduces a new feature that allows users to set the column width for PdfTable. Details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | - | Adds support for setting column width for PdfTable.
// Create PDF document
PdfDocument doc = new PdfDocument();
// Set margins
PdfUnitConvertor unitCvtr = new PdfUnitConvertor();
PdfMargins margin = new PdfMargins();
margin.setTop(unitCvtr.convertUnits(2.54f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));
margin.setBottom(margin.getTop());
margin.setLeft(unitCvtr.convertUnits(3.17f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));
margin.setRight(margin.getLeft());
// Add a page
PdfPageBase page = doc.getPages().add(PdfPageSize.A4, margin);
// Add table
PdfTable table = new PdfTable();
PdfSolidBrush brush = new PdfSolidBrush(new PdfRGBColor(Color.black));
table.getStyle().setBorderPen(new PdfPen(brush, 0.5f));
table.getStyle().getHeaderStyle().setStringFormat(new PdfStringFormat(PdfTextAlignment.Center));
table.getStyle().setHeaderSource(PdfHeaderSource.Rows);
table.getStyle().setHeaderRowCount(1);
table.getStyle().setShowHeader(true);
table.getStyle().setCellPadding(2);
table.getStyle().setHeaderSource(PdfHeaderSource.Rows);
table.getStyle().setHeaderRowCount(1);
table.getStyle().setShowHeader(true);
// Set header font and style
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("SimSun", Font.PLAIN, 12));
table.getStyle().getHeaderStyle().setFont(font);
table.getStyle().getHeaderStyle().setBackgroundBrush(PdfBrushes.getCadetBlue());
PdfTrueTypeFont fontBody = new PdfTrueTypeFont(new Font("SimSun", Font.PLAIN, 10));
// Set even row font
table.getStyle().getDefaultStyle().setFont(fontBody);
// Set odd row font
table.getStyle().getAlternateStyle().setFont(fontBody);
// false: distribute by total width proportion, true: use set column width
table.getStyle().isFixWidth(true);
// Define data
String[] data = {"1;2;3;4;5",
"A1;B1;1,391,190,000;18.2%; ",
"A1;B1;126,490,000;1.66%; ",
"A1;B1;65,648,054;0.86%; ",
"A1;B1;82,665,600;1.08%; ",
"A1;B1;37,119,000;0.49%; ",
"A1;B1;327,216,000;4.29%; "
};
String[][] dataSource = new String[data.length][];
for (int i = 0; i < data.length; i++) {
dataSource[i] = data[i].split("[;]", -1);
}
table.setDataSource(dataSource);
for(int i = 0; i < table.getColumns().getCount(); i++)
{
PdfColumn column = table.getColumns().get(i);
column.setWidth(50);
column.setStringFormat(new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle));
}
// Add table to page
table.draw(page, new Point2D.Float(0, 50));
// Save document
doc.saveToFile("addTable.pdf", FileFormat.PDF);
|
Spire.Doc for Java 13.10.6 supports retrieving style change revisions
We're pleased to announce the release of Spire.Doc for Java 13.10.6. This version supports retrieving style change revisions, accepting or rejecting partial revisions, and tracking revision records for styles. Meanwhile, some issues that occurred when converting Word to PDF, HTML to Word, loading and saving Word documents have also been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREDOC-9691 SPIREDOC-8447 | Added support for accepting or rejecting partial revisions.
Document document = new Document();
document.loadFromFile(inputFile);
RevisionInfoCollection revisionInfoCollection= document.getRevisionInfos();
for (int i = 0; i
|
| New feature | SPIREDOC-10632 SPIREDOC-11261 | Added support for retrieving style change revisions.
Document document = ConvertUtil.GetNewEngineDocument();
document.loadFromFile(inputFile);
RevisionInfoCollection revisionInfoCollection= document.getRevisionInfos();
for (RevisionInfo revisionInfo : (java.lang.Iterable)revisionInfoCollection) {
if(revisionInfo.getRevisionType()==RevisionType.Format_Change){
if(revisionInfo.getOwnerObject() instanceof TextRange){
TextRange range = (TextRange)revisionInfo.getOwnerObject();
TestUtil.writeAllText(outputFile,"TextRange:"+range.getText()+"\r\n");
document.setRevisionsView(RevisionsView.Original);
TestUtil.writeAllText(outputFile,"Original bold:"+range.getCharacterFormat().getBold()+"\r\n");
document.setRevisionsView(RevisionsView.Final);
TestUtil.writeAllText(outputFile,"Final bold:"+range.getCharacterFormat().getBold()+"\r\n");
}
}
}
document.close();
|
| New feature | SPIREDOC-11303 | Added support for tracking revision records for styles.
Document document = new Document();
document.loadFromFile("test.docx");
document.startTrackRevisions("e-iceblue");
for (int i=0; i
|
| New feature | SPIREDOC-11313 | Added support for setting the number of characters per line in the document grid.
sec.getPageSetup().setGridType(GridPitchType.Chars_And_Line); sec.getPageSetup().setCharactersPerLine(30); |
| Bug | SPIREDOC-9775 | Fixed the issue where revision acceptance behavior was incorrect. |
| Bug | SPIREDOC-10561 SPIREDOC-11399 SPIREDOC-11405 SPIREDOC-11476 SPIREDOC-11481 SPIREDOC-11518 SPIREDOC-11530 SPIREDOC-11569 SPIREDOC-11585 | Fixed the issues where rendering effect was incorrect when converting Word to PDF. |
| Bug | SPIREDOC-10635 | Fixed the issue that highlight colors could not be retrieved when AcceptChanges() is not called. |
| Bug | SPIREDOC-10995 | Fixed the issue where errors occurred when setting table styles. |
| Bug | SPIREDOC-11433 | Fixed the issue that the table of contents updated incorrectly. |
| Bug | SPIREDOC-11511 SPIREDOC-11599 | Fixed the issues where rendering was incorrect when converting HTML to Word. |
| Bug | SPIREDOC-11519 | Fixed the issue where text was garbled when converting MHT files to DOCX. |
| Bug | SPIREDOC-11520 | Fixed the issue that "IllegalArgumentException" was thrown when loading documents. |
| Bug | SPIREDOC-11525 | Fixed the issue that "NullPointerException" was thrown when loading documents. |
| Bug | SPIREDOC-11531 | Fixed the issue where behavior was incorrect when removing content controls. |
| Bug | SPIREDOC-11551 | Fixed the issue that bookmarks returned empty. |
| Bug | SPIREDOC-11560 | Fixed the issue that selected checkboxes failed to remain checked. |
| Bug | SPIREDOC-11563 | Fixed the issue that content regions were non-editable after accepting revisions. |
| Bug | SPIREDOC-11572 | Fixed the issue where image content was lost when saving documents to WPS format. |
| Bug | SPIREDOC-11584 | Fixed the issue that exceptions were thrown when using useHarfBuzzTextShaper(true) during Word to PDF conversion. |
| Bug | SPIREDOC-11589 | Fixed issue with "NullPointerException" being thrown when using replaceBookmarkContent. () |
| Bug | SPIREDOC-11597 | Fixed the issue that replacement behavior was incorrect. |
| Bug | SPIREDOC-11600 | Fixed the issue that "Cannot remove because there is no parent" exception was thrown when using StructureDocumentTagCell.removeSelfOnly. |
Spire.XLS for Java 15.10.5 optimizes memory consumption when loading Excel documents
We're pleased to announce the release of Spire.XLS for Java 15.10.5. This version optimizes memory consumption when loading Excel documents. Meanwhile, several issues related to retrieving checkboxes, loading large Excel files, worksheet formatting, and file saving have been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Optimization | SPIREXLS-5921 | Optimized memory consumption when loading Excel documents. |
| Bug | SPIREXLS-5185 | Fixed the issue where retrieving checkboxes failed. |
| Bug | SPIREXLS-5913 | Fixed the issue where the application hung when loading Excel files under a configured JVM maximum memory limit. |
| Bug | SPIREXLS-5930 | Fixed the issue where an out-of-memory error occurred when converting Excel to PDF. |
| Bug | SPIREXLS-5954 | Fixed the issue where formatting was inconsistent when copying worksheets. |
| Bug | SPIREXLS-5956 | Fixed the issue where an "error in set print area" exception was thrown when saving Excel files. |
| Bug | SPIREXLS-5957 | Fixed the issue where an "Input string was not in the correct format" exception was thrown when loading Excel files. |
Spire.XLS 15.10.3 adds support for reading Office cached cloud fonts by default
We are delighted to announce the release of Spire.XLS 15.10.3. This version adds support for reading Office cached cloud fonts by default, in addition to system and in-memory fonts. It also adjusts the parameters of the AddDigitalSignature() and IDigitalSignatures.Add() methods, and fixes several known issues to improve the library’s stability and performance. Details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREXLS-5979 | Adds support for reading Office cached cloud fonts by default, besides system font directories and in-memory fonts. |
| Adjustment | - | Modifies the parameter list of the AddDigitalSignature() and IDigitalSignatures.Add() methods.
Old: AddDigitalSignature(X509Certificate2 certificate, string comments, DateTime signTime) New: AddDigitalSignature(string certificatePath, string certificatePassword, string comments, DateTime signTime) |
| Bug | SPIREXLS-5908 | Fixes the issue where extra blank pages were generated when converting Excel files to PDF. |
| Bug | SPIREXLS-5918 | Fixes the issue where an “ArgumentOutOfRangeException” was thrown when loading XLSB files. |
| Bug | SPIREXLS-5933 | Fixes the issue where a “FormatException” was thrown when adding HTML strings. |
| Bug | SPIREXLS-5985 | Fixes the issue where files containing FILTER formulas caused errors when opened in Microsoft Excel. |
Spire.Doc 13.10.3 supports extracting a specified range of pages from a Word file to a separate file
We’re pleased to announce the release of Spire.Doc 13.10.3. This version supports extracting a specified range of pages from a Word file to a different document. Meanwhile, it enhances the conversion from Word to PDF by fixing a series of known bugs. More details are given below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREDOC-11429 | Added the ExtractPages(int index, int count) method to extract a specified range of pages from the document.
Document doc = new Document();
doc.LoadFromFile("sample.docx");
Document extractPage = doc.ExtractPages(0, 1);
extractPage.SaveToFile("result.docx");
|
| Bug | SPIREDOC-11174 | Fixed the issue where content layout was incorrect when converting Word to PDF. |
| Bug | SPIREDOC-11408 | Fixed the issue where table styles were not rendered correctly when converting Word to PDF. |
| Bug | SPIREDOC-11527 | Fixed the issue where fonts were not displayed correctly when converting Word to PDF. |
| Bug | SPIREDOC-11541 | Fixed the issue where a "System.NotSupportedException" exception was thrown when loading a Markdown stream. |
| Bug | SPIREDOC-11544 | Fixed the issue where text position was offset when converting Word to PDF. |
| Bug | SPIREDOC-11552 | Fixed the issue where a "System.ArgumentException: Parent cannot be null" exception was thrown when getting the page count. |
| Bug | SPIREDOC-11553 | Fixed the issue where restricted editing regions inside tables were not preserved correctly when saving Word document. |
Spire.PDF 11.10.4 supports validating the timestamp service URL address
We're pleased to announce the release of Spire.PDF 11.10.4. This version supports validating the timestamp service URL address, and also successfully fixes some known issues that occurred when converting and comparing PDF files. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREPDF-7465 | Added support for validating the timestamp service URL address.
TSAHttpService timestampService = new TSAHttpService("http://time2.certum.pl");
TSAResponse response = timestampService.Check();
//if it is success to receive tsa token
if (response.Success)
{ formatter.TimestampService = timestampService; }
|
| Bug | SPIREPDF-3890 SPIREPDF-5888 SPIREPDF-6680 | Improved the conversion effect from PDF to Word. |
| Bug | SPIREPDF-5657 | Fixed the issue of content loss after converting PDF to image. |
| Bug | SPIREPDF-6451 | Fixed the issue of content loss when converting XPS to PDF. |
| Bug | SPIREPDF-7213 | Fixed the issue of incorrect highlighted vertical text rendering. |
| Bug | SPIREPDF-7378 | Fixed the issue of merging PDF documents throwing exceptions. |
| Bug | SPIREPDF-7680 | Improved the font rendering effect when replacing content. |
| Bug | SPIREPDF-7693 | Fixed the issue of adding timestamps throwing errors. |
| Bug | SPIREPDF-5303 SPIREPDF-7247 SPIREPDF-7719 | Fixed the issue of inconsistent rendering when converting PDF to Tiff. |
| Bug | SPIREPDF-7729 | Fixed the issue of loading PDF documents throwing "NullReferenceException". |
| Bug | SPIREPDF-7768 | Fixed the issue of CreateTemplate() method throwing "IndexOutOfRangeException" when comparing PDFs. |
Spire.Presentation for Java 10.10.2 adds support for converting Markdown to PPTX and SVG to shapes
We are delighted to announce the release of Spire.Presentation for Java 10.10.2. This version adds support for converting Markdown to PPTX files and SVG to shapes. In addition, several known issues have been successfully fixed, including an issue where added LaTeX formulas were rendered incorrectly. Details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | - | Supports converting Markdown to PPTX files.
Presentation pt = new Presentation();
pt.loadFromFile("input.md", FileFormat.Markdown);
pt.saveToFile("output.pptx", FileFormat.PPTX_2013);
pt.dispose();
|
| New feature | - | Adds the AddFromSVGAsShape method to convert SVG into shapes.
Presentation ppt = new Presentation();
ppt.loadFromFile("input.pptx");
for (int i = 0; i < ppt.getSlides().getCount(); i++)
{
ppt.getSlides().get(i).getShapes().addFromSVGAsShapes("in.svg");
}
ppt.saveToFile("output.pptx", FileFormat.PPTX_2013);
ppt.dispose();
|
| Bug | SPIREPPT-2886 | Fixes the issue where added LaTeX formulas were rendered incorrectly. |
| Bug | SPIREPPT-2980 | Fixes the issue where the chart data label formatting was incorrect after converting PowerPoint files to PDF. |
| Bug | SPIREPPT-2981 | Fixes the issue where the text direction was incorrect after converting PowerPoint files to PDF. |
| Bug | SPIREPPT-3009 | Fixes the issue where adding a LaTeX formula (\square) caused a “NullPointerException”. |
Spire.Presentation 10.10.1 supports setting fade-in or fade-out duration of audio
We’re pleased to announce the release of Spire.Presentation 10.10.1. This update introduces features for setting fade-in and fade-out durations for audio, as well as the ability to crop audio. More details are given below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREPPT-2988 | Added support for setting the fade-in or fade-out duration of audio.
// New Append Audio
Presentation pres = new Presentation();
FileStream from_stream = File.OpenRead(inputFile);
RectangleF audioRect = new RectangleF(50, 50, 100, 100);
IAudio audio = pres.Slides[0].Shapes.AppendAudioMedia(from_stream, audioRect);
// Set the duration of the starting fade for 13s
audio.FadeInDuration = 13000f;
// Set the duration of the ending fade for 40s
audio.FadeOutDuration = 10000f;
pres.SaveToFile(outputFile, FileFormat.Pptx2013);
// Retrieve existing documents
FileStream from_stream = File.OpenRead(inputFile);
Presentation presentation = new Presentation();
presentation.LoadFromStream(from_stream, FileFormat.Auto);
foreach (IShape shape in presentation.Slides[0].Shapes)
{
if (shape is IAudio)
{
IAudio audio = shape as IAudio;
// Set the duration of the starting fade for 13s
audio.FadeInDuration = 13000f;
// Set the duration of the ending fade for 20s
audio.FadeOutDuration = 20000f;
}
}
presentation.SaveToFile(outputFile, FileFormat.Pptx2013);
|
| New feature | SPIREPPT-2990 | Added support for cropping audio.
// New Append Audio
Presentation pres = new Presentation();
FileStream from_stream = File.OpenRead(inputFile);
RectangleF audioRect = new RectangleF(50, 50, 100, 100);
IAudio audio = pres.Slides[0].Shapes.AppendAudioMedia(from_stream, audioRect);
// Set the start trimming time 8 seconds
audio.TrimFromStart = 8000f;
// Set the end trimming time 13 seconds
audio.TrimFromEnd = 13000f;
pres.SaveToFile(outputFile, FileFormat.Pptx2013);
// Retrieve existing documents
FileStream from_stream = File.OpenRead(inputFile);
Presentation presentation = new Presentation();
presentation.LoadFromStream(from_stream, FileFormat.Auto);
foreach (IShape shape in presentation.Slides[0].Shapes)
{
if (shape is IAudio)
{
IAudio audio = shape as IAudio;
// Set the start trimming time 8 seconds
audio.TrimFromStart = 8000f;
// Set the end trimming time 13 seconds
audio.TrimFromEnd = 13000f;
}
}
presentation.SaveToFile(outputFile, FileFormat.Pptx2013);
|