Expanding text from right to left while exporting Excel file to HTML with C++

Expanding text from right to left while exporting Excel file to HTML

The following sample code converts the sample Excel file into HTML. This screenshot shows how the sample Excel file looks in Microsoft Excel 2013.

todo:image_alt_text

This screenshot shows the output HTML generated with the older version.

todo:image_alt_text

This screenshot shows the output HTML generated with the newer version.

todo:image_alt_text

As you can see in the screenshots, the newer version expands the right-aligned text to the left correctly, just like Microsoft Excel.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // Source directory path
    U16String srcDir(u"..\\Data\\01_SourceDirectory\\");

    // Load source excel file inside the workbook object
    Workbook wb(srcDir + u"sample.xlsx");

    // Save workbook in html format
    U16String outputPath = srcDir + u"ExpandTextFromRightToLeft_out_" + CellsHelper::GetVersion() + u".html";
    wb.Save(outputPath, SaveFormat::Html);

    std::cout << "Workbook saved successfully in HTML format!" << std::endl;

    Aspose::Cells::Cleanup();
}