WordPress.org

Ready to get started?Download WordPress

Forums

Printing Remote Site (1 post)

  1. cicakchanson
    Member
    Posted 2 years ago #

    Hi Everyone,

    My issue is that I have a Google Doc iframe embed of my client's Resume on his site and I want a button on the client site that will print the Google doc and not the site the iframe is currently embed in. Said in another way, imagine you are an employer and you're looking at my client's site. You see his resume come up and you'd like to print it. When the employer presses 'Print' I would like for the Resume to be printed (ie the Google Doc) not the web site the employer currently finds himself/herself on.

    The Google Doc is published to the web and is shared properly. I know that Google Docs comes with a Viewer that does have a Print Button. However, this viewer really violates my design aesthetic and every time I try to use it (by going to HERE) and entering in my URL I get CSS displayed in my iframe instead of the document I'm trying to display. This is not a WordPress/iframe issue since entering in the resulting address from this Google tool results in the same CSS being displayed.

    After abandoning the 'Viewer' approach I tried Javascript. I ran across several sites with descriptions on how to get a 'Print' button to appear but as I dug deeper it seemed that everyone agrees that getting a remote site to print is not something Javascript can accomplish.

    I've come across other php scripts that might do the job but I'm not good enough at php to really understand how to implement what I'm seeing. For Example:

    $(".printButton").click(function(){
     $("#projectPrint").empty();
     $("#projectPrint").load('PRINT_workOrderLastEntered.php', function(){
    
     $('#projectPrint').printElement({
    
     pageTitle:lastProjectNum
    
     });
     })
    });
    
    $.ajax({
        url: 'http://news.bbc.co.uk',
        type: 'GET',
        success: function(res) {
            var headline = $(res.responseText).find('a.tsh').text();
            alert(headline);
        }
    });

    This code, however, is intended for something called 'jquery Print Element' which is not a pluggin.

    I really wish I could write my own pluggin for this since I really think it would be useful for people wishing to embed documents. Please help if you can and thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic