Ask Your Question

Indentation issue when converting to html

asked 2017-12-19 12:47:40 +0200

sakshi gravatar image

updated 2018-01-11 11:58:26 +0200

Lupp gravatar image

Hi Team, We are using libreoffice 4.3 to convert word document to HTML. The document generated by libre office has indentation issues. In the word document, we have many p tags as ordered list which after conversion adds inline css.

Here is an example of the code snippet of the converted html document:

<p align="left" style="margin-left: 0.25in; text-indent: -0.25in; margin-bottom: 0.17in; line-height: 0.17in; widows: 2; orphans: 2">
<a name="5c188da9-cdb8-406b-9809-dd4a0316dba2-1"></a>
<font face="Arial, serif">
<font size="2" style="font-size: 11pt">
1. Some Text Here

Please look into this asap.

(Edited 2018-01-11 by @sakshi:) Now there is a demo file: C:\fakepath\SampleDocument_IndentIssue.docx

(Edited slightly for better readability by @Lupp )

edit retag flag offensive close merge delete


Look into what? "1. Some Text Here"? and look who? users using this peer-to-peer help forum?

If you found a bug, then you should file a bug report; and as stated in this forum's rules (available on the forum's main page as "How to use this Ask site"), bug reports are off-topic here.

Mike Kaganski gravatar imageMike Kaganski ( 2017-12-19 13:08:23 +0200 )edit

Sorry! There is no "team" here, but independent volunteers.
Sorry again: I don't now enough about your issue to answer the question, but:
Your issue is specific to 'Writer'. Please edit your question and add the tag writer. You may remove common instead.

Lupp gravatar imageLupp ( 2017-12-19 13:13:00 +0200 )edit

Oh! Just noticed the version there... 4.3! And the asker wants someone to "look into this ASAP"! Sigh...

Mike Kaganski gravatar imageMike Kaganski ( 2017-12-19 13:35:10 +0200 )edit

@sakshi: You recently updated your question. (I cannot find the differences yet.) But you did not regard the comment by @Mike Kaganski here above. To be clear:
Your version 4.3 has reached end of development long ago. The same with 4.4, and there never was a 4.5. The series of versions for which still bug fixing is done is 5.4. The next "fresh" version 6.0 is to come soon. is presently in Beta2 state

Lupp gravatar imageLupp ( 2017-12-20 12:25:33 +0200 )edit

@sakshi: I still can't find what changs you made by editing.
And I still don't know what indentation issues there are.

Lupp gravatar imageLupp ( 2017-12-20 18:10:20 +0200 )edit


Can the issue of the indentation can be resolved or is handled in the version 5.4.

Thanks Sakshi Singh

sakshi gravatar imagesakshi ( 2018-01-05 15:39:35 +0200 )edit

Did you read my answer below?
Without better information there will not be any progress in this thread. As far as I can see nobody can even tell if there actually is an issue that might need a fix.
I perssonally cannot find the information needed for trying to find out if there is a related bug report.

Lupp gravatar imageLupp ( 2018-01-05 21:18:54 +0200 )edit


We can not share the word document or the screenshot of the resultant html due to some security issues. If we were able to show it the issue can be better explained thus can we have a discussion over call if possible so that I can explain the issue.

Kindly let us know in case of any concerns.

Thanks Sakshi

sakshi gravatar imagesakshi ( 2018-01-09 09:01:53 +0200 )edit

I will grant the "karma" needed for attaching documents. (I am not much interested in screenshots. To check some html code for the way it gets rendered I can use my own browser.)
If y documnt type is rejected you may append a fake extension.

Lupp gravatar imageLupp ( 2018-01-09 17:13:25 +0200 )edit

@Lupp: the OP doesn't want to attach a document here (referring to some "security issues"). As if one couldn't create a sample with the issue, but without sensitive information. :)

Mike Kaganski gravatar imageMike Kaganski ( 2018-01-09 17:47:19 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-12-20 18:14:45 +0200

Lupp gravatar image

updated 2018-01-12 15:45:19 +0200

The piece of html code posted in the question should not be expected to cause a visible indentation because the indent value is negative (-1/4in) and compensates exactly the left-margin setting (1/4in).
The OQ told the html file was made from a "word document". No further information. I can only tell that the code is accepted by my browser, and if I insert a hard line break <br> and onother piece of text behind the given piece the indentation of the second line is as expected. But this doesn't contain anything about LibO now.

No progress possible without
-1- An example "word document" of the kind producing the issues
-2- A reasonably precise explanation of in what way the supposed issue shows.

Editing after some analysis of the finally attached example of the OQ's.
Imo the file is not to be expected to create a html code rendering to numbered paragraphs. To achieve this the following steps should help (they don't):

Select the group of concerned paragraphs  
Apply the List Style `Numbering 1` (e.g.) using the `Styles and Formatting` dialogue. 
Remove the numbering ny hand you had applied previously.

This doesn't solve the issue - and that's clearly a bug now. You may add a space in front of every first word in every first line to compensate for the error approximately. (Not good.)

By the way: There were lots of unneeded <span>s in the original.

I don't know remedy. Did you actually file a bug? (I didn't find it yet.) If so, please give a link here.
(I fond th link to tdf# meanwhile in a comment by @Mike Kaganski above.)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-12-19 12:47:40 +0200

Seen: 517 times

Last updated: Jan 12 '18