mnelson4 / printmyblog

WordPress Plugin that simplifies printing your entire blog
GNU General Public License v3.0
16 stars 6 forks source link

Error when trying to generate a PDF pro #308

Open OursaMajor opened 2 years ago

OursaMajor commented 2 years ago

Please describe what you were doing, what you expected to happen, and what the problem was.

Hello PrintMyBlog team !

I get the message error below when I am clicking for generating a PDF pro, after having set the parameters via the different settings. The content to be printed is my whole blog. I was expecting some PDF to be smoothly generated and to send it to my local printer.

The error message in French translate into English says : "An error occured when preparing the content. Please visit the help page of PrintMyBlog." I did not find anything in the FAQs and the help page redirected me to GitHub.

image

Thank you for your much appreciated support, Best

Arthur

{"php":"7.4.28","wp":"5.9.1","site_url":"https://caravana2021.wpcomstaging.com","home_url":"https://caravana2021.wpcomstaging.com","language":"fr_FR","public":"0","environment_type":"production","plugins_active":{"Akismet Anti-Spam":"4.2.2 par Automattic | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","AMP":"2.2.1 par AMP Project Contributors | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Crowdsignal Forms":"1.5.15 par Automattic | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Crowdsignal Polls & Ratings":"3.0.7 par Automattic, Inc. | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Gutenberg":"12.6.1 par Gutenberg Team | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Jetpack":"10.7-beta2 par Automattic | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Layout Grid":"1.8 par Automattic | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Page Optimize":"0.5.2 par Automattic | Mises u00e0 jour gu00e9ru00e9es par WordPress.com","Print My Blog":"3.11.1 par Michael Nelson | Mises u00e0 jour auto activu00e9es","WordPress.com Editing Toolkit":"3.27812 par Automattic | Mises u00e0 jour gu00e9ru00e9es par WordPress.com"},"active_theme":{"name":"Zoologist (zoologist)","version":"1.0.27","author":"Automattic","author_website":"https://automattic.com/","parent_theme":"Blockbase (blockbase)","theme_features":"core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, block-templates, widgets-block-editor, align-wide, experimental-link-color, title-tag, block-nav-menus, editor-style, menus, custom-logo, custom-line-height"},"debug":false,"post_max_size":"2047M","upload_max_size":"2047M","effective_max_size":2146435072,"ssl":true,"multisite":false,"projects":[{"title":"CARAvana test","generations":{"print_pdf":"https://caravana2021.wpcomstaging.com/wp-content/uploads/pmb/generated/tKVRAfOf77r8c1LcXqgd/print_pdf/caravana-test.html?uniqueness=1645724058"},"meta":{"_pmb_subtitle":"Sous titre","_pmb_error_print_pdf":"error generating. Status:, message: error, raw response: <!DOCTYPE html>n<html lang="fr-FR" class="no-js no-svg">n<head>nt<meta charset="UTF-8">nt<meta name="viewport" content="width=device-width, initial-scale=1">nt<link rel="profile" href="http://gmpg.org/xfn/11">n    <title>CARAvana test</title>nt<meta name='robots' content='noindex, nofollow' />n<link rel='dns-prefetch' href='//secure.gravatar.com' />n<link rel='dns-prefetch' href='//s.w.org' />n<link rel='dns-prefetch' href='//widgets.wp.com' />n<link rel='dns-prefetch' href='//jetpack.wordpress.com' />n<link rel='dns-prefetch' href='//s0.wp.com' />n<link rel='dns-prefetch' href='//public-api.wordpress.com' />n<link rel='dns-prefetch' href='//0.gravatar.com' />n<link rel='dns-prefetch' href='//1.gravatar.com' />n<link rel='dns-prefetch' href='//2.gravatar.com' />n<link rel='dns-prefetch' href='//i0.wp.com' />n<link rel='dns-prefetch' href='//c0.wp.com' />n<link rel="alternate" type="application/rss+xml" title=" » Flux" href="https://caravana2021.wpcomstaging.com/feed/" />n<link rel="alternate" type="application/rss+xml" title=" » Flux des commentaires" href="https://caravana2021.wpcomstaging.com/comments/feed/" />n<script>nwindow._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.1.0\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.1.0\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/caravana2021.wpcomstaging.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.9.1"}};n/*! This file is auto-generated */n!function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,98
mnelson4 commented 2 years ago

Hi @OursaMajor, sorry PMB didn't work properly for you. Thank you for reporting the issue properly, including the debugging information. The debugging information hints at a plugin conflict but doesn't give any clue as to which one it was. I'm going to try using a few of the most suspicious ones to see if I can get the same problem to happen for me.

I'm also suspicious that it could have something to do with using WordPress.com. I noticed your site' is located at "caravana2021.wpcomstaging.com". Is it a live site?

OursaMajor commented 2 years ago

Hi @mnelson4 ! Thank you for your swift answer.

Let me know if you figure out a solution.

I am not very familiar with blogging and do not understand your question : what do you mean "Is it a live site?" exactly ? If you mean " do you post regularly on this site ?", the answer is "not anymore" and this is the reason why I would like to have it printed. I hope this helps.

Please do not hesitate to reach out if you need additional information.

mnelson4 commented 2 years ago

Hi @OursaMajor, ignore my question about it being a "live site". It's getting technical too quickly.

I will try to see if I can make the same problem happen with the plugins and theme you're using (if I can find a free version of each). I hope to get back to you tomorrow but it might not be until Monday.

mnelson4 commented 2 years ago

Hi @OursaMajor, I've tried most of the plugins and the theme in use on your site and everything still works fine for me. So I'm not yet sure what the problem is on your site.

There are 3 main options now:

  1. You can try deactivating non-essential plugins on your site one-at-a-time to see if the problem goes away. Eg, try deactivating JetPack, Akismet, etc. (If the problem goes away when a specific plugin is deactivated, then we'll know where to focus our attention...)
  2. Create a new admin user on your website and set their email address to "please at printmy dot blog". By doing so you will be giving me admin access to your website so I can poke around to try to find the cause of the problem myself.
  3. You can use a 3rd party website to create a book from your site, like; https://mpl-publisher.com/ instead of Print My Blog

I'm sorry I haven't been able to find and fix the problem so far.

OursaMajor commented 2 years ago

Hi Mike

Thank you for your answer.

I do not you any extension in Wordpress. As a fact, PMB is the first extension I am using.

I created an admin account as requested. Please be VERY careful with our content already published.

I will have a look into the alternative you suggested but PMB is still my first option.

Would an upgrade of PMB solve the problem ?

Best regards,

Arthur

Le lun. 28 févr. 2022 à 19:25, Mike Nelson @.***> a écrit :

Hi @OursaMajor https://github.com/OursaMajor, I've tried most of the plugins and the theme in use on your site and everything still works fine for me. So I'm not yet sure what the problem is on your site.

There are 3 main options now:

  1. You can try deactivating non-essential plugins on your site one-at-a-time to see if the problem goes away. Eg, try deactivating JetPack, Akismet, etc. (If the problem goes away when a specific plugin is deactivated, then we'll know where to focus our attention...)
  2. Create a new admin user on your website and set their email address to "please at printmy dot blog". By doing so you will be giving me admin access to your website so I can poke around to try to find the cause of the problem myself.
  3. You can use a 3rd party website to create a book from your site, like; https://mpl-publisher.com/ instead of Print My Blog

I'm sorry I haven't been able to find and fix the problem so far.

— Reply to this email directly, view it on GitHub https://github.com/mnelson4/printmyblog/issues/308#issuecomment-1054539368, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMK5N6Y2F6O3ZBORDAGLJGLU5O4XZANCNFSM5PH4RAGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

mnelson4 commented 2 years ago

Hi @OursaMajor, thanks I am able to access your site.

I tried generating the print-page (I think exactly like you did). Strangely, I didn't get the same error as in your screenshot.

So I made it to the print-page, and then tried to download the PDF. It was downloading for a few minutes then had a different error.

I investigated the second error and it's coming from the website I'm using for converting the HTML into PDF named "DocRaptor". I've asked them for help identifying the issue, but I'm pretty sure it's because there are simply so many images in your document (over 800).

I tested making a much smaller project on your site which worked fine (I then deleted the project). So I'm pretty sure the problem now is just that there are just more images than PMB's Pro PDF service (using DocRaptor) can handle.

You can use the "Impremer avec Navigateur" option though, which works. See screenshot 2022-March-02 12-49-00-546

So, I think you have 3 options:

  1. Use the "Impreser avec Navigateur", which is free anyway. It just won't show page numbers and lacks a few features. See https://printmy.blog/free-vs-pro/
  2. Make 2-3 smaller projects instead of one big one
  3. Wait to hear if DocRaptor comes up with any other solutions

The only remaining issue is that the images aren't laid out great. The gallery's style information (CSS) isn't getting used properly. So I will need to investigate what can be done about that.

mnelson4 commented 2 years ago

Good news! I found a different fix...

The problem you had was that your site was using full-size images, and when there are 800+ of them, the PDF file was nearly a gigabyte in size (so big the system was crashing.) But I know WordPress automatically makes smaller versions of the images, so I have a bit of code that uses those smaller images (which have a filesize of about 10% the original). When I manually used that on your project, it worked ok.

You can see it's working now, but there's a layout issue with the gallery you're using (JetPack's Tiled Gallery) where it's making the galleries too big. I'm going to see what I can do about that next...

OursaMajor commented 2 years ago

Hello Mike !

Thank you for this very positive update ! This is a good step forward.

Do I understand right : if you figure out how to fix the last issue, we will be able to use PMB but only with a image quality lower than the original ?

Good luck with the last fix and thank you for your much appreciated help,

Warm regards,

Arthur

Le lun. 7 mars 2022 à 22:16, Mike Nelson @.***> a écrit :

Good news! I found a different fix...

The problem you had was that your site was using full-size images, and when there are 800+ of them, the PDF file was nearly a gigabyte in size (so big the system was crashing.) But I know WordPress automatically makes smaller versions of the images, so I have a bit of code that uses those smaller images (which have a filesize of about 10% the original). When I manually used that on your project, it worked ok.

You can see it's working now, but there's a layout issue with the gallery you're using (JetPack's Tiled Gallery) where it's making the galleries too big. I'm going to see what I can do about that next...

— Reply to this email directly, view it on GitHub https://github.com/mnelson4/printmyblog/issues/308#issuecomment-1061144262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMK5N63HDL76VCGYIO3THVDU6ZWZ3ANCNFSM5PH4RAGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

mnelson4 commented 2 years ago

Hi Arthur (@OursaMajor) ok I've worked all the way up to PMB 3.12.7 which resolves the gallery as far as possible. I also adjusted your project's settings to not resize images to be so small as that conflicted quite badly with the gallery's layout.

If you try it again, you'll see the gallery appear almost identically to on your website, but sometimes they're too big to fit on one page so the rest of them is just getting dropped from the page. Getting the system to automatically cut the galleries in half will be too difficult to manage. So I'd suggest you manually split the biggest galleries into more manageable sizes (like 8-10 images).

Also, I noticed the images on https://caravana2021.wpcomstaging.com/2022/01/04/mexican-pacific-coast-and-tropical-forest/ are missing (both on the website and in PMB's print page). I think that's more of an issue to talk to wordpress.com support about though, as PMB wouldn't have affected your site's regular pages.

After you deal with those two issues and maybe tidy up some content, your blog seems about ready to be printed! (You may have a keener eye for imperfections than me though, I'm just happy to have overcome the technical hurdles so far.)

Does that all make sense?