Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Tue Jan 05, 2021 3:21 am

Hello, I just started this topic. How can I find out left and right margin of doc file

galabuska.07
 
Posts: 3
Joined: Mon Jan 04, 2021 11:57 pm

Tue Jan 05, 2021 3:52 am

Hello,

Thanks for your inquiry.
Please refer to the following code to get the left and right margin of the Word file. If you have any other questions, just feel free to contact us.
Code: Select all
            Document doc = new Document();
            doc.LoadFromFile("test.docx");
            //Get the first section
            Section section = doc.Sections[0];
            //Get the left and right margin
            float leftMargin = section.PageSetup.Margins.Left;
            float rightMargin = section.PageSetup.Margins.Right;


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1456
Joined: Tue Jul 09, 2019 2:22 am

Mon Jan 11, 2021 1:56 am

Hello,

Greetings from E-iceblue!
Has your issue been resolved? Looking forward to your feedback!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1456
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc

cron