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

Change setIndent and setIndentString to be more compatible #103

Closed
hskrtich opened this issue Mar 11, 2014 · 5 comments
Closed

Change setIndent and setIndentString to be more compatible #103

hskrtich opened this issue Mar 11, 2014 · 5 comments

Comments

@hskrtich
Copy link
Contributor

The files PHPWord create seem to be malformed for OpenOffice because PHPWord formats the xml with spaces and newlines. Word removes this lines and shows the document how its supposed to be, but OO inserts a newline for every newline in the xml-doc in the document is shows. Changing these line in Shared/XMLWriter.php fix this.

$this->_xmlWriter->setIndent(false);
$this->_xmlWriter->setIndentString('')

There is a comment in the code saying this might need to be turned off for production.

@ivanlanin
Copy link
Contributor

LibreOffice doesn't report any problem. Removing lines reduces file size, but also reduces readability when studying the source file of the XML. Is it better to implement some kind of settings as (get/set) that people can use depending on their preferences (e.g. $PHPWord->setCompatibility)?

@Progi1984
Copy link
Member

@ivanlanin I support your idea 😉

@hskrtich
Copy link
Contributor Author

@ivanlanin I like the idea but I would propose that the default be false to be more compatible.

@ivanlanin
Copy link
Contributor

I agree. After all, there will be more people using OpenOffice than tweaking the XML :)

@Progi1984
Copy link
Member

@ivanlanin Affirmative !

@Progi1984 Progi1984 added this to the 0.7.1 milestone Mar 13, 2014
@ghost ghost reopened this Oct 18, 2014
@ghost ghost modified the milestones: 0.12.0, 0.8.0 Oct 18, 2014
@ghost ghost self-assigned this Oct 18, 2014
@ghost ghost added Change Request and removed Bug Report labels Oct 18, 2014
@ghost ghost modified the milestones: 0.13.0, 0.12.0 Jan 3, 2015
@ghost ghost modified the milestones: 0.8.0, v0.13.0 Jul 30, 2016
@ghost ghost closed this as completed Jul 30, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants