print an area and delete link and page number

0

I have this function for the print button:

<script src="js/jquery.PrintArea.js"></script>

<script>
$(document).ready(function(){
    $("#printButton").click(function(){
        var mode = 'iframe'; //popup
        var close = mode == "popup";
        var options = { mode : mode, popClose : close};
        $("div.printableArea").printArea( options );
    });
});
</script>

<a href="javascript:void(0);" id="printButton">Imprimir</a>  
            <div class="printableArea">
            aqui lo que voy a imprimir

            </div>

but I printed the link of the page as I do to remove the link at the top of the page and at the bottom of the page delete the number of pages

    
asked by Ivan Diaz Perez 05.07.2018 в 13:12
source

1 answer

1

In general

The header and footer at the time of printing can not be configured from the web page, it is part of the browser configuration. It is the user who must choose not to add this data:

With header

No header

But in some browsers the following works:

<style type="text/css" media="print">
    @page 
    {
        size:  auto;   /* auto is the initial value */
        margin: 0mm;  /* this affects the margin in the printer settings */
    }

    html
    {
        background-color: #FFFFFF; 
        margin: 0px;  /* this affects the margin on the html before sending to printer */
    }

    body
    {
        border: solid 1px blue ;
        margin: 10mm 15mm 10mm 15mm; /* margin you want for the content */
    }
    </style>

these CSS apply only to the printer and hide the margins

    
answered by 05.07.2018 / 13:24
source