AntonelloCicchese.com

Wordpress post2pdf plugin

by antonello on Dec.19, 2006, under Wordpress

Post moved here

Wordpress pluginHello, this is my brand new wordpress plugin, it is still in a beta version, so use it at your own risk.

What does it do? It converts all your posts in a pdf document, you don’t need any particular application installed on your server or php extention, all you need (is love) is the plugin unzipped in your plugin directory and then activated in Plugin tab!

Only a small subset of html tag are supported by this plugin now, and in some cases it doesn’t render the document in a very good shape, but as i said, it is a beta…

Tags currently supported are

img, a, b, i, li, ol, code, em, pre,  strong, font, h1, h2, h3, h4, br

and images are restricted to jpg and png, so don’t expect too much, please.

This plugin is based on a pdf conversion class written by me and built on fpdf library.

As soon as possible i will post also the pdf class and so you can read more about it and more about customization, at this moment no customizations are avaiilable for the plugin.

Installation:

  1. Upload to your plugins folder, usually `wp-content/plugins/`
  2. Activate the plugin on the plugin screen
  3. For better results, if you use accented character like “à,é,è,ì,ò,ù” please set your wordpress encoding to ISO-8859-1 in Option/Reading menu.

Ver: 0.1.2
State: beta
Latest update: 07 january 2007

Here you can dowload the zip version of Post2Pdf plugin .
Here you can dowload the gzip version of Post2Pdf plugin .

Update history:

– 07 january 2007 –
You can now exclude the plugin in a post or in a page simply including this tag in the text: <!–post2pdf_exclude–> (the string it’s without spaces)

– 20 december 2006 –
Small bug resolved, image support improved.

Post moved here

convert this post to pdf.


18 Comments for this entry

  • goxu

    Hi, antonello

    This is something I’ve been looking for. If you don’t mind, I’d like to know whether or not this plugin can support muliti-byte languages as well.

  • antonello

    Hi, I think that fpdf library doesn’t support at all the multi-byte charset, so my plugin doesn’t support too. I’m sorry!

  • Roberlan

    Hi, Antonello
    This very nice plugin. It will be very useful for me, i´m planning to make a site with tutorials of illustrator, and this just come in handy. :) but i´m having some problems…
    I installed the plugin in my test blog, but when i try to convert a post with some image, i got a error message. Something about “getimagesize” or something like that
    How can i get rid of the little border around the text?
    And how i can change the icon?
    Thanks for the plugin

  • antonello

    Hi Roberlan, after your comment i’ve made some modification to plugin so to use the latest version, please download it again.

    For the icon question, you can change it simply changing the file in the icon plugins/post2pdf/icon directory, keep in mind that if you don’t want to change the code, use the sobstitute the icon file using the same file name.

    For the getimagesize error, if you post the entire error message, i can help you, otherwise the only thing i can say is that if you don’t want to use the getimagesize function you have to specify in the img tag width and height attributes.

    The little border could be changed simply editing line 29 in plugins/post2pdf/post2pdf.php file.

  • Roberlan

    This is the error message:

    “Warning: getimagesize(http://roberlan.com.br/testewp/wp-content/uploads/2006/11/testeimg3.thumbnail.jpg): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/roberlan/public_html/testewp/wp-content/plugins/post2pdf/pdf_class.php on line 275
    FPDF error: Some data has already been output, can’t send PDF file”

    The address of my test blog is: http://roberlan.com.br/testewp/

  • antonello

    Hi Roberlan,
    first of all, upgrade the plugin to the latest revision, and for the 403 problem, i think you have to set the image file permissions to 744 (CHMOD 744 filename), or at least this is how i set permissions on images, you can do this change using a ftp client.

    Try this solution, and let me know!

  • goxu

    Thanks for your response, Antonello.

    By the way it is very cool category icon of this page. Where did you get it? lol

  • antonello

    Hi goxu, do you mean the wordpress logo?
    In that case, take a look here:

    http://wordpress.org/about/buttons/

    Bye, Antonello

  • Ernesto

    Hi Antonello – this is a real nice plugin, but unfortunatelly i am using UTF-8 font encoding on my blog, so it isnt working for me. I have found the ufpdf class, what will do in the latest version both encodings – but my knowledge of php is unfortunately limitad, so that i cant include it by my own. If you could include it for those users like me, that are using utf-8 – it would be nice.

  • antonello

    Hi Ernesto, thank you for your suggestion, as soon as possible i’ll try to implement the utf8 version, maybe in the next release!

    Bye, Antonello

  • Ernesto Castillo

    Thanks Antonello for your prompt response. I have another prob, that maybe for you is to resolve more “easyli”. Is it possible to exclude the plugin from a certain page? I have installed the xdforum plugin and your plugin prevent only on the page off the forum the correct function of it. So if you could post the code for an exclusion of a certain page from your plugin, i would be really grateful.

  • Dalis M.

    Ciao Antonello,
    ho installato il plugin ma ecco il mio errore quando vado ad usarlo:

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/ilsatiro/public_html/wp-content/plugins/post2pdf/pdf_class.php on line 322

    Warning: Cannot modify header information – headers already sent by (output started at /home/ilsatiro/public_html/wp-content/plugins/post2pdf/pdf_class.php:322) in /home/ilsatiro/public_html/wp-content/plugins/post2pdf/fpdf/fpdf.php on line 1037
    FPDF error: Some data has already been output to browser, can’t send PDF file

  • antonello

    Hi Ernesto, I don’t know how can you exclude a plugin from a certain post,if I will find a solution, never mind I’ll post it here.

    —————

    Ciao Dalis M.,

    mi dovresti far vedere il codice html del post che ti da l’errore, altrimenti non posso sapere in che situazione sbaglia.

    Inviamelo in caso al mio indirizzo di posta, usa la pagina Contattami del blog poi ti risponderò in privato ed in caso pubblicherò la soluzione.

    —————

  • antonello

    Hi Ernesto I have found a solution that it’s made for you, in a few minutes I will upload the new plugin version with a tag to exclude it form posts or pages.

    Bye

  • Ernesto

    Mille grazie Antonello comunque voglio dire che il tuo plugin e il migliore che ho visto fin adesso in giro, molto meglio p.e. di posttoPDF che non da il return del autore e del titolo. Grazie del tuo grande lavoro (scusa il mio italiano pessimo)

  • antonello

    Grazie a te Ernesto per i tuoi suggerimenti e complimenti per l’italiano!

  • irxc

    As a few previous poster, I too am using UTF-8 and would really much like -and apreciate- if post2pdf would support UTF-8 in the future.

3 Trackbacks / Pingbacks for this entry

Archives