Header image does not appear with print();

Asked

Viewed 115 times

1

I have a problem and as simple as it seems I am not able to understand and therefore, solve it, my call the page was changed getting now this way, the same is so:

$(function() {

 $('#frmCadastro').validate({
    rules: {
        Nome: {
            required: true
        },
        Cpf: {
            required: true
        },
        Data: {
            required: true
        },
    },
    // Messages for form validation
    messages: {
        Nome: {
            required: ''
        },
        Cpf: {
            required: ''
        },
        Data: {
            required: ''
        }
    },

    submitHandler: function(form) {
        var data = $(form).serialize();
        //event.preventDefault();
        $.ajax({
            url: "pImpreComDispTemporaria.php",
            type: 'POST',
            datatype: 'text',
            data: data,
            success: function(data) {

                console.log(data);

                var janela = window.open("", "", "width=800,height=1000");
                janela.document.write(data);
                janela.focus();
                janela.print();

            }
        });
        return false;

    }
    });

    });

But the image that is at the top is never displayed, the page is like this:

<body>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td></td>
	</tr>
	<tr valign="center">
		<td height="82" colspan="2" align="left">					
		<img src="../_imagens/logo-employer.gif" width="244" alt=""/>
	</td>
	</tr>
	<tr>
		<td></td>
	</tr>			
</table>

The image is in the correct directory and the call is right, if cancel by closing the print window the header with the image is displayed correctly.

  • I withdrew the response for not having helped in this case

  • That’s the image that doesn’t appear? ../_imagens/logo-employer.gif or is it any other? Usually when the image is used in background she does not appear at the time of printing...

  • Hello @hugocsl, is this image even if it does not appear.

  • I did a test here calling the img by a URL and it worked normal, appeared right... src="http://placeskull.com/160/160"

  • but the picture isn’t showing or it’s getting a little bit like that in this picture ? https://superuser.com/questions/712082/images-not-loading-in-most-browsers

  • Hello @Marcosbrinnerpikatoons, the image doesn’t show up at all, it doesn’t take this little square

  • strange, try to set in style="display:inline ! Important" can’t place the image to load an absolute path? site type.com/image/local/item.gif ?

  • She’s on the absolute path @Marcosbrinnerpikatoons, too weird

Show 3 more comments
No answers

Browser other questions tagged

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