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.

Wed Sep 20, 2023 4:01 am

Hi Team ,

I want to add horizontal line in the document .I have gone through the below mentioned code

Document doc = new Document();
Section section = doc.AddSection();
section.AddParagraph().AppendHorizonalLine();

I am using 11.1.1 version But not getting AppendHorizonalLine() functionality.I have added my requirements in attached file.

Thanks in advance

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Wed Sep 20, 2023 6:30 am

Hi,

Thanks for your feedback.
I have reviewed our Doc product's release notes and discovered that the "AppendHorizontalLine()" method was actually added in version 9.6. Furthermore, this method is still available in our latest version.
We suggest that you remove all the Spire Dlls and then reimport from Nuget. Or create a simple project to retest. If the issue still exists, please feel free to contact us. We are here to assist you.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Sep 25, 2023 6:49 am

Hi Team ,


Now I am using spire.office 8.4.5.still I am not getting section.AddParagraph().AppendHorizonalLine() functionality .Please help us to resolve this issue.

Thanks in advance

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Mon Sep 25, 2023 8:20 am

Hi,

Thanks for your feedback.
Based on your previous code samples, it appeared that you were using C# as the programming language. Consequently, I searched for relevant .NET code examples and found some.

However, I have now learned that you are actually using Java. Unfortunately, the method you mentioned has not yet been synchronized with Java. As a solution, I have created a new feature request with the ticket number SPIREDOC-9912. Our development team will work on synchronizing this method with Java in the future.

Once again, I apologize for any inconvenience caused by this misunderstanding. We appreciate your patience, and please feel free to contact us if you have any further questions or concerns.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Fri Sep 29, 2023 10:10 am

Any update on this ticket?

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Tue Oct 03, 2023 1:55 am

Hello,

Thank you for your follow-up.
Regarding the issue SPIREDOC-9912, I have checked our system records and it is currently not completely resolved. Due to our Mid Autumn Festival and National Day holidays from September 29th to October 6th, I will urge the development team to resolve the issue as soon as possible after returning to the office on October 7th. Thank you for your understanding.

Best regards,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Oct 11, 2023 6:04 am

Hi Team ,

Any update on this ticket?

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Wed Oct 11, 2023 6:26 am

Hi,

Thank you for your inquiry.
The new feature has currently entered the testing stage. Our testing team will be conducting testing on the feature, and if successful, we will soon release the new version. Thanks for your understanding, when the new version i available, I will inform you asap.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Oct 30, 2023 10:10 am

Hi,

Thanks for your patience.
Glad to inform you that we just released Spire.Office for Java 8.10.2, This method:
Code: Select all
section.appendHorizonalLine()
has been synchronized to Java, please download from the following link and have a test.
Website: https://www.e-iceblue.com/Download/office-for-java.html

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Tue Oct 31, 2023 5:47 am

Thank you team

Currently I am using spire office 8.4.5 version ,Do we need to buy new license to use latest version 8.10.2 ?

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Tue Oct 31, 2023 7:10 am

Hi,

Thanks for your reply.
Since your license has expired, the bug fixes and new features are no longer available. If you want to upgrade to the latest version, you are supposed to renew your license. If you have any doubts about the renew policy, please contact our sales team([email protected]).

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Nov 02, 2023 1:28 pm

i Team


String data ="<h1><span style="font-family:Times New Roman,Times,serif">process 1</span></h1>
<p></p>
<p><em><u><span style="font-size:26pt"><span style="font-family:Times New Roman,Times,serif"><span style="background-color:#1abc9c">Process2</span></span></span></u></em></p>";

cell.addParagraph().appendHTML(data);

I am adding data into appendHTML() method .I have to maintain specific style while passing data into method.Is it possible to change the style as per my requrements after passing the data into method?

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Fri Nov 03, 2023 2:23 am

Hi,

Thanks for your inquiry.
We are pleased to inform you that it is indeed possible to modify the styles of the HTML content after it has been added. To achieve this, you need to retrieve each newly added paragraph object and make the necessary style modifications.

Please refer to the following example code snippet:

Code: Select all
Document doc = new Document();
String data ="<h1><span style=\"font-family:Times New Roman,Times,serif\">process 1</span></h1>\n" +
        "<p></p>\n" +
        "<p><em><u><span style=\"font-size:26pt\"><span style=\"font-family:Times New Roman,Times,serif\"><span style=\"background-color:#1abc9c\">Process2</span></span></span></u></em></p>";

Section section = doc.addSection();

// Add a table and show its border
Table table = section.addTable(true);
table.resetCells(2,2);
TableCell cell = table.getRows().get(0).getCells().get(0);
cell.addParagraph().appendHTML(data);

// Get all the paragraphs in the cell
ParagraphCollection paragraphs = cell.getParagraphs();

// Loop through each paragraph
for (int i = 0; i < paragraphs.getCount(); i++) {
    Paragraph paragraph = paragraphs.get(i);

    // Get the child objects of the paragraph
    DocumentObjectCollection childObjects = paragraph.getChildObjects();

    for (int j = 0; j < childObjects.getCount(); j++) {

        // Judge the type of child object
        if (childObjects.get(j).getDocumentObjectType() == DocumentObjectType.Text_Range){
            TextRange textRange = (TextRange) childObjects.get(j);

            // Set its font and font size ...
            textRange.getCharacterFormat().setFontSize(20);
            textRange.getCharacterFormat().setFontName("Calibri");
        }
    }
}
doc.saveToFile("result.docx");


This code allows you to access each paragraph within the cell and modify its style properties, such as font size, text color, etc., according to your specific needs.

If you have any other questions, just feel free to contact us. We are here to assist you.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc

cron