Today, I will highlight the major features introduced in the Aspose.Words for C++ 19.10 release:
Save Word Document as MutiPage TIFF
One of the useful things you may need to do with your Word document (such as DOCX, DOC, RTF and many more) is a conversion to image file(s). For example if you have to present your Word document in a readable and printable but not editable format (e.g. for publication on the Web). One of the simple approaches you could use is a conversion to a multipage TIFF file. Please refer to the following article to learn how to convert a Word document to TIFF format by using Aspose.Words for C++:
Convert Word Document to Multipage TIFF Image
Convert an Image to PDF using C++
It is now possible to create a PDF document from an Image by using Aspose.Words for C++ API. The code example mentioned in the following article shows how easy it is to do with Aspose.Words for C++. The code allows converting single-frame images, such as JPEG, PNG, BMP, EMF or WMF, as well as multi-frame TIFF images and GIF to PDF.
Convert an Image to PDF
Control Threshold for TIFF Binarization using C++
The process of reducing the information contained within the grayscale image from 256 shades of grey to 2 which are black and white and converting it to the binary image is binarization. When a document is converted to TIFF file format, you can control the threshold for TIFF binarization by using the ImageSaveOptions.ThresholdForFloydSteinbergDithering property. The default value of this property is 128. The higher the value, the darker the image. The following code example shows how to use this property to Control Threshold for TIFF Binarization.
Save Image to One Bit per Pixel using C++
The following code example demonstrates how to save the image to one bit per pixel by setting PixelFormat to Format1bppIndexed.
Encrypt DOC or DOT Files With Password using C++
The DocSaveOptions class is used to specify additional options when saving a document into the DOC or DOT format. Using this class, you can set the password to an encrypted document and ignore RoutingSlip data while saving the document. The code example given below shows how to set the password to encrypt the document using RC4 encryption method.
Encrypt DOCX Files With Password using C++
The OoXMLSaveOptions class provides an opportunity to save any document encrypted with the password. Using this class, you can set the password by using OoxmlSaveOptions.Password property while saving the document. The following code example demonstrates how to set the password and save the document to DOCX format.
Extract Content by using DocumentVisitor
You can now use the DocumentVisitor class to implement this usage scenario. This class corresponds to the well-known Visitor design pattern. With DocumentVisitor, you can define and execute custom operations that require enumeration over the document tree. For more details, please check:
How to Extract Content using DocumentVisitor
Get Font Line Spacing
The line spacing of a font is the vertical distance between the baselines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of the character itself. The LineSpacing property was introduced in the Font class to Obtain the Value of Font’s Line Spacing as shown in the example given below:
See Also Useful Links
The resources, you may need to accomplish your tasks:
- Aspose.Words for C++ Online Documentation - up-to-date documentation containing Programmer’s Guide, Knowledge Base and much more.
- Aspose.Words for C++ Product Page
- Install Aspose.Words for C++ NuGet Package
- Aspose.Words for C++ API Reference Guide - detailing the publicly exposed classes, methods, properties, constants & interfaces.
- Download Examples at GitHub Repository - we have published our code examples on the social coding website GitHub.com. Anyone could explore the code examples for learning purposes.
Keeping the Aspose tradition, you are welcome to shape the upcoming releases of Aspose.Words for C++ API by posting your suggestions and concerns in the Aspose.Words for C++ support forum.