Browse our Products
Aspose.Words for Python via .NET 23.12 Release Notes
Major Features
There are 97 improvements and fixes in this regular monthly release. The most notable are:
- Added an ability to specify the page layout to be used when the document is opened in a PDF reader.
- Implemented the way to control how ZIP64 format extensions will be used for OOXML documents.
- Introduced support for WebP images.
Full List of Issues Covering all Changes in this Release
Expand to view the full list of issues.
- Content is moved to previous page upon rendering|New Feature
- Implement WebP image format support upon using DocumentBuilder.InsertImage method |New Feature
- Table layout is wrong after rendering|New Feature
- HTML to PDF conversion issue with table’s cell spacing|New Feature
- Header/Footer content lost during rendering to PDF|New Feature
- The auto fit to window property doesn’t work for a particular table|New Feature
- Lines of Japanese text are wrapped incorrectly during DOCX to PDF conversion|New Feature
- Chinese text is wrapped improperly in table cells|New Feature
- Add CompareMoves setting to the CompareOptions|New Feature
- Issue with Dynabic.Metered licnese code|Enhencement
- Aspose.Words loads HTML as TXT document|Enhencement
- Column width is changed upon rendering|Bug
- DOCX to PDF: Initial View set Page Layout|Bug
- Table column width are incorrect after rendering|Bug
- Cell spacing is lost after conversion from HTML to PDF|Bug
- Table it messed up after rendering|Bug
- RRT to PDF conversion issue with table rendering|Bug
- Table column widths are calculated incorrectly during rendering|Bug
- Table layout corrupted|Bug
- Word to PDF Image gets shifted, truncated in PDF|Bug
- Incorrect width of tables in Chinese document|Bug
- A Table truncates from the left in PDF|Bug
- Table’s cell width is changed after conversion from HTML to PDF|Bug
- Cell’s width is changed after conversion from MHT to DOCX/PDF|Bug
- MHTML to Word and PDF conversion issue with table layout|Bug
- Conversion issue with table layout |Bug
- Text in table is wrapped incorrectly upon rendering HTML document to PDF|Bug
- DOC to PPF conversion issue with tables|Bug
- Table width is decreased after DOC to PDF Conversion |Bug
- Chinese text in table is wrapped improperly|Bug
- Incorrect table width on conversion to PDF|Bug
- Cell’s width is changed after conversion from DOCX to PDF|Bug
- After conversion to PDF a part of a table content is wrapping|Bug
- Table width is changed after converting to fixed page formats|Bug
- Image is truncated in output PDF after inserting HTML into document|Bug
- Cell width is wrong|Bug
- Table in Chinese document is rendered improperly|Bug
- Incorrect grid calculation for an auto-fit table with Asian text inside|Bug
- DOCX to PDF: Table with Chinese text is not rendered correctly|Bug
- Incorrect table column widths for a table with Asian text|Bug
- Tables are rendered with incorrect width|Bug
- Document.PageCount returns incorrect number of pages|Bug
- Texture image size is incorrect upon extrusion|Bug
- Checkboxes are not shaded after merging documents|Bug
- Overlaped Characters after rendering|Bug
- Character overlaps each other|Bug
- Text does not fit in the page causing a blank page|Bug
- TOC page numbers are updated improperly|Bug
- Shape is moved to previous page and is partially cut off|Bug
- System.ArgumentException at FontNameFinder.FindBestMatch|Bug
- Text in table is wrapped improperly upon rendering|Bug
- Truncated text on conversion to PDF|Bug
- Add LowCode.Merger.Merge method overload that accepts array of Document objects as an input|Bug
- Text in shape is hidden after rendering document|Bug
- Dynabic.Metered code fails after obfuscation|Bug
- Part of content is moved to previous page upon rendering|Bug
- DOCX merging issue|Bug
- Support underline formatting in Markdown|Bug
- Comparison displays wrong deletion|Bug
- PageLayout.Build() each time calls DocumentValidator.Execute() that leads to performance degradation|Bug
- Add IsPluginProduct check to licensing code|Bug
- AutoColor is incorrect in the transparent shape|Bug
- NodeImporter throws InvalidOperationException on StructuredDocumentTagRangeStart import|Bug
- Image is lost after converting document to HTML|Bug
- InvalidOperationException upon updating page layout or fields|Bug
- Unhandled exception is thrown if document contains a lot of images|Bug
- StackOverflowException is thrown upon loading RTF document|Bug
- Comment is duplicated after comparing documents|Bug
- DOCX to PDF: System.ArgumentOutOfRangeException|Bug
- FileCorruptedException is thrown upon loading MHTML document|Bug
- Image is lost after conversion to XLSX|Bug
- List items indents are lost after conversion to ODT|Bug
- Corrupted XLSX document is generated when input document contains non-rectangular cell merge area|Bug
- Superscript is rendered as subscript in eqution|Bug
- NullReferenceException is thrown upon calling UpdateFields after UpdatePageLayout|Bug
- EQ Field code is rendered instead of formula|Bug
- Comment is duplicated after comparing documents|Bug
- InvalidOperationException is thrown upon comparing document|Bug
- Redundant hash character is rendered at the end of equation|Bug
- Office Math is rendered improperly|Bug
- Code block gets corrupted during loading Markdown|Bug
- PDF dictionary datetime values are written incorrectly|Bug
- FileCorruptedException is thrown upon loading DOCX document|Bug
- Aspose.Words does not detect different in hyperlink displayed text upon comparing|Bug
- TimeZone is not properly written in XMP metadata|Bug
- Incorrect processing of Type1 font Courier|Bug
- Chart is changed after updating page layout|Bug
- Incorrect rendering of the fullwidth bracket symbols in MathML|Bug
- Converting a DOC (Word 95) document to PDF producing garbled characters|Bug
- Artifacts are shows after open/save documents|Bug
- ArgumentOutOfRangeException is thrown upon rendering document|Bug
- Bookmark moved after comparisson|Bug
- HTML to DOCX: Table styles|Bug
- Decreased image DPI when saving Word document to PDF file|Bug
- Cell paddings are lost after importing HTML|Bug
- RTF to PDF: Table missing|Bug
- Font size is changed after converting PDF to DOCX|Bug
Public API and Backward Incompatible Changes
This section lists public API changes that were introduced in Aspose.Words for Python via .NET 23.12. 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 public property and enumeration to set the initial view page layout that will be used when opening a document in a PDF reader
New public page_layout property has been added to the PdfSaveOptions class:
class PdfSaveOptions
@property
def page_layout(self) -> aspose.words.saving.PdfPageLayout:
"""Specifies the page layout to be used when the document is opened in a PDF reader.
The default value is :attr:`PdfPageLayout.SINGLE_PAGE`."""
...
@page_layout.setter
def page_layout(self, value: aspose.words.saving.PdfPageLayout):
...
New public PdfPageLayout enumeration has been introduced:
class PdfPageLayout(Enum):
"""Specifies the page layout to be used when the document is opened in a PDF reader."""
"""Display one page at a time."""
SINGLE_PAGE: int
"""Display the pages in one column."""
ONE_COLUMN: int
"""Display the pages in two columns, with odd-numbered pages on the left."""
TWO_COLUMN_LEFT: int
"""Display the pages in two columns, with odd-numbered pages on the right."""
TWO_COLUMN_RIGHT: int
"""Display the pages two at a time, with odd-numbered pages on the left."""
TWO_PAGE_LEFT: int
"""Display the pages two at a time, with odd-numbered pages on the right."""
TWO_PAGE_RIGHT: int
Use Case
This use case explains how to specify the page layout to be used when the document is opened in a PDF reader:
from aspose.words import Document
from aspose.words.saving import PdfPageLayout, PdfSaveOptions
doc = Document("Big document.docx")
# Display the pages two at a time, with odd - numbered pages on the left.
save_options = PdfSaveOptions()
save_options.page_layout = PdfPageLayout.TWO_PAGE_LEFT
doc.save("PdfSaveOptions.PageLayout.pdf", save_options)
Added Merger.merge_docs method overload with array of Document objects as an input
A new public method merge_docs has been added to class Merger:
@staticmethod
def merge_docs(input_documents: List[aspose.words.Document], merge_format_mode: aspose.words.lowcode.MergeFormatMode) -> aspose.words.Document:
"""Merges the given input documents into a single document and returns :class:`aspose.words.Document` instance of the final document.
:param input_documents: The input documents.
:param merge_format_mode: Specifies how to merge formatting that clashes."""
...
Use Case
This use case explains how to use new merge_docs method:
from aspose.words import DocumentBuilder
from aspose.pydrawing import Color
from aspose.words.lowcode import Merger, MergeFormatMode
first_doc = DocumentBuilder()
first_doc.font.size = 16
first_doc.font.color = Color.blue
first_doc.write("Hello first word!")
second_doc = DocumentBuilder()
second_doc.write("Hello second word!")
merged_doc = Merger.merge_docs([first_doc.document, second_doc.document], MergeFormatMode.KEEP_SOURCE_LAYOUT)
self.assertEqual("Hello first word!\fHello second word!\f", merged_doc.get_text())
Added public property OoxmlSaveOptions.zip_64_mode and enum type Zip64Mode
New public zip_64_mode property has been added to the OoxmlSaveOptions class:
class OoxmlSaveOptions
@property
def zip_64_mode(self) -> aspose.words.saving.Zip64Mode:
"""Specifies whether or not to use ZIP64 format extensions for the output document.
The default value is :attr:`Zip64Mode.NEVER`."""
...
@zip_64_mode.setter
def zip_64_mode(self, value: aspose.words.saving.Zip64Mode):
...
New public Zip64Mode enumeration has been introduced:
class Zip64Mode(Enum):
"""Specifies when to use ZIP64 format extensions for OOXML files.
OOXML file is a ZIP-archive that has a 4 GB (2^32 bytes) limit on uncompressed size of a file,
compressed size of a file, and total size of the archive, as well as a limit of 65,535 (2^16-1) files in archive.
ZIP64 format extensions increase the limits to 2^64."""
"""Do not use ZIP64 format extensions."""
NEVER: int
"""If necessary use ZIP64 format extensions."""
IF_NECESSARY: int
"""Always use ZIP64 format extensions."""
ALWAYS: int
Use Case
This use case explains how to set Zip64Mode:
import io
import random
from aspose.words import DocumentBuilder
from aspose.pydrawing import Color, Graphics, Bitmap
from aspose.pydrawing.imaging import ImageFormat
from aspose.words.saving import OoxmlSaveOptions, Zip64Mode
builder = DocumentBuilder()
for i in range(0, 10000):
bmp = Bitmap(5, 5)
g = Graphics.from_image(bmp)
g.clear(Color.from_argb(random.randint(0, 254), random.randint(0, 254), random.randint(0, 254)))
data = io.BytesIO()
bmp.save(data, ImageFormat.bmp)
builder.insert_image(data)
data.close()
options = OoxmlSaveOptions()
options.zip_64_mode = Zip64Mode.ALWAYS
builder.document.save("OoxmlSaveOptions.Zip64ModeOption.docx")
Introduced support for WebP images.
Added support for reading WebP image format. Added the ability to both read WebP images from documents and insert them via DocumentBuilder.
Use Case
This use case explains how insert WebP image via DocumentBuilder.
from aspose.words import Document, DocumentBuilder
doc = Document()
builder = DocumentBuilder(doc)
builder.insert_image("WebP image.webp")
doc.save("Image.InsertWebpImage.docx")
Use Case
This use case explains how read WebP image.
from aspose.words import Document, NodeType
from aspose.words.drawing import ImageType
doc = Document("Document with WebP image.docx")
shape = doc.get_child(NodeType.SHAPE, 0, True).as_shape()
self.assertEqual(ImageType.WEB_P, shape.image_data.image_type)