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 Oct 04, 2023 9:28 am

Hi Team ,

Please let us know how to add rectangle border to each page in the document. Please find the attached screenshot.

Thanks in advance

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

Fri Oct 06, 2023 3:38 am

Hi,

Thanks for your inquriy.
Please refer to the following code for reference.

Code: Select all
Document doc = new Document();
Section section = doc.addSection();
section.getPageSetup().getBorders().setBorderType(BorderStyle.Single);
doc.saveToFile("result.docx");


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

Best regards,
Triste
E-iceblue support team
User avatar

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

Return to Spire.Doc