Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sun Jan 10, 2021 7:36 pm

I don't think I'm imagining this. . .

When I add a horizontal line with an arrow, the resulting graphic seems to show a horizontal line without any slope at all:

ShapeObject shape2 = paragraph.AppendShape(200, 2, ShapeType.Arrow);
shape2.FillColor = Color.Black;
shape2.StrokeColor = Color.Black;
shape2.LineStyle = ShapeLineStyle.ThickThin;
shape2.StrokeWeight = 2;
shape2.HorizontalPosition = 100;
shape2.VerticalPosition = 0;

However, when I add just a plain line, it seems to slope slightly downward;

ShapeObject shape3 = paragraph.AppendShape(200, 2, ShapeType.Line);
shape3.FillColor = Color.Black;
shape3.StrokeColor = Color.Black;
shape3.LineStyle = ShapeLineStyle.ThickThin;
shape3.StrokeWeight = 2;
shape3.HorizontalPosition = 10;
shape3.VerticalPosition = 0;

Am I just imagining this??

Narniaman
 
Posts: 5
Joined: Sun Mar 01, 2020 2:24 am

Mon Jan 11, 2021 10:37 am

Hello,

Thanks for your inquiry.
Do you want to add this kind of line arrow? If so, sorry at present our Spire.Doc doesn’t support adding such arrows. We will consider adding it as a new feature to our upgrade list. If it can be achieved in the future, we will let you know.
Arrow.png

As for adding horizontal lines, please refer to the modified code below. If there are any other questions, just feel free to contact us.
Code: Select all
           Spire.Doc.Documents.Paragraph paragraph2 = section.AddParagraph();
           //set the height as 0
            ShapeObject shape3 = paragraph2.AppendShape(200, 0, ShapeType.Line);
            shape3.FillColor = Color.Black;
            shape3.StrokeColor = Color.Black;
            shape3.LineStyle = ShapeLineStyle.ThickThin;
            shape3.StrokeWeight = 2;
            shape3.HorizontalPosition = 10;
            shape3.VerticalPosition = 0;


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Jan 11, 2021 4:40 pm

Thanks. . . setting the "height" to 0 seems to do the trick.

I don't particularly want to use the arrow function, but I am a bit perplexed that you said it does not work. I just used it as an example of an object which wasn't sloping.

If you set the height on the arrow object to 10, the arrow shape becomes quite obvious and seems to work just fine.

Narniaman
 
Posts: 5
Joined: Sun Mar 01, 2020 2:24 am

Tue Jan 12, 2021 1:49 am

Hello,

Thanks for you quick feedback.

I'm glad to hear that setting the height to 0 solved your issue.
As for the arrow, the arrow I referred to in the screenshot is the line arrow, while the code you used adds a block arrow (as shown below). Yes, like you said, the arrow shape will be more obvious after increasing the height of the block arrow.
screenshot.png

If you have any other questions, just feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc