Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader - Add Support for Image Styles, tabs and line breaks #2127

Open
abf-jricha opened this issue Aug 2, 2021 · 0 comments
Open

Reader - Add Support for Image Styles, tabs and line breaks #2127

abf-jricha opened this issue Aug 2, 2021 · 0 comments

Comments

@abf-jricha
Copy link

abf-jricha commented Aug 2, 2021

Describe the Bug

While loading an existing Word document and save it back, the new document loses the information about the image styles, tabs, and line breaks.

I've fixed this behavior in my local branch and would like to share the results with you. Hope this fix would find its way in the next published release.

#2128

Steps to Reproduce

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

$filename= __DIR__ . "/test.docx";
$phpWord = \PhpOffice\PhpWord\IOFactory::load($filename);
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save($filename);

Changed files

src/PhpWord/Element/Image.php
src/PhpWord/Reader/Word2007/AbstractPart.php
src/PhpWord/Shared/Converter.php
tests/PhpWord/Shared/ConverterTest.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant