How to draw a horizontal line in a docx document

Questions and answers on how to use DOCXReadWrite
Post Reply
nalanfeng
Posts: 16
Joined: Fri Dec 25, 2020 12:49 pm

How to draw a horizontal line in a docx document

Post by nalanfeng »

Hello

Under the latest version (2.00.41) of DOCXReadWrite, I use AppendHorizontalLine() method to draw a horizontal line,but it failed. This horizontal line is generated, but it cannot be displayed. The code is as follows

Code: Select all

FDOCX := TDOCXReadWrite.Create(nil);
try
  Para := FDOCX.Editor.Paras.AppendPara;
  Para.AppendHorizontalLine(agohatCentered, 1);
  ......
finally
  FDOCX.Free;
end;
The result after code execution is as follows:
Image

I have mentioned this question before, and you have confirmed that this is a problem. Unfortunately, this problem is not fixed in the latest version of DOCXReadWrite.So next, how should I correctly draw a horizontal line as shown below in the document?
Image
nalanfeng
Posts: 16
Joined: Fri Dec 25, 2020 12:49 pm

Re: How to draw a horizontal line in a docx document

Post by nalanfeng »

In addition, when testing the latest version of AXWWrite2.00.41, it is found that when LoadFromFile() opens the input.docx source file, if this file contains a horizontal line, then after SaveToFile(), the output.docx target file will lose this horizontal line.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: How to draw a horizontal line in a docx document

Post by larsa »

Hello

Please send me a word file with this issue.
Lars Arvidsson, Axolot Data
nalanfeng
Posts: 16
Joined: Fri Dec 25, 2020 12:49 pm

Re: How to draw a horizontal line in a docx document

Post by nalanfeng »

A few days ago, the test document was sent to you. Have you confirmed the issue of the horizontal line? Can you inform in time? This is very important for our future projects.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: How to draw a horizontal line in a docx document

Post by larsa »

Hello

I can confirm the problem but there is no fix yet.
Lars Arvidsson, Axolot Data
nalanfeng
Posts: 16
Joined: Fri Dec 25, 2020 12:49 pm

Re: How to draw a horizontal line in a docx document

Post by nalanfeng »

Hello
After nearly a year of testing, we are convinced that AXWWriter can help us complete the document generation work currently underway for books management. However, because of the horizontal line problem, this made us hesitant to buy this component. We really hope you can fix this problem,We will purchase it as soon as we confirm that this problem is fixed.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: How to draw a horizontal line in a docx document

Post by larsa »

Hello

This is fixed now. The problem was that the line was in the wrong color (white). Please download the component again.
Lars Arvidsson, Axolot Data
nalanfeng
Posts: 16
Joined: Fri Dec 25, 2020 12:49 pm

Re: How to draw a horizontal line in a docx document

Post by nalanfeng »

Hello
In the past few days, we tested AXWWriter again for the function of drawing and saving horizontal line in the component. It is found that the AppendHorizontalLine() function has been improved, and black horizontal line can be drawn by default. However, we also discovered that new problems have emerged. When we save the file with the following simple code, two problems still exist.

Code: Select all

......
FDOCX.LoadFromFile('source.docx');
FDOCX.SaveToFile('destination.docx');
......
problems:
a).When saving a source file with a horizontal line, the line will be lost.This horizontal line is drawn in the word software with the function'Insert/Sharps/Line'.
b).When the source file contains a horizontal line generated using AppendHorizontalLine() and a TextBox, when saving, although the color of the horizontal line has been fixed to the default black, But, at the same time, the fill color of the TextBox and the text color has also become black.
Image
Image
After a year of testing, our team decided to use it to complete all our library management-related projects, but because there are still some small problems, and these problems are very important to our project Therefore, we sincerely request you to fix these problems as soon as possible. Personally, I am very sorry for constantly urging you to do extra work. Thank you again!
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: How to draw a horizontal line in a docx document

Post by larsa »

Hello

A new update is ready now. Please download it.
Lars Arvidsson, Axolot Data
nalanfeng
Posts: 16
Joined: Fri Dec 25, 2020 12:49 pm

Re: How to draw a horizontal line in a docx document

Post by nalanfeng »

Hello
The problem is fixed.I sent you an email about purchase, please check.
Post Reply