Margin control and view of the exported file with . wordExport() (Jquery)

Asked

Viewed 41 times

0

Good morning.

I would like help with the . wordExport() Jquery command. I am managing to export html without problems to word document, however, when I open the document, the margins are the default word size instead of the margins delimited in html/css, just as the file gets in web view mode instead of print Visualization, which is the default word for file display. Do you know how to get the document to export already in the print view and with the page margins delimited with the size I need? I need to export a contract constantly, and I’m having trouble with that issue. Any help is welcome.

Note: For specific reasons, I cannot post the full html code, but the script is like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="FileSaver.js"></script>
<script src="jquery.wordexport.js"></script>
<body>
<a class="word-export" href="javascript:void(0)"> Export as .doc </a>
    <script>
    jQuery(document).ready(function($) {
        $("a.word-export").click(function(event) {
            $(".page-content").wordExport();
        });
    });
    </script>
<div class="page-content">

And here comes the html of the word document. It is very extensive, and has confidential information and therefore I can not post here, but from there it is only text edited with css in html itself (I converted the word document to html using an online converter and I arranged in hand the rest)

Note: Yes, I am using jquery 1.11 because I am still testing the functionality of exporting the document, once this is done I will modify the code.

  • Your code is like? wordExport it’s not jQuery’s, it would happen to be this plugin?

  • Yes, it’s this plugin. The code is a word document edited in html hidden on the page I want to export, it is very simple but very extensive to post here, I believe.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.