Word file generation using fileformat

In fileformat Docio,There is a problem in word file generation. In fileformat when there is a list and in new page if there is a image with text in first line then the inline image is in front of text . How can i solve this problem. Problem file attach. Thank you


Attachment: GAT_AWHITE11041011_(82)_5cbe37f1.rar

3 Replies

RH Ramanan  Hariharasubramanian Syncfusion Team November 9, 2017 10:46 AM UTC

Hi Irshad,

Thank you for contacting Syncfusion support.

We can see the reported issue in the given document. As per Microsoft Word rendering behavior (in latest Word version), inserting paragraph in new page (second page) of first item and insert the inline image inside the paragraph, image is preserved improperly based on the spacing value of the paragraph.

In this given document, paragraph have before spacing value is 8 PT so image is preserved improperly. We suggested you to reduce the before spacing of the paragraph or insert a new paragraph before this paragraph to overcome this issue.

As you are using DocIO for this file generation, kindly reset the before spacing value for that paragraph. Please refer the below code snippet and let us know if it helps you
 
//Set the before spacing value as 0 for that particular paragraph.
paragraph.ParagraphFormat.BeforeSpacing = 0;
 

If you are still facing the issue, then kindly share us the code snippet used for this document generation which will be helpful for us to provide you a prompt solution at the earliest.

Please let me know if you have any other questions.

Regards,
Ramanan H.
 



IA Irshad Ahmed November 10, 2017 04:16 AM UTC

Thanks It solved the problem. But I need space before the paragraph. How can I give space before this paragraph and my list item text is not on the same level (indentation and hanging indent).ListItem  first line and subsequent line is not on the same level indentation.How can I do this . My code is for list is 

 //Adds new list style to the document 

                    ListStyle listStyle =document.AddListStyle(ListType.Numbered, "UserDefinedList");       //"UserDefinedList"            

                    WListLevel levelOne = listStyle.Levels[0];


                    //Defines the follow character, prefix, suffix, start index for level 0

                    levelOne.FollowCharacter = FollowCharacterType.Nothing;

                    levelOne.NumberSufix = ".";                    

                    levelOne.PatternType = ListPatternType.Arabic;

                    levelOne.StartAt = 1;                  

                    levelOne.ParagraphFormat.FirstLineIndent = -18;

                    levelOne.TextPosition = 18;

                    levelOne.NumberAlignment = ListNumberAlignment.Left;    

                    WListLevel levelTwo = listStyle.Levels[1];

                    //Defines the follow character, suffix, pattern, start index for level 1

                    levelTwo.FollowCharacter = FollowCharacterType.Tab;

                    levelTwo.NumberSufix = ".";

                    levelTwo.PatternType = ListPatternType.UpLetter;

                    //levelTwo.ParagraphFormat.LeftIndent = 12;

                    levelTwo.ParagraphFormat.FirstLineIndent = -18;

                    levelTwo.TextPosition = 70;                 

                    levelTwo.StartAt = 1;



RH Ramanan  Hariharasubramanian Syncfusion Team November 10, 2017 11:12 AM UTC

Hi Irshad,

Thank you for your update.

Regarding before spacing for paragraph:

As per Microsoft Word rendering behavior
, before spacing value is not considered when it preserved as first item in a new page (excluding first page). So, assigning before spacing value will not reflect in Microsoft Word viewer.

Regarding query “
ListItem first line and subsequent line is not on the same level indentation:

On analyzing further with the given details, we suspect that your requirement is the first and subsequent lines should preserve in the same level. We found two following scenarios in your requirement.
 
Scenario 
Solution 
Lines preserve in same level and including list number
 
Kindly set FirstLineIndent as zero. Please refer below code snippet.

levelOne.ParagraphFormat.FirstLineIndent = 0;
 
Lines preserve in same level and excluding list number 
 
To meet this requirement, you need to set the custom hanging indent values. So, kindly use the below code to preserve the first and subsequent lines in the same level.

levelOne.ParagraphFormat.FirstLineIndent = -13.5f;
 

If we misunderstood your requirement, kindly provide us your exact requirement along with the expected output Word document. Thereby we will analyze further on the mentioned requirement and update you with appropriate solution.

Please let me know if you have any other questions.

Regards,
Ramanan H


Loader.
Up arrow icon