Jump to content

NEW VIDEO: I Quit MMOs and THIS Happened

[Tutorial] Export thread to PDF (Windows / Linux)


stabi

Recommended Posts

Hi all,

I was trying to find a way to export threads to PDF, unfortunately there is no 'easy' way to do it (i.e. a plugin) and copy&paste can be annoying, especially when you have plenty of pages, I found a small command line tool which exports a whole thread to a single PDF file.

It involves a little bit technical stuff, but I found that this is the best way to export a thread and I will guide you.

To make it even easier, I wrote a script for Windows and Linux (I was going to write a full guide for all these things...).

This script will do the following:

Windows related:

- Check what Windows version you are running (7, 8, 8.1, 10)
- Check your current Architecture (32-bit or 64-bit)
- Will download the needed tool for the correct architecture
- Will execute the tool for install (You just need to click next)
- Will add system variable path for easier execution

Linux related:

- After my script was almost done for Linux I realised its available from the repos... -.-

sudo apt-get install xvfb libfontconfig wkhtmltopdf


How to use wkhtmltopdf:

Windows:


Note: Download the wkHTMLtoPDF.bat from attachments, right click and execute as admin
 

Spoiler

 

If everything is done and correctly installed you should be able to execute wkhtmltopdf from the command line.

Press on start and type cmd:

win7-opencmd.png.6eb898fbda7e3a40c4072deb4de1d554.png

Now you are in the command line and type wkhtmltopdf, you should be able to see something like this:


windows7-wkhtmltopdf.png.87d60f15dae55a31969d2b639d32b10c.png


If yes, you can start downloading a thread and save to a PDF file, the syntax is:


wkhtmltopdf LINK OUTPUT

wkhtmltopdf https://forum.gamequitters.com/index.php?/topic/6087-ending-to-a-new-beginning-90-detox/ archs-journal.pdf

The problem here, the output file is saved into the folder where wkhtmltopdf is installed, but you can define the output like so:


wkhtmltopdf https://forum.gamequitters.com/index.php?/topic/6087-ending-to-a-new-beginning-90-detox/ C:\Users\USERNAME\Desktop\archs-journal.pdf

Replace USERNAME with your actual username, in my case 'foobar':

windows-savedtodesktop.png.2823befd544b2637891a77b21911d529.png

As you can see, there are some warnings. You can ignore them (I guess?) since I didnt notice anything wrong with the downloaded thread/pdf.

htCs04m.gif

Thats it!

 



Linux:
 

Spoiler

 

On linux you are set after you installed the package.

Syntax:


wkhtmltopdf LINK OUTPUT

wkhtmltopdf https://forum.gamequitters.com/index.php?/topic/6087-ending-to-a-new-beginning-90-detox/ /home/USER/archs-journal.pdf

Replace USER with your actual user:

ubuntu-threadtopdfuser.png.62ca20e7800b3771b56661047c517c3d.png

And there you go:

KWVjig6.gif

 


If you have any problems, drop me a PM and I will look via Teamviewer into it and set it up correctly for you.

Have fun!

 

wkHTMLtoPDF.bat

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...