Spire.PDF 9.7.14 supports retaining the same font name when converting PDF to Word

2023-07-20 09:57:08

We are excited to announce the release of Spire.PDF 9.7.14. This version supports retaining the same font name when converting PDF to Word and setting encryption options with the new interface when encrypting PDF documents. It also enhances the conversion from PDF to images. In addition, some known issues are fixed in this version, such as the issue that the table borders were thicker after printing PDF files. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREPDF-3578 Supports retaining the same font name when converting PDF to Word.
PdfDocument doc = new PdfDocument();
//Add a new page
PdfPageBase page = doc.Pages.Add();
PdfGrid grid = new PdfGrid();
grid.Columns.Add(1);
PdfGridRow headerRow1 = grid.Headers.Add(1)[0];
//HEADER WITHOUT UNCICODE SUPPORT BUT VALID WORD FONT
headerRow1.Style.Font = new PdfTrueTypeFont(new Font("Arial", 11f, FontStyle.Regular), true);
headerRow1.Cells[0].Value = "Spire.PDF for .NET";
headerRow1.Cells[0].StringFormat = new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle);
grid.Draw(page, new PointF(0, 10));
//Save the document to stream
MemoryStream stream = new MemoryStream();
doc.SaveToStream(stream, FileFormat.PDF);
stream.Position = 0L;
PdfToWordConverter converter = new PdfToWordConverter(stream);
converter.SaveToDocx(@"out.docx");
New feature SPIREPDF-4092
SPIREPDF-5734
Supports setting encryption options with the new interface when encrypting PDF documents.
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"in.pdf");           
PdfSecurityPolicy securityPolicy = new PdfPasswordSecurityPolicy(userPassword, ownerPassword);
securityPolicy.EncryptMetadata = false;
securityPolicy.EncryptionAlgorithm = PdfEncryptionAlgorithm.AES_128;
securityPolicy.DocumentPrivilege = PdfDocumentPrivilege.AllowAll;
securityPolicy.DocumentPrivilege.AllowPrint = false;
doc.Encrypt(securityPolicy);
doc.SaveToFile(@"out.pdf");
Bug SPIREPDF-2586 Fixes the issue that the content lost when converting PDF to image.
Bug SPIREPDF-6013 Fixes the issue that the table borders were thicker after printing PDF file.
Bug SPIREPDF-6057 Fixes the issue that it had prompt "cannot extract the embedded font" when opening the converted PDFA3B file.
Bug SPIREPDF-6072 Fixes the issue that the PDF page count obtained was incorrect when the file added an watermark.
Bug SPIREPDF-6080 Optimizes the memory consumption when converting PDF to image.
Bug SPIREPDF-6086 Fixes the issue that the application threw "System.NullReferenceException" when loading a PDF file.
Bug SPIREPDF-6088 Fixes the issue that the application threw "System.IndexOutOfRangeException" when loading a XPS file.
Bug SPIREPDF-6093 Fixes the issue that the result was black after converting PDF to image.
Bug SPIREPDF-6100 Fixes the issue that the application threw "System.NullReferenceException" when converting a PDF file to image.
Bug SPIREPDF-6126 Fixes the issue that the removing the Form field method didn't take effect.
Click the link to download Spire.PDF 9.7.14:
More information of Spire.PDF new release or hotfix: