Spire.PDFViewer 8.3.0 Fixes "ArgumentNullException" Error When Previewing PDF Files
We're pleased to announce the release of Spire.PDFViewer 8.3.0. This version fixes issue with previewing PDF file throwing "ArgumentNullException" error. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREPDFVIEWER-625 | Fixed issue with previewing PDF file throwing "ArgumentNullException" error. |
Spire.Doc for Java 14.7.0 enhances the Word document comparison feature
We're pleased to announce the release of Spire.Doc for Java 14.7.0. This version introduces new CompareOptions configuration options and adds support for the "Two Lines in One" feature. Moreover, several issues encountered during the conversion of Word to PDF and HTML have been successfully fixed. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREDOC-8865 SPIREDOC-11824 SPIREDOC-10144 | Added setIgnoreFields and setIgnoreCaseChanges configuration options to the CompareOptions class. Renamed setIgnoreTable(boolean value) to setIgnoreTables(boolean value). Renamed the corresponding getter getIgnoreTable() to getIgnoreTables().
Document doc1 = ConvertUtil.GetNewEngineDocument();
doc1.loadFromFile(inputFile_1);
String[] name1 = new String[]{"DJG_Black_Book", "DJG_Repairs_Expense", "DJG_Sale_Amount", "DJG_Dealer_Payment", "DJG_Auction_Fees"};
String[] value1 = new String[]{"20,000.00", "2,000.00", "13,500.00", "1,000.00", "500.00"};
doc1.getMailMerge().execute(name1, value1);
doc1.isUpdateFields(true);
Document doc2 = ConvertUtil.GetNewEngineDocument();
doc2.loadFromFile(inputFile_2);
String[] name2 = new String[]{"DJG_Black_Book", "DJG_Repairs_Expense", "DJG_Sale_Amount", "DJG_Dealer_Payment", "DJG_Auction_Fees"};
String[] value2 = new String[]{"50,000.00", "5,000.00", "3,500.00", "1,000.00", "200.00"};
doc2.getMailMerge().execute(name2, value2);
doc2.isUpdateFields(true);
CompareOptions options = new CompareOptions();
//set 'Moves'
options.setCompareMoves(true);
//set 'Case Changes'
options.setIgnoreCaseChanges(true);
//set 'Comments'
options.setIgnoreComments(true);
//set 'Fields'
options.setIgnoreFields(true);
//set 'Footnotes'
options.setIgnoreFootnotes(true);
//set 'Tables'
options.setIgnoreTables(true);
//set 'Textboxes'
options.setIgnoreTextboxes(true);
doc1.compare(doc2, "user", new Date(), options);
doc1.saveToFile(outputFile, FileFormat.Docx_2013);
doc1.close();
doc2.close();
|
| New Feature | SPIREDOC-11975 | Added support for the "Two Lines in One" feature.
Document doc = ConvertUtil.GetNewEngineDocument();
Section section = doc.addSection();
section.setTextDirection(TextDirection.Right_To_Left);
Paragraph titlePara = section.addParagraph();
titlePara.appendText("===== FarEastLayout Two-Lines-in-One Full Scenario Test =====\n\n");
titlePara.appendText("\n\n1. Basic Two-Lines-in-One: ");
// Basic Two-Lines-in-One Combine=true, no brackets, no vertical layout
Paragraph p1 = section.addParagraph();
TextRange farEastLayout = p1.appendText("Basic Two-Lines-in-One: One Two Three Four");
farEastLayout.getCharacterFormat().setFontSize(12);
farEastLayout.getCharacterFormat().setFontNameFarEast("Songti");
FarEastLayout layout1 = new FarEastLayout();
layout1.setCombine(true); // Two-Lines-in-One
farEastLayout.getCharacterFormat().setFarEastLayout(layout1);
// Two-Lines-in-One + various bracket styles
Paragraph p1Title = section.addParagraph();
p1Title.appendText("\n\n2. Two-Lines-in-One + Different Brackets: ");
for (CombineBrackets bracket : CombineBrackets.values()) {
Paragraph pTmp = section.addParagraph();
TextRange rt = pTmp.appendText("Bracket Type " + bracket.name() + ": A B C D");
rt.getCharacterFormat().setFontSize(12);
rt.getCharacterFormat().setFontNameFarEast("Songti");
FarEastLayout layoutTmp = new FarEastLayout();
layoutTmp.setCombine(true);
layoutTmp.setCombineBrackets(bracket);
rt.getCharacterFormat().setFarEastLayout(layoutTmp);
}
doc.saveToFile(outputFile, FileFormat.Docx);
doc.close();
|
| Bug Fix | SPIREDOC-11155 | Fixed the issue where a StringIndexOutOfBoundsException occurred when comparing documents. |
| Bug Fix | SPIREDOC-11816 | Fixed the issue where table formatting became disordered after accepting revisions. |
| Bug Fix | SPIREDOC-11918 SPIREDOC-11926 SPIREDOC-11960 SPIREDOC-11964 SPIREDOC-11968 | Fixed the issue where content layout was inconsistent when converting Word to PDF. |
| Bug Fix | SPIREDOC-11919 | Fixed the issue where the display effect was incorrect when opening merged Word documents in WPS. |
| Bug Fix | SPIREDOC-11956 | Fixed the issue where table layout was incorrect when converting Word to HTML. |
| Bug Fix | SPIREDOC-11962 | Fixed the issue where images rendered incorrectly when converting Word to PDF in Ubuntu environments. |
| Bug Fix | SPIREDOC-11966 | Fixed the issue where font effects were incorrect when converting Word to PDF. |
| Bug Fix | SPIREDOC-11973 | Fixed the issue where packaging errors occurred in higher-version Java environments. |
| Bug Fix | SPIREDOC-11975 | Added compatibility for "Double-line Combination" effect when converting Word to PDF. |
Spire.Office for Java 11.6.0 is released
We are excited to announce the release of Spire.Office for Java 11.6.0. In this version, Spire.Doc for Java enhances the conversion from Word to PDF; Spire.XLS for Java enhances Excel to PDF and image conversion; Spire.PDF for Java supports setting PDF reading direction and language. 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-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. |
Spire.XLS for Java
| Category | ID | Description |
| Bug Fix | SPIREXLS-6137 | Fixed the issue of incorrect pagination when converting Excel to PDF. |
| Bug Fix | SPIREXLS-6147 | Fixed the issue of the application hanging when converting a worksheet to an image. |
| Bug Fix | SPIREXLS-6156 | Fixed the issue of content being cropped when converting Excel to images. |
Spire.PDF for Java
| 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)
|
| New Feature | SPIREPDF-7990 | Added support for setting PDF reading direction and language.
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputFile);
pdf.getViewerPreferences().setReadingDirection(PdfReadingDirection.LeftToRight);
pdf.setLanguage("zh-CN");
pdf.saveToFile(outputFile , FileFormat.PDF);
|
| New Feature | SPIREPDF-8091 | Added an overload of IPdfSignatureFormatter to PdfMDPSignatureMaker, providing more flexible formatting support for PDF signature operations.
PdfDocument document = new PdfDocument();
PdfPageBase pdfPageBase = document.getPages().add();
pdfPageBase.getCanvas().drawString("Hello, World!",
new PdfFont(PdfFontFamily.Helvetica, 30f),
PdfBrushes.getBlack(), 10, 10);
PdfCertificate certificate = new PdfCertificate(path+"gary.pfx", "e-iceblue");
PdfPKCS7Formatter formatter = new PdfPKCS7Formatter(certificate, false);
String timeStampUrl = "https://rfc3161.ai.moda/adobe";
formatter.setTimestampService(new TSAHttpService(timeStampUrl));
formatter.setOCSPService(new OCSPHttpService(null));
PdfMDPSignatureMaker signatureMaker = new PdfMDPSignatureMaker (document, formatter, PdfMDPSignatureMaker.Level2Permissions);
signatureMaker.makeSignature("signName");
com.spire.pdf.interactive.digitalsignatures.PdfSignature signature = signatureMaker.getSignature();
signature.setName("Gary");
// signature.setReason("This is the final version.");
signature.setLocation("U.S.");
signature.setContactInfo("112554");
PdfSignatureAppearance appearance = new PdfSignatureAppearance(signature);
appearance.setNameLabel("Signer: ");
// appearance.setReasonLabel("Reason: ");
appearance.setLocationLabel("Location: ");
appearance.setContactInfoLabel("Phone: ");
PdfImage image = PdfImage.fromFile(path+"logo.png");
appearance.setSignatureImage(image);
appearance.setGraphicMode(GraphicMode.SignImageAndSignDetail);
Rectangle2D rect = new Rectangle2D.Float();
rect.setFrame(new Point2D.Float(90, 550), new Dimension(150, 80));
signatureMaker.makeSignature("Signature", pdfPageBase,
(float) rect.getMinX(), (float) rect.getMinY(),
(float) rect.getWidth(), (float) rect.getHeight(),
appearance);
String output = "signature.pdf";
document.saveToFile(path+output, FileFormat.PDF);
document.close();
|
| 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. |
| Bug Fix | SPIREPDF-5475 | Fixed an issue where signature validity verification was inaccurate. |
| Bug Fix | SPIREPDF-8086 | Fixed an issue where images were rendered incorrectly. |
Spire.Presentation 11.6.11 adds support for exporting formulas as MathML and LaTeX
We’re pleased to announce the release of Spire.Presentation 11.6.11. This version adds support for exporting formulas as MathML and LaTeX code, making it easier to integrate mathematical expressions into web applications, academic documents, and other workflows. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | - | Added support for exporting formulas as MathML and LaTeX code.
IAutoShape shapeFormula = slide.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(40, currentTop, shapeWidth, formulaHeight)); // Insert LaTeX formula TextParagraph formulaPara = shapeFormula.TextFrame.Paragraphs.AddParagraphFromLatexMathCode(latex); // Export as MathML string mathML = formulaPara.ExportMathML(); // Export as LaTeX string LaTex = formulaPara.ExportLaTex(); |
Spire.PDF 12.6.9 optimizes the parsing logic for converting PDF to fixed-layout Word
We’re pleased to announce the release of Spire.PDF 12.6.9. This version optimizes the parsing logic for converting PDF documents to fixed-out Word files, and fixes several known bugs occurred when converting PDF to Docx, HTML, and XPS to PDF. More details are as follows.
Here is a list of changes made in this release
| Category | ID | Description |
| Adjustment | - | Adjusted the internal parsing logic for converting PDF to fixed-layout Word. Minor differences in conversion results may occur for some documents. |
| Bug Fix | - | Fixed the issue where the generated DOCX document had an incorrect page size when using PdfToWordConverter. |
| Bug Fix | SPIREPDF-8041 | Fixed the issue where generated structured PDF documents failed to pass PDF/UA (ISO 14289-1) standard validation. |
| Bug Fix | SPIREPDF-8082 | Fixed the issue where the program became unresponsive when parsing individual corrupted documents. |
| Bug Fix | SPIREPDF-8092 | Fixed the issue where inconsistent formatting occurred when converting PDF to HTML. |
| Bug Fix | SPIREPDF-8094 | Fixed the issue where an "Invalid font metrics" exception was thrown when converting XPS to PDF. |
Spire.XLS for Java 16.6.5 enhances Excel to PDF and image conversion
We're pleased to announce the release of Spire.XLS for Java 16.6.5. This version enhances the conversion from Excel to PDF and images . It also fixes several issues. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Bug Fix | SPIREXLS-6137 | Fixed the issue of incorrect pagination when converting Excel to PDF. |
| Bug Fix | SPIREXLS-6147 | Fixed the issue of the application hanging when converting a worksheet to an image. |
| Bug Fix | SPIREXLS-6156 | Fixed the issue of content being cropped when converting Excel to images. |
Spire.PDF for Java 12.6.4 supports setting PDF reading direction and language
We're pleased to announce the release of Spire.PDF for Java 12.6.4. This version adds support for setting PDF reading direction and language, and enables more flexible formatting for PDF signature operations. Moreover, it also fixes two bugs affecting signature verification and image rendering. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | SPIREPDF-7990 | Added support for setting PDF reading direction and language.
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputFile);
pdf.getViewerPreferences().setReadingDirection(PdfReadingDirection.LeftToRight);
pdf.setLanguage("zh-CN");
pdf.saveToFile(outputFile , FileFormat.PDF);
|
| New Feature | SPIREPDF-8091 | Added an overload of IPdfSignatureFormatter to PdfMDPSignatureMaker, providing more flexible formatting support for PDF signature operations.
PdfDocument document = new PdfDocument();
PdfPageBase pdfPageBase = document.getPages().add();
pdfPageBase.getCanvas().drawString("Hello, World!",
new PdfFont(PdfFontFamily.Helvetica, 30f),
PdfBrushes.getBlack(), 10, 10);
PdfCertificate certificate = new PdfCertificate(path+"gary.pfx", "e-iceblue");
PdfPKCS7Formatter formatter = new PdfPKCS7Formatter(certificate, false);
String timeStampUrl = "https://rfc3161.ai.moda/adobe";
formatter.setTimestampService(new TSAHttpService(timeStampUrl));
formatter.setOCSPService(new OCSPHttpService(null));
PdfMDPSignatureMaker signatureMaker = new PdfMDPSignatureMaker (document, formatter, PdfMDPSignatureMaker.Level2Permissions);
signatureMaker.makeSignature("signName");
com.spire.pdf.interactive.digitalsignatures.PdfSignature signature = signatureMaker.getSignature();
signature.setName("Gary");
// signature.setReason("This is the final version.");
signature.setLocation("U.S.");
signature.setContactInfo("112554");
PdfSignatureAppearance appearance = new PdfSignatureAppearance(signature);
appearance.setNameLabel("Signer: ");
// appearance.setReasonLabel("Reason: ");
appearance.setLocationLabel("Location: ");
appearance.setContactInfoLabel("Phone: ");
PdfImage image = PdfImage.fromFile(path+"logo.png");
appearance.setSignatureImage(image);
appearance.setGraphicMode(GraphicMode.SignImageAndSignDetail);
Rectangle2D rect = new Rectangle2D.Float();
rect.setFrame(new Point2D.Float(90, 550), new Dimension(150, 80));
signatureMaker.makeSignature("Signature", pdfPageBase,
(float) rect.getMinX(), (float) rect.getMinY(),
(float) rect.getWidth(), (float) rect.getHeight(),
appearance);
String output = "signature.pdf";
document.saveToFile(path+output, FileFormat.PDF);
document.close();
|
| Bug Fix | SPIREPDF-5475 | Fixed an issue where signature validity verification was inaccurate. |
| Bug Fix | SPIREPDF-8086 | Fixed an issue where images were rendered incorrectly. |
Spire.PDF for C++ 12.6.1 enhances the conversion from XPS to PDF
We're pleased to announce the release of Spire.PDF for C++ 12.6.1. This version enhances the conversion from XPS to PDF. Meanwhile, some issues that occurred when converting PDF to the PdfX1A2001 standard and merging PDF documents 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 | SPIREPDF-8034 | Fixes the issue where the resulting document reported an error when converting XPS to PDF. |
| Bug Fix | SPIREPDF-8047 | Fixes the issue where characters overlapped when converting XPS to PDF. |
| Bug Fix | SPIREPDF-8057 | Fixes the issue where image backgrounds turned black when converting PDF to the PdfX1A2001 standard. |
| Bug Fix | SPIREPDF-8074 | Fixes the issue where the program threw a "The index cannot be less than zero or greater than Count" exception when merging PDF documents. |
Spire.Doc for Python 14.6.2 supports configuring license via environment variables
We’re pleased to announce the release of Spire.Doc for Python 14.6.2. This update supports for license configuration via environment variables. More details are as follows.
Here is a list of changes made in this release
| Category | ID | Description |
| New Feature | - | Spire.Doc now automatically detects and loads license information from the following environment variables:
SPIRE_OFFICE_LICENSE_KEY SPIRE_DOC_LICENSE_KEY SPIRE_LICENSE_KEY |
Spire.XLS 16.6.3 adjusts the Worksheet.SaveToPdf() method
We’re pleased to announce the release of Spire.XLS 16.6.3. This version includes an adjustment to the Worksheet.SaveToPdf() method by removing the FileFormat parameter. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| Adjustment | - | Removed the FileFormat parameter from the Worksheet.SaveToPdf() method. |