Support » Plugin: Print My Blog - Print, PDF, & eBook Converter WordPress Plugin » Viewing of page doesn’t match .pdf view

  • Resolved wpodeskstar

    (@wpodeskstar)


    What a cooooool plugin!

    I am struggling with what I see generated on the screen not being saved as the final .pdf.

    It seems like the custom css I have created isn’t being recognized.

    Sorry to be dense. I have screen shots but I don’t know where to upload them for you to see.

    Also, how to I get the comments to show when my visitors use the “pdf” button.

    Thank you!

    • This topic was modified 2 months, 2 weeks ago by wpodeskstar.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Michael Nelson

    (@mnelson4)

    Thanks, @wpodeskstar!

    Hmmm ya, I’ll need to see about your CSS. Do you have a custom CSS file, or did you add the CSS via the theme’s “Custom CSS” option?

    For sharing screenshots, you could upload them somewhere else (eg Google Drive) and then just share a link to them, or report the issue on [GitHub](https://github.com/mnelson4/printmyblog/issues).

    For now, you’ll need a code snippet to make visitors’ comments appear in the PDF. Are you comfortable with copy-and-pasting PHP code (either into your theme’s functions.php, or into the [code snippets plugin](https://wordpress.org/plugins/code-snippets/)?

    Hi Michael – Thanks for the lesson 🙂

    These were generated from clicking on “visitor” button
    Generated view:
    https://drive.google.com/open?id=1aFfQRazImslkoqzv7I4KXGOn0iXOH1lb

    And here is .pdf view:
    https://drive.google.com/open?id=16yxG9cjqZPzsUkuJA-imQS_T0wlDmLBS

    Custom CSS is added via theme’s “custom css” option.

    Yes, I’m comfortable cutting and pasting code. I have installed the code-snippet plugin and am awaiting your further command….

    Oh, and one more wish is that I could customize my page: “span.pmb-post-meta {display:none;}”

    Thanks for the prompt reply! (so rare)

    • This reply was modified 2 months, 2 weeks ago by wpodeskstar.
    Plugin Author Michael Nelson

    (@mnelson4)

    Regarding the CSS, the issue isn’t actually that your CSS isn’t working, it’s that you’ve got the browser set to *not* print backgrounds. I actually have a FAQ for this. You probably also want to use the use the “Print” button instead of the “PDF” one. “Print” should really be called “Print OR Print-Ready PDF”, and “PDF” should really be called “Digital PDF”.

    And it sounds like you want to add comments, but remove the published date and categories. This code snippet should do both:

    
    function no_link_in_parens($query_args, $post){
    //    $query_args['links'] = 'remove';
        $query_args['show_comments'] = true;
        $query_args['show_date'] = false;
        $query_args['show_categories'] = false;
    
        return $query_args;
    }
    add_filter('\PrintMyBlog\controllers\PmbFrontend->addPrintButton $base_args', 'no_link_in_parens', 10, 2);
    

    I am attempting to create a “digital pdf” (not printable pdf).

    I turned on background images and it fixed the problem with the text bubbles not showing up properly but now the whole background color is darkblue instead of white which is set in my https://affirmativeactionalliance.com/wp-content/plugins/heatmap-adaptive-pro-plugin/colours/blue-crunch.css (see second screenshot below).

    Here is a screenshot showing blue background:
    https://drive.google.com/open?id=1sfUId2Uo_tj_tRoCSAy7jLy1vLXFFvIG

    Here is screenshot of the css code setting the body color to white:
    https://drive.google.com/open?id=16J7yhKBjLqoJ2EMzpKK7NFpfdQoRJhRL

    The code snippet worked perfectly!

    Thank you for your time.

    Plugin Author Michael Nelson

    (@mnelson4)

    Glad to hear the code snippet worked as expected. 😄

    Regarding the background color being blue: that’s why I was suggesting you use the “printable PDF” option. Your site’s main background color is dark blue, it’s just a special div with ID heatmaphead-main that is white, and that div doesn’t appear on the print page.

    If you still want to use the “digital PDf” option (which, currently, is mostly identical to the “print” option, except for the background color), add this CSS:

    
    body.pmb-format-print{
        background-color:white;
    }
    
    Plugin Author Michael Nelson

    (@mnelson4)

    And actually @wpodeskstar, the next version lets you set all the same print options for the print buttons as you can set yourself in the admin. If you have a test site you could try it on, that would be helpful:

    1. Download the new version from here: https://github.com/mnelson4/printmyblog/archive/FET/save-frontend-print-settings.zip
    2. Go to your WordPress dashboard, click plugins, then “add new”, then “upload” and select the zip file you just downloaded
    3. Deactivate the previous version Print My Blog
    4. Activate the new version of Print My Blog

    Then when you go to Print My Blog -> Settings, click “Show Options” (see https://drive.google.com/file/d/1BZOrnO1u3uKkHQpRP3sk18Id0eThQcWD/view) and you can then customize how printouts of that format will appear. Note: if you use this version, the code snippet I gave you won’t be necessary (and actually it will overwrite what you save).

    If you don’t have a test site to try it on, no worries, I’ll try it some more myself.

    Hey Michael – It’s working – I used the print button instead of PDF button!

    Go ahead a say it “I told you so”.

    Thank you so much for your patience and help.

    I would love to see your new plugin options and would be more than happy to test for you.

    Report: I downloaded the new plugin and tested the “print format” – customized with different options – All Perfect! Very cool.

    I have a github account but don’t know how or where to report testing results. If you want to give me a bit of guidance I would be happy to help test anytime you need.

    Thanks again,
    Peggy Star

    Plugin Author Michael Nelson

    (@mnelson4)

    Oh good to hear the regular print option worked for you. Yeah I’m a bit torn on how whether to rename the “print” button to “print & print-ready PDF”, or leave it as-is and just add a new button called “print-ready PDF”. I bet lots of people have the same problem: they try the PDF button, but it uses their site’s background color and so often looks bad. Thoughts?

    And thanks for trying the new version’s settings. I see you reached out on GitHub too, so let’s continue the chat about the new version on GitHub then. Just use this thread to wrap up my question about whether to rename that button…

    Actually I’m still confused about what the difference is. I only know that one worked and one didn’t. With that knowledge, I vote to make it all one button with a title like: “PDF or Print” (with appropriate icons)

    One more tweet needed if possible. Is there a way to not display comment dates?

    I tried:
    comment-metadata.pmb-format-print{
    display: none;
    }

    Plugin Author Michael Nelson

    (@mnelson4)

    > Actually I’m still confused about what the difference is.
    So far the only big difference is that print forces the background color to be white; “Digital PDF” uses the theme’s default background color (because a coloured background isn’t usually a problem if you’re just going to read it online… in your case your theme was a little unusual and so it didn’t work as well as usual.) But a Digital PDF will have hyperlinks, links to videos etc; whereas a Print PDF would just print out the links etc. There might be more differences in the future too… Let me procrastinate a decision on this a bit longer…😅

    Anyways, for the CSS, I think this will work:

    
    .pmb-format-print comment-metadata{ 
    display:none;
    }
    

    Thanks for the explanation. I’ve been using using it for another website (with white background) and have found no difference between the “print” and the “pdf”. Links work in both and videos do not work in either.

    .pmb-format-print comment-metadata{
    display:none;
    }
    Did not work to delete the comment date.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.