Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Margin is not Working on Exported MS Word Document Pages

I'm using FileSaver.js library and WordExport.js for exporting the word documents using JavaScript, jQuery, everything is working fine, but page margin is not working, i have tried it with multiple ways but couldn't get success, here is the code. following div will be exported

<div class="col-md-12" id="page-content">
    <style type="text/css">
        @page {
            mso-page-orientation: portrait;
            size: 21cm 29.7cm;
            margin: 1cm 1cm 1cm 1cm;
        }
        @page Section1 {
            mso-header-margin: .2in;
            mso-footer-margin: .5in;
            mso-header: h1;
            mso-footer: f1;
        }

        div.Section1 {
            page: Section1;
        }

    </style>
    <div class="firstpage Section1" style="margin:10.0pt 20.0pt 10.0pt 20.0pt; !important">
        <h2>Topic of template</h2>
        <h5>Prepared for</h5>
        <h5>Name of Company</h5>
        
        <br clear=all style='mso-special-character:line-break; page-break-before:always'>
    </div>
    <br clear=all style='page-break-before:always; mso-break-type:section-break'>
    <div class="otherpages"> 
        <p>other pages stuff</p> 
    </div>
</div>

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!