Skip to content

Formatting loss during docx to HTML conversion  #2378

Open
@qwertynik

Description

@qwertynik

Describe the Bug

When converting from docx to HTML, styling information is not extracted and applied during conversion.

Steps to Reproduce

test.docx

<?php
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\Style;

require __DIR__ . '/vendor/autoload.php';

$documentPath = 'test.docx';
$phpWord = IOFactory::load($documentPath);

//Write word document to html
$xmlWriter = IOFactory::createWriter($phpWord, 'HTML');

$xmlWriter->save('test.html');

Expected Behavior

All the styling information present in the docx should also be available in the HTML output.

Current Behavior

Styling information is missing in the HTML output.

Context

  • PHP Version: 7.4.6
  • PHPWord Version: 1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions