Skip to content

williamsdb/wordpress-to-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


WordPress to PDF

A simple script to allow you to export all your blog posts to a nicely formatted PDF file

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

I wanted a way to output all the posts in my WordPress blog to a nicely formatted PDF file but none of the existing WordPress plugins worked so I decided to build my own script.

(back to top)

Built With

(back to top)

Getting Started

Running the script is very straight forward:

  1. download the code
  2. run php index.php

You can read more about how this all works in this blog post.

Prerequisites

Requirements are very simple, it requires the following:

  1. PHP (I tested on v7.4.33)
  2. a WordPress blog and your WordPress Application Password (see this blog post for details of how to do that).

Installation

  1. Clone the repo:
    git clone https://github.com/williamsdb/wordpress-to-pdf.git

(back to top)

Usage

  1. Run the code: php index.php "URL of your site" "name of the WordPress user" "your Application Password" "local folder where you would like the output placed"

You will see output similar to the following:

The last step, “Writing output file” takes quite a while so don’t worry if it doesn’t seem to be responding.

For more information, please refer to the this blog post

(back to top)

Known Issues

  • only the featured image is supported, any in the body of the post will be silently dropped. Also, videos of any sort are not supported.
  • only simple text formatting is supported (bold, italics and plain text) everything else will look strange
  • only character set Windows-1252 is supported which means any non-English characters and other non-standard characters such as emojis will be dropped
  • WordPress code blocks are only partially supported and have no code formatting.

There are no plans to fix these issues and more likely is a rewrite of the code to support UTF-8. Keep an eye on my site for more information.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

(back to top)

Contact

Your Name - @spokenlikeageek - Contact

Project Link: https://github.com/williamsdb/wordpress-to-pdf

(back to top)

Acknowledgments

(back to top)

About

Export Wordpost Posts to a PDF file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published