We're pleased to announce the release of Spire.PDF 11.7.14. The latest version supports XlsxLineLayoutOptions.TextRecognizer to enhance the PDF-to-Excel conversion using OCR libraries. Moreover, some known bugs are fixed in the new version, such as the issue that the content was incorrect when converting XPS to PDF. More details are listed below.
Here is a list of changes made in this release
| Category | ID | Description |
| New feature | SPIREPDF-7430 SPIREPDF-7427 |
Supports XlsxLineLayoutOptions.TextRecognizer to enhance the PDF-to-Excel conversion using OCR libraries.
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("in.pdf");
XlsxLineLayoutOptions options = new XlsxLineLayoutOptions(false, false, false, true);
options.TextRecognizer = new TextRecognizer();
doc.ConvertOptions.SetPdfToXlsxOptions(options);
doc.SaveToFile("out.xlsx", Spire.Pdf.FileFormat.XLSX);
// niget install PaddleOCRSharp lib
using PaddleOCRSharp;
using Spire.Pdf.Conversion;
public class TextRecognizer : ITextRecognizer
{
private static readonly PaddleOCREngine _engine;
static TextRecognizer()
{ _engine = new PaddleOCREngine(null, “”); }
public string RecognizeGlyph(Stream glyphImageStream)
{
var image = new System.Drawing.Bitmap(glyphImageStream);
// paint glyph in image center
var fixImage = new System.Drawing.Bitmap(160, 240);
using (Graphics g = Graphics.FromImage(fixImage))
{ g.DrawImage(image, new RectangleF(20, 20, fixImage.Width - 40, fixImage.Height - 40), new RectangleF(0, 0, image.Width, image.Height), GraphicsUnit.Pixel); }
var unicodeResult = _engine.DetectText(fixImage).Text;
return unicodeResult;
}
}
|
| Bug | SPIREPDF-2800 | Fixes the issue that the content was incorrect when converting XPS to PDF. |
| Bug | SPIREPDF-3727 SPIREPDF-3984 SPIREPDF-5085 |
Optimizes performance for PDF-to-image conversion to reduce processing time. |
| Bug | SPIREPDF-3818 | Improves PDF printing performance. |
| Bug | SPIREPDF-7004 | Fixes the issue where content was missing during PDF-to-image conversion. |
| Bug | SPIREPDF-7043 | Fixes the issue that the content was incorrect when converting PDF to PDF/A. |
| Bug | SPIREPDF-7399 | Fixes the issue where PDF content could not be extracted. |
| Bug | SPIREPDF-7463 | Fixes the issue where content overlapped during PDF-to-image conversion. |
| Bug | SPIREPDF-7574 SPIREPDF-7575 SPIREPDF-7576 SPIREPDF-7577 SPIREPDF-7578 |
Fixes the issue that the content was incorrect when converting OFD to PDF or images. |
| Bug | SPIREPDF-7598 | Fixes the issue that duplicate "Indirect reference" entries were caused by Attachments.Add(). |
| Bug | SPIREPDF-7609 | Fixes the issue where the program threw System.NullReferenceException error when releasing pdfTextFinder objects. |
Click the link to download Spire.PDF 11.7.14:
More information of Spire.PDF new release or hotfix: