Make PDF Newspaper

Overview

'Make PDF Newspaper' replaces the Make Tabbloid Plugin to automatically create printer friendly 'tabloid' editions of your WordPress blog in an attractive 2 column magazine/newspaper format.

Development of the original plugin has stopped after HP removed API access to their service Tabbloid. The new plugin uses code developed for the Five Filters PDF Newspaper project, which in itself pulls together code from a number of other open source projects including TCPDF,HTML Purifier, SimplePie and SmartyPants

The plugin includes a widget to let you control how you advertise your 'tabloid edition'. You can also choose to display a thumbnail of your custom newsletter (powered by Bluga.net Webthumb) to let your readers see what they are missing.

Key features

  • NEW Option to generate PDF from externally hosted versions of the Five Filters code (if you are hosting a version of the Five Filters code and would be happy for other people to generate PDFs using it please leave its url in the comments ;-)
  • NEW Option to generate PDF editions of selected categories or archives
  • PDF generation entirely self-hosted removing reliance on 3rd party services and making it suitable for Intranet installations of WordPress
  • Option to include QR codes for each post
  • Customisable banner text and logo
  • Option to automatically footnote all the links which appear in a post (using tinyurl or bitly to shorten long links)
  • Integrated widget to display thumbnail of your publication
  • User controlled production of PDF

Click here to download

Thanks to

This plugin is made possible by the hard work of Keyvan Minoukadeh creator of Five Filters PDF Newspaper and Jonathan Lyon who nudged me on.

Useful links

Screenshot

Click to enlarge

Any comments or suggestions very welcome.

164 thoughts on “Make PDF Newspaper

  1. also i got this error:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /is/htdocs/***/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 1407

    Reply
    1. Post author

      Hi Frank - Well spotted. Because the fivefilters code is designed to read a rss feed and produce a pdf I thought the best way to make the plugin was to create a custom rss feed which would then be used by the version of fivefilters packaged with the plugin.

      Choosing options like the qr code or link footnotes modifies the rss feed further. The custom feed doesn't replace your default feed so users can still subscribe to your posts as normal. To see the custom feed just add ?feed=make-pdf-newspaper to your blog url i.e. http://www.rsc-ne-scotland.org.uk/mashe/?feed=make-pdf-newspaper. (I also use this feed with other services. For example I uses this feed with feedbooks (after passing it through Yahoo Pipes as described in one of my posts)

      The curl_setopt() warning is related to server settings - this part of the code is ironically there to set to get around allow_url_fopen but it looks like both methods are effected by the same global setting. I did notice that the plugin is generating a pdf for you. Did you have to change any of the code or settings?

      Martin

      Reply
  2. Hi Martin,

    i dont change anything on the code or settings. All i change was the title....

    url_fopen is set to ON.

    greetz
    Frank

    Reply
  3. Hi Martin, pretty cool plugin, but i was wondering can you make optional daily automatic remake?Another thing - I have some additional images in rss footer(ads and related images by tags) which i do not want to be published- can that be done?

    Reply
  4. I just remembered another thing - there is plugin - bm shots(just google it)-which use built wp feature to generate snapshots and i was wonder can this feature be used to automatically refresh thumbnail in widget when remake is done instead of this webthumb?

    Reply
    1. Post author

      Thanks Vlad I'll have a look at Binary Moon. Re daily fresh I'll have a look to see if there is a way of dong this without interrupting the user experience.

      If the content you want to remove from the footer is constant you could add a line to rss-make-pdf-newspaper.php just before echo $content; on line 113 adding:

      $content = str_replace('what you want to find', 'what you want to replace it with', $content);

      If it is dynamic content it is a bit harder

      Hope this help,
      Martin

      Reply
  5. Thanks Martin, I will try that, I'm not much man of coding only ideas:), question - if I enable digest where it can be seen?actually it would be good thing for my magazine to contain only particular category/s because i have mixed content(videos, pools etc. that i suppose cannot go into pdf)

    Reply
  6. Hi Martin
    I show pictures in my blog defined in custom fields. Do you see a way to integrate these pictures in the PDF Newspaper?
    Thanks for your feedback.

    Reply
  7. Hi Martin, some strange things happened, only first creation was successful, second included only two posts(one from random post section that does not appear in normal feed) i tried to reinstall but now i'm getting this error
    Fatal error: Remote source didn't return any data. in .../make-pdf-newspaper/NewspaperPDF.php on line 1460
    I also could not got widget thumb in first attempt

    Reply
  8. Hi MArtin,

    the problem with the curl_setopt() warning still occurs.

    What can i do?

    Also i send an emial to my hoster today. Still waiting what they say.....

    cheers
    Frank

    Reply
  9. I am getting this error code:
    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /usr/www/users/absoluau/wordpress/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 1407
    Can u advise?

    Reply
    1. Post author

      I believe curl_setopt() errors are created because your server host security settings. The part of the script deals with cache images if you can't change your server settings you could try turning this feature off (not ideal I know but the best I can do for now)

      Reply
  10. Hi Martin,

    my hoster tells me, that this is a problem of open_basedir.

    a: i can switch off it (no good idea....)
    b: better solution is to correct the script an the path specified. Should be inside the scriptpath

    bye
    Frank

    Reply
  11. I tried to "test PDF" plugin but it appears the following error:

    Warning: fopen(/mnt/stor1-wc1-dfw1/380423/423772/www.enrelieve.info/web/content/wp-content/pdf/newspaper.pdf) [function.fopen]: failed to open stream: No such file or directory in /mnt/stor1-wc1-dfw1/380423/423772/www.enrelieve.info/web/content/wp-content/plugins/make-pdf-newspaper/libraries/tcpdf/tcpdf.php on line 4966
    TCPDF ERROR: Unable to create output file: /mnt/stor1-wc1-dfw1/380423/423772/www.enrelieve.info/web/content/wp-content/pdf/newspaper.pdf

    Reply
  12. Hi,

    I am trying to rebuild the newsletter but it won;t pull any new articles in. THis is the first time I have used the plugin, Definitely what I am looking for if I can get it to work.

    Also, how can I change the footer to put a copyright and such in there?

    Thanks!!!

    CJ

    Reply
  13. Scot

    Martin

    Fantastic plugin. I can see many useful applications for this one. Wondering if there's a way to pull comments under posts, or is this a function of the RSS feed itself?

    Thanks

    Reply
  14. Post author

    New version 2.0.1 - big change is the option to use a externally hosted version of the Five Filters code to generate PDF. This seems to be the only way to get around the curl_setopt() errors (unless you can configure your host server differently). Also option to generate separate PDF for categories and archives

    Looked at @vlad's suggestion of Binary Moon but doesn't work for pdfs

    @Serge Re including pictures from custom fields don't think this is doable in foreseeable future. Probably a big job and I don't have time

    @CJ isn't a easy way to add a footer yet. Maybe suggest this on the FiveFilters site https://answers.launchpad.net/fivefilters

    @Scot It would be possible to customise the RSS feed further to include post comments, but it would require more coding. If more people want this feature I'll look at adding it.

    Enjoy!
    Martin

    Reply
    1. Post author

      @Scot I think that refers to if the rss feed contains extract and not full text. One way to do it would is to add:

      $comment_array = get_approved_comments($post->ID);
      if ($comment_array) {
      $content .= "<p><strong>Comments</strong></p>";
      foreach($comment_array as $comment){
      $comment_type = get_comment_type();
      if ($comment_type == 'comment') {
      $content .= "<strong>".$comment->comment_author." said:</strong><br />".apply_filters('the_content',$comment->comment_content);
      }
      }
      }

      to the rss-make-pdf-newspaper.php file after line 171 which starts $content = str_replace(']]>', ']]>', $content);

      Reply
    1. Post author

      @256studio looks like the custom rss feed wasn't registered for some reason. I noticed you use feedburner on your blog. Is there a plugin you use to enable that? You could also try deactivating and reactivating the plugin but it's a long shot

      Reply
  15. Thanks on the footer, but what about it not generating the current feed? It will not generate the current feed of articles. Only older articles?

    Thanks! CJ

    Reply
  16. M. Lucarelli

    Congratulations on your plugin.
    Unfortunately I got this error:
    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 6291456 bytes) in D:\websites\resadmin\miguel\blog.epraleao.com.br\special\WordPress\wp-content\plugins\make-pdf-newspaper\libraries\tcpdf\unicode_data.php on line 16485
    Could you, please, help me?
    Tks!

    Reply
    1. Post author

      @M. Lucarelli appears your server has run out of allocated memory. Where I've seen this error reported on other sites they recommend raising the memory_limit via the php.ini file. Our host allocates 128M

      Reply
  17. Scot

    For those interested, Martin's solution for including comments in your feed as posted above works great!

    Thanks

    Reply
    1. Post author

      You can just create a hyperlink anywhere on your blog. The url will be something like http://{theLocationOfYourBlog/wp-content/pdf/{theFilenameSetInOptions}.pdf. If you enabled the thumbnail then its location would be http://{theLocationOfYourBlog/wp-content/pdf/{theFilenameSetInOptions}.jpg

      Reply
  18. Oh, sorry - i mean this: do_makePDFNewspaper('linkName','fileName', showThumbnail, 'bannerText'); - in the readme file isn't how to use it. :(

    Reply
  19. Michael

    [fopen error] Solution
    Go to > wp-content > create pdf folder > write folder permission to 777
    This works, but now I don't see any images.
    Please Advise

    Reply
  20. Michael

    This is a great plug-in, thanks for all your work with it. A couple of options which would make it even more useful: 1. not showing the time of blog posts;
    2. being able to remove the black bar at the top of the page - we use a full width banner image and it would look great without the bar below it.

    Thanks!

    Reply
    1. Post author

      @michael - thanks for the feedback. If you are feeling brave the not showing time of posts can be done by opening the makepdf.php file and changing line 260 to:

      $pdf->addItem('get_permalink().'">'.$title.'', $story, 0);

      The black bar I think is removed by adding '//' to line 241 of NewspaperPDF.php so it becomes:

      // $this->Cell(0, 0, '', 'B', 0, 'C');

      Reply
  21. I've just put the latest version of the PDF Newspaper project live on http://fivefilters.org/pdf-newspaper/

    The code is not up yet, but will be soon. I want to make sure it all works okay first. If you try it and notice any problems, please let me know.

    The changes mainly involve updates to the libraries but also include minor layout/font changes.

    Martin: I will email you once the code is up.

    Changes:
    * New title font
    * Smaller margins
    * Thick black line replaced with thin dotted line
    * Slightly smarter image handling
    * Font subsetting results in smaller PDF file sizes (thanks to TCPDF changes)

    Library changes:
    * TCPDF updated to latest version
    * HTML Purifier updated to latest version
    * SimplePie updated to latest version
    * SmartyPants replaced with PHP Typography

    Reply
    1. Post author

      Thanks @Keyvan for the update. Users who configure Make PDF Newspaper to use FiveFilters as an external service will benefit from Keyvan's updates straight away.

      Reply
  22. Michael

    @martin - thanks for the quick answers, but I tried them both and neither worked. The black bar isn't a major issue, but it would be great to be able to set the date format as an option. If this could be included in a future release it would really help.

    Thanks.

    Reply
    1. Post author

      @Michael Keyvan who wrote the FiveFilters PDF Newspaper has updated his code. When an update is available I'll incorporate this plus the date format.
      Martin

      Reply
  23. Hi Martin

    Thanks for the brilliant application. It really does wonderful thing.

    I was having a few things in my mind, thought to put those here:

    Sometimes next topic is coming at the previous one in such a way, that we are having only the title in one page, and the article in the next.

    Second, was wondering if there is a way to have more control, like a real newspaper, where we could do the page setup for each page individually, for a better advertisement placement solution.

    Besides, we can translate the whole site to pdf with this, probably we could also add an option to have pdf created for individual posts.

    Else, it's a wonderful thing you have made.Bravo!

    Reply
  24. davide

    Sir,
    and this is the error generated by using "build pdf by categories" :
    Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\Inetpub\vhosts\***********.it\httpdocs\wp-content\plugins\make-pdf-newspaper\libraries\htmlpurifier\library\HTMLPurifier\Bootstrap.php on line 37

    Reply
  25. davide

    Hi Sir,
    i've installed plug-in, but when i use on admin panel the button "test pdf" this is the error :
    Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\Inetpub\vhosts\**************.it\httpdocs\wp-content\plugins\make-pdf-newspaper\libraries\htmlpurifier\library\HTMLPurifier\Bootstrap.php on line 37
    can you help me,pls?
    thanks
    davide

    Reply
  26. Hi
    the plugin with Wp 2.8.6 doesn't work
    This is the error:

    Warning: fopen(/home/deleonar/public_html/wp-content/pdf/newsletter--pagine-politica.pdf) [function.fopen]: failed to open stream: No such file or directory in /home/deleonar/public_html/wp-content/plugins/make-pdf-newspaper/libraries/tcpdf/tcpdf.php on line 4966
    TCPDF ERROR: Unable to create output file: /home/deleonar/public_html/wp-content/pdf/newsletter--pagine-politica.pdf
    With fivevilters I don't understand what url I put into plugin (by fivefilters.org I have a good pdf without personalization and with a long url)

    Reply
  27. Post author

    New version 2.2.1 - integrates version 2.2 of the fivefilters pdf engine and uses local time format.

    When testing I've had problems with 500 server errors with large pdfs (it appears the latest version of or the pdf creator tcpdf 5.5 is more resource intensive).

    If others have a similar problem let me know

    Martin

    Reply
  28. Josh

    Martin,

    I keep getting this error: Fatal error: Remote source didn't return any data. in /home/content/s/c/a/scarenews/html/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 51. Any ideas?

    Thanks,
    Josh

    Reply
  29. Josh

    Martin,

    I should also mention that "Build PDF for categories" works great with no errors. Any ideas?

    Thanks again,
    Josh

    Reply
  30. Josh

    Martin,

    AHA! It is a problem with using the thumbnail image option. I deleted my info from there, and VOILA! It works great now.

    Awesome job!

    Josh

    Reply
  31. Hi,
    i already got this error. Cachefolder exists and has 777.....
    Fatal error: Cache folder inexistent or unwritable. in /is/htdocs/***/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 2019

    Reply
  32. Doug

    Martin, Thanks for all your work on this excellent project. Getting same error as Franky when I try to create the pdf using categories. The following is returned:

    Fatal error: Cache folder inexistent or unwritable. in /var/www/domains/.../docs/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 2019

    Using WP ver 2.9.2. Have created cache and set to 777.

    Reply
    1. Post author

      @Franky @Doug - the only thing I can think of is you might need to create a subfolder in cache called images and also make this 777
      Let me know if it works and I can amend code/documentation
      Thanks,
      Martin

      Reply
  33. Doug

    Martin, creating the "image" directory allows for images to be stored in the new cache/images. That works. However, now I am getting the following error when I try to use "categories".

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/domains/.../docs/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 1971

    The error repeats twice.

    Ideas?

    Thanks,

    Doug

    Reply
    1. Post author

      @doug this is related to your server config (previous comments cover this). If you can't modify your server setting you might have to resort to use the 3rd party generation option

      Thanks for letting me know how you got on. Will work a better solution for next version

      Martin

      Reply
  34. Post author

    New version 2.2.2 available for download. Fixes floating image problem (and filters out some of the smaller images). New option to custom QR code text and secure urls to run cron jobs to automatically remake pdfs

    Reply
  35. Hi,

    i tryed V2.2.2 with a new install.

    If i click on Remake or Test PDF, it jumps to the site with this error:

    "
    No Page Found

    Sorry, but you are looking for an archive that isn't here."

    Whats wrong now?

    bye, Frank

    Reply
    1. Post author

      Oops Lets try again v2.2.3

      As a result from feedback from Franky it was clear that the Automatic PDF Key option was confusing and it wasn't clear to users that they need to generate a secret key. Hopefully this version clarifies this. Feedback as always is gratefully received

      Reply
  36. Hello

    Old version created first PDF but then would not remake and also would not include amended title or other settings.

    Downloaded latest version and now the title works fine but the PDF is otherwise blank? There are no posts shown.

    Any thoughts?

    Reply
  37. Hi, When I try to make the PDF I get the following errors. Any help would be appreciated.

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: Cannot modify header information - headers already sent by (output started at /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php:4037) in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 383

    Reply
  38. I love this plugin, but can't get the thumbnail to show. I've moved the widget to the sidebar and I can set it up with a link, but the thumbnail doesn't show. I have an account and api with WebThumb and created the thumbnail. I must be missing a step. Any help will be greatly appreciated.

    Reply
    1. Post author

      It's fair to say this plugin has hit a rough patch. Things to do: fix mkdir error, thumbnail issue, and user control to filter out unwanted images like retweet buttons

      Ho-hum

      Martin

      Reply
  39. Thanks a lot for your quick reply.

    if I use to build pdf from categories, i've got this error message:

    Warning: fopen(I:\Work\Sy2Media\Clients\MediaFranceAsia5_development/wp-content/pdf/newspaper-?cat=115.pdf) [function.fopen]: failed to open stream: No error in I:\Work\Sy2Media\Clients\MediaFranceAsia5_development\wp-content\plugins\make-pdf-newspaper\libraries\tcpdf\tcpdf.php on line 7239
    TCPDF ERROR: Unable to create output file: I:\Work\Sy2Media\Clients\MediaFranceAsia5_development/wp-content/pdf/newspaper-?cat=115.pdf

    the url is: http://www.mediafranceasia.com/wp-content/plugins/make-pdf-newspaper/makepdf.php?cat=115&mpn_key=removed by editor&action=Go

    if you can understand this kind of error, that would be great :).

    Sylvain

    Reply
  40. Lampe

    Hello!

    Is there already a solution for this problem

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: mkdir() [function.mkdir]: File exists in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php on line 4037

    Warning: Cannot modify header information – headers already sent by (output started at /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/NewspaperPDF.php:4037) in /home/tapadmin/public_html/demo11/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 383

    Reply
  41. Post author

    I would check the write permissions on wp-content/pdf/ and wp-content/make-pdf-newspaper/cache/ (also check if the cache folder has a 'images' subfolder with write permission

    Reply
  42. Lampe

    Hello Martin!

    All folders und subfolders have write permissions (CHMOD 755).

    Do you have another idea

    Greetings. Lampp

    Reply
  43. I love this plugin...no, I LOVE this plugin. It creates such a professional quality PDF.

    The setup was so easy even a geek wannabe like me could do it.

    I do have a question. I only get 5 pages with each pdf, whether the full blog or a category. Is there a way to get everything?

    Thanks much!

    Reply
    1. Post author

      Hi Bonnie,
      I'm glad you like. The number of items used is controlled by the general WP 'Setting -> Reading'. By increasing 'Syndication feeds show the most recent' number the plugin will pull more posts into the PDF. Word of warning though, set it too high and the pdf engine will run out of memory.

      There seem to be more WP plugins for making books out of blog posts like http://anthologize.org/

      Might be worth checking out
      Martin

      Reply
  44. Max

    Excellent progress with this plugin thus far - kudos!

    A couple questions on future releases:

    1. Are there any plans to incorporate a function to justify/align the pdf text (specifically on the right side of the columns)?

    2. Any plans to include an option to save multiple pdfs (different category versions, etc.)?

    3. Will there be more ordering options than "ascending/descending order" by date only?

    If none of these features are planning to be implemented, what manual coding options would you recommend for me to play around with?

    Reply
    1. Post author

      Hi Max,
      All very useful suggestions. I don't have any plans to develop this plugin further, but some quick answers work arounds.

      Alignment could be controlled in the makepdf.php file after line 194 (the plugin uses the TCPDF engine so the exact setting could be found on that site).

      Multiple pdfs - you could do multiple versions by renaming the file on your server and manually linking

      Date order - the plugin generates it's own rss feed using the rss-make-pdf-newspaper.php file. There might be something you can do in here to flip the date order.

      Hope this helps
      Martin

      Reply
  45. Hi Martin,

    @Franky @Doug – the only thing I can think of is you might need to create a subfolder in cache called images and also make this 777
    Let me know if it works and I can amend code/documentation

    No, that dont works. Same problem since month......

    Sers, Frank

    Reply
  46. Paul

    I have a similar problem to Sylvain; the pdf gets generated with title & sub but the content is blank.

    The RSS feed is working perfectly. Running a categories pdf also gives me a blank pdf with title & sub only. I've cleared the pdf's from the /wp-content/pdf folder just in case it's a caching issue but I get the same result.

    What a great plugin - am desperate to get this working!

    Reply
  47. Paul

    an update - I can get the pdf generated by using the fivefilters facility.

    If there's not something basic I'm doing wrong, I suppose I could try installing the whole five filters thing on my server but it seems a long way around :)

    Reply
  48. I got the same Problem like Paul. Only blank pdf with title & sub without content. When I use the fivefilters engine it works but this will onnly generate 5 Pages.
    Do you have any idea of what i’m doing wrong?
    Thanks in advance.

    Reply
    1. Post author

      @Mike A big thank you for posting these fixes I've incorporated these and some others I noticed (mainly around 2019 no data returned errors). New version 2.2.4 available for download.
      Martin

      Reply
  49. Paul

    I've patched following Mike's instructions but my pdf is still blank. Eric, can you explain what you did to get yours going? Is this a permalink issue?

    Reply
  50. Paul

    Unfortunately 2.2.4 is still giving me a blank paper (generated pdf contains only title & sub). The RSS feed is valid according to http://validator.w3.org/feed/. Via Fivefilters, the paper is produced ok.

    Let me know if there's anything I can do to chase this bug down.

    Paul

    Reply
  51. Rob

    Hi, I installed 2.2.4 but I still only get a blank pdf newspaper, with a correct headline. The same when I try with a category. Any thoughts?
    Thanks
    Rob

    Reply
  52. Mike

    Paul, Rob

    The behaviour I was seeing seems similar. The fixes are to do with various URLs used internally for redirects which are can get malformed under certain configurations of WordPress. As a result during the redirect sequence you're not actuallly pulling from the RSS feed. Hence it is blank.

    If you have access to the apache or IIS log file on your server you should be able to see the URL sequence at the tail of the log. If you post these I will have a look for you.

    I'm not yet sure if I'm going to use the plugin in the site but If Martin is happy to incorporate fixes, I will do a bit more fiddling around and send more patches. The code is fairly easy to work with. I'm also interested in some of Max's enhancements.

    Mike

    Reply
  53. Paul

    Mike,

    Here's the tail I'm getting; it's the only line that appears:

    127.0.0.1 - - [24/Nov/2010:10:17:03 +0000] "GET /?feed=rss2 HTTP/1.1" 200 446 "http://aaaaa.bbb?feed=rss2" "SimplePie/1.3-dev (Feed Parser; http://simplepie.org; Allow like Gecko) Build/20101123102807"

    Incidentally, I tried switching themes to the default and deactivating all plugins and got the same blank pdf.

    Paul

    Reply
  54. Paul

    Just in case that rss2 foxes you, I'd changed a line (#181 in makepdf.php) to test something on Martin's suggestion. Have just switched it back and I get:

    127.0.0.1 - - [24/Nov/2010:10:26:07 +0000] "GET /?feed=make-pdf-newspaper HTTP/1.1" 200 446 "http://aaaaa.bbb?feed=make-pdf-newspaper" "SimplePie/1.3-dev (Feed Parser; http://simplepie.org; Allow like Gecko) Build/20101123102807"

    Thanks

    Paul

    Reply
  55. Mike

    Erm, yes that URL was a little confusing. Now back on track.

    The interesting think is that you are coming in from the loopback address whereas I get a real IP address at that point. I wonder whether you have some funny web server internal firewalling problem.

    If you have access to the server itself (I assume it is linux) can you log in and run
    `wget http://aaaaa.bbb?feed=make-pdf-newspaper`
    and fire up an editor on the file it creates and see if it contains articles or is just some html template stuff. Also check the tail of the log file again and check the wget is coming in via 127.0.0.1

    We can do this exchange by email for a while and post back the outome. I'm webmaster at bruntsfield dot org.

    Mike

    Reply
  56. Paul

    OK, issue solved:

    my etc/hosts file had my domain listed as a loopback.

    I had this line in hosts in order to get mail generated locally for another application:

    127.0.0.1 localhost mydomain.com

    This resulted in WP trying to use loopback instead of the real IP to acquire the RSS content for the pdf. That's why the pdf ended up blank.

    All sorted now; thanks to Mike for pointing the way.

    Paul

    Reply
  57. Mike

    OK, my final comment on this for a while, but hopefully one that will help generally.

    Paul's problem arose because the Server is making HTTP requests of itself in order to create the PDF.

    So, if you have a blank newsletter (main one, not category one) you should issue the following http requests in your browser
    http:///?feed=make-pdf-newspaper
    This will return the RSS feed. If it's blank it's a problem with your RSS feed, play with the settings inside wordpress.

    If, however, there is content in this feed but not in your newsletter then the problem is probably that when the server makes the request it is not getting back the same as you are getting in the browser. There are any number of reasons this could happen. Paul's problem was that his http request was being redirected to a different virtual server because it was coming in via the wrong IP address.

    The way to check this is to log onto the server and issue the commandline `wget http:///?feed=make-pdf-newspaper`
    This will return a file, I think it is called index.html?feed=make-pdf-newspaper

    It contains the feed that the server is retrieving. Open this file in an editor and you should see some clues as to what the problem is. Also look at the web server log file and see how the request is being logged. If it is going to the wrong virtual server, you need to change your server config to fix this.

    In principle the plugin could be made more robust by having the browser retrieve and then re-post the feed via javascript/ajax, rather than making the http request from the server. However I'm not volunteering to write that.

    Reply
  58. Paul

    @Eric

    Just to clarify Martin means:

    http://yourdomain.com?feed=make-pdf-newspaper

    When I did a wget for this url, the resulting file contained the folowing:

    Warning: require(./wp-blog-header.php) [function.require]: failed to open stream:
    No such file or directory in /var/www/index.php on line
    17

    Fatal error: require() [function.require]: Failed opening required
    './wp-blog-header.php'
    (include_path='.:/usr/share/php:/usr/share/pear') in
    /var/www/index.php on line 17

    ... and the line 17 it refers to was:

    require('./wp-blog-header.php');

    Paul

    Reply
  59. Paul

    I've picked up a small bug in image generation.

    When an image name contains a + in it (eg image+.jpg), the image is not shown in the pdf (but a valid link will appear if you have these switched on). If you remove or replace the plus sign, the image will appear.

    Paul

    Reply
  60. Just found this plugin and I think it will be just what I need for a project. I've been testing it out and I can get it to generate correct pdf files for categories and archives, so that's great.
    The problem though is the 'normal' pdf based on the custom feed. When I check the feed, only a limited selection of articles appear (and the plugin is correctly generating a pdf of what it finds). When I check the proper site feed, I see all the posts I expect to see, so there is nothing inherently wrong with the site feed - just the custom version.
    The archive version is really the one I need and that works, so all is good. But it would be nice to figure out the other problem.
    Thanks,
    John

    Reply
  61. Sorry - some other questions that popped into mind after I'd posted.
    Is there a way of automatically generating a monthly archive of posts?
    Setting up a cron job to run, say, on the first of each month, isn't a problem. But how would I tell it to create a pdf containing the posts from the previous month?
    And is there a way of combining archives and categories? If I wanted, say, the last month's post in category A in one pdf and last month's post of category B in another.
    And then there is the next obvious question - multiple categories? Is it possible to create a pdf drawing from combinations of categories? Even if it was do-able from a customised url that would be a start.
    Thanks again,
    John

    Reply
    1. Post author

      Hi JohnO,
      Quite a bit here that I've never even thought of. I'm wondering if a better route for you would be to self-host your own version of the full FiveFilters code then cron the various versions you need. This would give you more flexibility in the rss feeds you can pdf (wordpress lets you pull rss from all post,categories, tags, archives by adding ?feed=rss to the url. You could also merge feeds using Yahoo Pipes)

      Some problems you might encounter for what you're wanting to do are: rss feed limits and server memory to compile the pdf.

      Sorry I can't be of more help,
      Martin

      Reply
  62. Thanks for the prompt reply Martin.
    I'll have a look at the full FiveFilters code and see what's involved with that.
    It's a long time since I've done any serious coding but, since you know your own code, I wonder what you think would be involved in getting the multiple choices of category and archive going?
    John

    Reply
    1. Post author

      Hi JohnO,

      Don't think multiple categories are possible but archives might. The very last option in Make PDF Newspaper settings lets you specify a custom url from your blog, which could be an archive address. All you've got to do (and I don't know if it is possible) is write a cron which can include last month number and year number.

      Martin

      Reply
    1. Post author

      @Franky Hi Franky - I'm not a cron expert but a file with a query string should work. I wonder if it is timing out before completing

      @Bill Hi Bill - I've never seen this one before. The only thing I can think of is that all the libraries with the plugin haven't been uploaded (but that's a very long shot)

      Martin

      Reply
  63. Hello !
    I am trying to make it work.
    - I installed Version 2.2.4 on WordPress Version 3.0.2.
    - I created a "pdf" folder in "wp-content". Its rights are 707. I cannot change it to 777 (my provider is OVH).
    - I activated the plugin
    - I saved the settings
    "Test PDF" gives me this error :
    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homez.157/XXXX/www/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 156
    I cannot figure out why…
    I'd be happy to know :)
    Thanks very much !

    Reply
  64. Well after a lot of time triying to solve a lot of errors,
    this is my last problem.

    Any Idea?
    regards
    MAx

    Warning: trim() expects parameter 1 to be string, array given in /var/www/blog/wp-content/plugins/make-pdf-newspaper/libraries/phphooks/phphooks.class.php on line 185

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/blog/wp-content/plugins/make-pdf-newspaper/libraries/phphooks/phphooks.class.php:185) in /var/www/blog/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 385

    Reply
  65. Hi Martin,

    are you still working on this plugin?

    In forum are posts with no answers, since months.

    Also i need to know, how i can include more or all posts in the PDF. Urgent!

    Thx, Frank

    Reply
    1. Post author

      Hi Frank - afraid all of my wordpress plugin development is on ice. You should be able to add more posts to the pdf by upping the general WordPress Reading Setting and increasing the number of Syndication feeds show the most recent. The problem you might get is the plugin running out of memory when writting a big pdf
      Martin

      Reply
  66. Well, it's incredible but don't work!!!! One week trying but zero results!!
    My last error
    Fatal error: Allowed memory size of 62914560 bytes exhausted (tried to allocate 7864320 bytes) in /home/autismod/public_html/wp-content/plugins/make-pdf-newspaper/libraries/tcpdf/unicode_data.php on line 16479

    Only with one new, not a lot of news obiously. Only One register

    And if I use the web service, mmmm, not nice! Only two pages.
    I use the last version of wordpress
    Any Idea?

    Reply
  67. Hi,

    Thanks for the great work !

    Was looking to get a forum to ask my question because of too many comment to read 130 so far :)

    Bug issue:

    Cannot change the phrases in options page in english and that I needto put in french :

    I try on the option page, no change saved, and try by phpMyadmin and changing this phrase in mysql have cause erase of newspaper data.

    Alos I wanted to know how to change the number of article in PDF, and how to choose or define a starting & ending date of a article selection ?

    Thanks for your time reading.
    David

    Reply
  68. Hi, I test your plugin and it's really an amazing one. But I have a little problem that I can't explain :

    When I'm making a pdf newspaper from the admin plugin It include all the gallery pictures of my news : that's perfect but I want to realise a monthly pdf ... and the génération of the pdf seems to be based on the RSS streaming of the web site... So I change my permalink to be able to produce an URL for the month (third choice in the wordpress permalink menu).

    It seems to work by putting /2011/02/ inside the URL for making a pdf from the categories BUT the pictures of the gallerie's news disappear ...

    I tried also to build pdf from categories ("news" that'is my main category). Pictures are there BUT it seems to take the rss of the website (using feedburner plugin) and dosn't parse news from that category, takken all the news from the rss ...

    Reply
  69. I've been having issues with a blank(ish) PDF being returned. I was able to get around by putting in the fivefilters URL as described in the plugin. This either adds a "made with fivefilters" to the heading, or the default method doesn't get as far as adding it... which is a shame, I'd like it without!

    I'm able to see the RSS feed through my browser, but wget'ing the URL you provided returns a 403 Forbidden error. What should I be opening up on the server? Permissions?

    Reply
  70. Frank

    Excellent plugin.

    One question: How could I modify the plugin to include an author byline by display name in the final pdf? This would be a big plus for multiuser blogs!

    I assume I have to edit this, but I butchered the code and am not calling it correctly:

    public function addItem($title, $content, $date=0, $author)
    {
    $cancel_add = false;
    $html = ''.$title.'';
    $html .= '';
    if ((int)$date != 0) {
    $html .= ''.date_i18n(get_option('date_format').' '.get_option('time_format'), $date).'';
    }
    $html .= '';
    $html .= ''get_author(display_name).'';
    //if (preg_match('/The ska and dub/i', $content)) { die($content); }
    $html .= $content;

    Reply
    1. Post author

      @Frank I would pass the author name to addItem rather than in the public function. So around 368 of makepdf.php include something like:
      $author = $item->get_author();
      if ( is_object($author) ) {
      $author = $author->get_name();
      }

      then around 370 addItem becomes:

      $pdf->addItem('get_permalink().'">'.$title.'', $story, $date, $author);

      then you can display $author somewhere in the public function addItem maybe line 76:

      $html .= ''.date_i18n(get_option('date_format').' '.get_option('time_format'), $date).' | |'.$author.'';

      Martin

      Reply
  71. Frank

    Thanks! This lead me to the right path. If anyone is interested, I have the two modified files for including authorship in your pdf!

    Reply
  72. I have installed the plugin but I get very inconsistent results. My main purpose is to PDF from a one category. Sometimes I get only one post from the category, most of the time I get a blank PDF. Any suggestions as to what might be wrong? P.S. I have increased the php.ini memory setting but that does not seem to solve the probelem.

    Reply
  73. Kevin

    I am using an internal University server, but can make adjustments as needed...
    I gave the cache folder 777 permissions, and after creating the wp-content/pdf folder, gave it 777 permissions.

    While trying to make the PDf, it wouldn't do anything at all, until I created a blank file with newspaper.pdf and put inside the PDF folder, then all it does is create the Title & Date, the rest being blank.

    Are there some other permissions I need to be aware of, as I see many people are having issues with Blank PDF's

    Reply
    1. Post author

      Hi Kevin, there are some comments earlier in this thread which might help. I think the problem is with certain wordpress configs the custom rss feed generated by the plugin gets malformed. Try reading from here to see if you can find the answer.

      Sorry I can't be of more help,
      Martin

      Reply
  74. Kevin

    Martin,
    I am very close to getting this to work within an University setting. Can you tell me a few things?

    Are there any particular IP's or URL's that I need to provide to the I.T. department to put a pinhole in the firewalls?

    Also, are there any particular libraries that the I.T. department needs to load on the servers instead of trying to pull all of the information from your plugin?

    Reply
    1. Post author

      The info the plugin potentially goes and gets from external sites would be:

      * url shortening from tinyurl or bit.ly,
      * QR Code from Google Chart API
      * thumbnail from Bluga.net

      The plugin uses PHP 5.2> and comes packaged with: TCPDF, HTML Tidy, HTML Purifier, SimplePie, PHP Typography, OPML Parser and PHP Hooks

      Hope this helps,
      Martin

      Reply
  75. Hi, I finish to make this plugin perfecly working with my site (tidy-html was in cause). When I make a pdf with the last month news there is only 15 news in the pdf ... how and where it is possible to change that kind of limitation ???

    Reply
    1. Post author

      @achel I think if you increase the number of rss items (Syndication feeds show the most recent) in the General Reading settings of your blog you should be able to get more items

      Reply
  76. It works, but not fine : when I go up to 32 news in the rss feed my server make an internal error (quadcore xeon with php 5.3.6 and the vhost have a max time limit of 90 sec and an allowed memory of 90Mo). I precise that the generation of the pdf take in count all the pictures.

    I was thinking firstly that the plugin parsed the pages of the archives when I use the last option ...

    In a second time, it's not really practical ... to make the pdf I need to put in the wordpress option that my feed publish x articles and flush the cache of the website ... and after the pdf construction, return to the normal number (15) ... Is it possible to dump the feed variable in an option of the plugin ???

    Reply
    1. Post author

      I can add item number to the to do (there is a new version of the five filter pdf engine in the pipeline so going to wait until that is ready). In the meantime you can manually override by opening rss-make-pdf-newspaper.php in the plugin editor and replace
      while( have_posts()) : the_post();
      with (where posts_per_page is how many items you want to include)

      $my_query = new WP_Query('posts_per_page=10');
      while ($my_query->have_posts()) : $my_query->the_post();

      Reply
  77. Hi Martin,
    i've installed Make PDF Newspaper and configured it,
    but if i try to make pdf obtain this messages:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/w95594/domains/patriziacallegarini.it/public_html/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 36

    Fatal error: Remote source didn't return any data. in /home/w95594/domains/patriziacallegarini.it/public_html/wp-content/plugins/make-pdf-newspaper/makepdf.php on line 120

    is this a provider limitation?

    many many thanks!

    Reply
  78. Thanks for your reply,
    i've enabled the "Use external service " options and now it works fine" ;-)

    But, another question (the last): In addition to articles is it possible can get all the pages of the site?

    many many thanks!

    Reply
  79. Kevin

    Is there a file or function within the plugin users can change to display more than 10 posts in a PDF? It seems to just stop at 10, no matter if I am using the Category or if using the Digest feature.

    Reply
    1. Post author

      @Kevin the easy way is to go to Settings > Reading and increase 'Syndication feeds show the most recent' (the more complicated way is to change the loop in rss-make-pdf-newspaper.php to:

      and changing the showposts number

      @nico 404 could mean one of the plugin files is missing or something wrong with the read/write properties for the pdf folder

      Martin

      Reply
  80. nico

    every folder have write permission but there is always the same mistake
    "page not found" with the template of my blog
    and there isn't a pd in the folder pdf

    Reply
  81. Love your plugin, simply awesome. I was using this to make the pdf's and up till the latest wordpress update 3.3.1 it worked, now it appears to be broke. What happens now instead of making 7 pdf's from the last few blogs it only makes one for the current blog, there are no errors it just will not make more than one, any help would be greatly appreciated. Orion Quest

    Reply

Leave a Reply