Browse our Products
Aspose.Words for Python via .NET 23.8 Release Notes
Major Features
There are 106 improvements and fixes in this regular monthly release. The most notable are:
- Introduced functionality to automatically generate a Table of Contents (TOC) for MOBI documents.
- Expanded PdfEncryptionDetails constructor with PdfPermissions.
- Introduced a new public property to specify the size of rendered images in pixels.
- Implemented shaping of vertical text for EMF metafiles.
- Added an option in the LINQ Reporting Engine to preserve whitespaces for JSON string values.
Full List of Issues Covering all Changes in this Release
Expand to view the full list of issues.
Key | Summary | Category |
---|
- Unexpected break (text wrapping) occurs in Cell when rendered to PDF
- Amended version of the Aspose.Word SaveOption WordHtmlFixedSaveOptions
- Add navigation (table of contents, TOC) to generated MOBI documents
- Content are distorted and truncated after MHTML to PDF conversion
- Document.UpdateTableLayout changes the table’s width in output PDF
- Text wrapping problem in Tables during HTML to PDF conversion
- HTML to PDF conversion issue with table’s width
- Table Cells widths are incorrect in rendered TIFF
- Tables in HTML file is not proper in the converted file
- Content are truncated in output PDF after conversion from MHTML
- Table layout is badly formatted after conversion from MHT to DOCX/PDF
- Conversion issue in MSG to PDF - One character per line in Table
- Table content is partially invisible after rendering MHTML document
- Width of table’s cell is changed after conversion from DOCX to PDF
- Image is getting trimmed while converting from DOCX to PDF
- Table/Cell width is not correct in rendered document
- Table Column Cell Widths are incorrect in rendered PDF
- Cell spacing issue while converting DOC to PDF
- Table content is truncated when saving to PDF
- Incorrect document layout upon rendering
- Enable the new table grid re-calculation logic for formats other than DOC/DOCX
- Consider providing PdfEncryptionDetails constructor overload that accepts PdfPermissions and a parameter
- Implement ImageSaveOptions.ImageSize property
- TOC not being updated correctly
- Cell borders with cell spacing 0" are not rendered properly
- A single word Run in Cell is rendering in two lines in PDF
- HTML to PDF conversion issue with Text rendering
- MHTML to PDF conversion issue with number rendering
- Cell width is not calculated correctly during rendering to PDF
- HTML to PDF conversion issue with table’s width
- Table formatting is lost after HTML to PDF
- HTML table not displayed correctly in PDF
- Cell text renders lower than the actual position in PDF
- Table is rendered outside the page in output PDF
- Tables have incorrect widths in PDF
- Content is shifted when rendering mht to pdf or image
- HTML to PDF conversion issue with custom margin
- MHTML to PDF conversion issue with content position
- Incorrect table column width after MHTML to PDF
- Text in a table cell is wrapped when saved to PDF
- MHTML to PDF conversion issue with table’s cell width
- Table width is lost after conversion from HTML to PDF
- When converting HTML to PDF, the output is shrunken
- Incorrect Table layout when converting HTML to PDF
- DOCX to PDF conversion issue with cell width after using LINQ
- Tables are lost in output PDF when UpdateTableLayout is called
- Wrong additional columns appear in Table when converting HTML to DOCX
- Table cell width is changed when HTML is converted to PDF
- HTLM to PDF conversion - Table widths are not correct
- Table moved to the right after conversion to PDF
- Contents are Lost after HTML to PDF conversion
- Table width is incorrect after rendering MHTML document
- DOCX to PDF conversion issue
- Consider adding a warning about missing, empty or not accessing fonts folder
- Incorrect space before the first line on the page after a page break
- Cells spacing is ignored upon rendering|Enhancement
- HTML to PDF conversion issue with table’s cells|Enhancement
- Table Cells have incorrect Widths causing more pages in PDF
- Numbering is changed after converting DOCX to RTF
- Numbers format is changed after conversion from DOCX to XLSX
- DOCX to MD: incorrect heading levels in the output document
- OleFormat.GetRawData returns null
- Numbering is changed after DOCX to RTF conversion
- Footer looks ugly after conversion to XLSX
- Exception is thrown when handling SVG image
- Data label font size changes are not applied
- Data label font size and color changes are not applied
- Remove obsolete SaveOptions.UpdateSdtContent property
- Pdf2Word should process XForm dictionary with missing “Type” key
- LINQ Reporting Engine - JsonDataSource trims whitespaces for string values
- The style changed after xmlns modification
- Incorrect calculation of the minimum height of the math formula
- RTL content is moved outside the page after rendering
- Document comparison long execution time
- The math text size is changed after converting to PDF
- Footer from the first page is mover to the top of the second page after PDF to DOCX conversion
- Hebrew text is rendered improperly
- Performance degradation of UpdateFields
- NullReferenceException is thrown upon comparing documents
- Issue with TIFF images
- IndexOutOfRangeException is thrown upon rendering document
- StructuredDocumentTag.GetText() returns incorrect value for Date SDT
- Bookmark end position is changed after comparing documents
- An exception occurs while saving pages as SVG
- Chart area is shifted upon rendering
- Incorrect shape sizes or properties on HTML to DOCX conversion
- REF field is not updated properly
- “Footnote Reference” is not properly updated
- Bulleted list is converted to numbered list after open/save
- DOCX to PDF with HarfBuzz: Symbols not converted correctly
- Incorrect placement of text in a fraction when using a font with “Internal Leading”
- FileCorruptedException is thrown upon loading HTML document
- Implement PseudoInline property reading for DOC format
- FileCorruptedException is thrown upon loading DOTX document
- Text is wrapped improperly upon rendering
- Problem with Captions and References in the first paragraph
- Text outline in EMF shape partially invisible in AW pdf output
- Image is cropped after rendering
- Shadow effects are rendered incorrectly for glyphs with simulated bold and/or italic style
- Thaana RTL text is exported to PDF as LRT
- Three pages instead of two in DOCX file on Linux
- Hairlines in metafile are barely invisible in Acrobat reader.
- Images are not displayed in Mac TextEdit after open/save RTF document
- Failed to open PDF file generated by our apps
- License Conflict with Cortex XDR
- Rendering document causes tables to continue outside the page
Public API and Backward Incompatible Changes
This section lists public API changes that were introduced in Aspose.Words for Python via .NET 23.8. It includes not only new and obsoleted public methods, but also a description of any changes in the behavior behind the scenes in Aspose.Words for Python via .NET which may affect existing code. Any behavior introduced that could be seen as regression and modifies the existing behavior is especially important and is documented here.
Added a new public property to specify the size of rendered images in pixels
The following public property has been added to the ImageSaveOptions class:
@property
def image_size(self) -> aspose.pydrawing.Size:
'''Gets or sets the size of a generated image in pixels.
This property has effect only when saving to raster image formats.
The default value is (0 x 0), which means that the size of the generated image will be calculated
according to the size of the image in points, the specified resolution and scale.'''
...
@image_size.setter
def image_size(self, value: aspose.pydrawing.Size):
...
Use Case
This use case explains how to render every page of a document to a separate TIFF image at 2325x5325 pixels and 600 dpi:
from aspose.words import BreakType, Document, DocumentBuilder, SaveFormat
from aspose.words.saving import ImageSaveOptions, PageSet
import aspose.pydrawing as pd
doc = Document()
builder = DocumentBuilder(doc)
builder.writeln("Page 1.")
builder.insert_break(BreakType.PAGE_BREAK)
builder.writeln("Page 2.")
builder.insert_break("Logo.jpg")
builder.insert_break(BreakType.PAGE_BREAK)
builder.writeln("Page 3.")
# Create an "ImageSaveOptions" object which we can pass to the document's "Save" method
# to modify the way in which that method renders the document into an image.
options = ImageSaveOptions(SaveFormat.TIFF)
for i in range(doc.page_count):
# Set the "PageSet" property to the number of the first page from
# which to start rendering the document from.
options.page_set = PageSet(i)
# Export page at 2325x5325 pixels and 600 dpi.
options.vertical_resolution = 600
options.horizontal_resolution = 600
options.image_size = pd.Size(2325, 5325)
doc.save(f'ImageSaveOptions.PageByPage.{i + 1}.tiff', options)
Added PdfEncryptionDetails ctor overload with PdfPermissions
class PdfEncryptionDetails:
@overload
def __init__(self, user_password: str, owner_password: str, permissions: aspose.words.saving.PdfPermissions):
'''Initializes an instance of this class.'''
...
Use Case
This use case explains how to use PdfPermissions:
from aspose.words import Document, DocumentBuilder
from aspose.words.saving import PdfEncryptionDetails, PdfPermissions, PdfSaveOptions
doc = Document()
builder = DocumentBuilder(doc)
builder.writeln("Hello world!")
# Extend permissions to allow the editing of annotations.
encryptionDetails = PdfEncryptionDetails("password", "", PdfPermissions.MODIFY_ANNOTATIONS | PdfPermissions.DOCUMENT_ASSEMBLY)
# Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
# to modify how that method converts the document to.PDF.
saveOptions = PdfSaveOptions()
# Enable encryption via the "EncryptionDetails" property.
saveOptions.encryption_details = encryptionDetails
# When we open this document, we will need to provide the password before accessing its contents.
doc.save("PdfSaveOptions.EncryptionPermissions.pdf", saveOptions)
Added the ability to generate TOC (table of contents) for MOBI documents
Now Aspose.Words can generate TOC (table of contents) for MOBI documents.
Desired depth of TOC can be specified same way as it’s done for AZW3 or EPUB documents using HtmlSaveOptions.epub_navigation_map_level property.
Use Case
This use case explains how to create MOBI document with TOC and specify navigation_map_level:
from aspose.words import Document, SaveFormat
from aspose.words.saving import HtmlSaveOptions
doc = Document("Big document.docx")
options = HtmlSaveOptions(SaveFormat.MOBI)
options.navigation_map_level = 5
doc.save("HtmlSaveOptions.CreateMobiToc.mobi", options)
Note: Currently MOBI TOC won’t be displayed by some viewers. For example, MOBI TOC won’t be displayed by calibre app.
The property HtmlSaveOptions.EpubNavigationMapLevel has been deprecated.
The HtmlSaveOptions.epub_navigation_map_level property is marked as obsolete. Please, use HtmlSaveOptions.navigation_map_level instead.
Added an option for LINQ Reporting Engine to preserve whitespaces for JSON string values
Starting from Aspose.Words 23.8, you can instruct LINQ Reporting Engine to preserve leading and trailing whitespaces for JSON string values (which are trimmed by default).
Use Case
This use case explains how to instruct LINQ Reporting Engine to preserve leading whitespaces:
from aspose.words import DocumentBuilder
from aspose.words.reporting import JsonDataLoadOptions, JsonDataSource, JsonSimpleValueParseMode, ReportingEngine
template = r'LINE\r<<[LineWhitespace]>>'
json = b"""{
LineWhitespace:" "
}"""
options = JsonDataLoadOptions()
options.preserve_spaces = True
options.simple_value_parse_mode = JsonSimpleValueParseMode.STRICT
dataSource = JsonDataSource(io.BytesIO(json), options)
builder = DocumentBuilder()
builder.write(template)
print(builder.document.get_text())
engine = ReportingEngine()
engine.build_report(builder.document, dataSource, "ds")