A tool to allow batch PDF export for free Notion users. You can export as HTML with subpages and then use this tool to convert those into PDFs.
Get the latest download for Windows and macOS from the releases page:
https://github.com/ganeshh123/notion-pdf-export/releases
notion-pdf-export.exe
(Windows) or notion-pdf-export
(macOS).notion-pdf-export.exe
(Windows) or notion-pdf-export
(macOS) and wait for the process to be completed.pdfs
folder.https://github.com/ganeshh123/notion-pdf-export.git
git@github.com:ganeshh123/notion-pdf-export.git
npm install
node index.js
This is tricky. A lot of adjustments had to be made so that it can run without node.
Executables are compiled with a very specific version of nexe that allows access to the filesystem, which has a tricky setup procedure.
install_nexe_win.bat
as admin, will take about 5 minutes to install fully.install_nexe_mac
shell script, will take about 5 minutes to install, and you will need to enter an admin password. This sometimes doesn't seem to work properly, so might be worth doing manual install if there's problems.Firstly, install the general nexe package globally:
npm install -g nexe
sudo npm install -g nexe
In the project root folder build some executables with this version of nexe to download node binaries for Windows and macOS:
nexe . --target win32-x86-10.13.0
nexe . -t macos-10.13.0
This will download the binaries we need for later, delete the executables built with this for now.
Now we need to install a specific version of nexe that allows access to the filesystem:
npm install -g cspotcode/nexe#19a5046
sudo npm install -g cspotcode/nexe#19a5046
Now we should have the correct version of nexe for building. Confirm by running:
nexe -v
Check that the version is 4.0.0-beta.4
build_win32.bat
to build a Windows executable. This can be found in /dist/win32
and everything in that folder must be distributed together.
build_macos
to build a macOS executable. This can be found in /dist/macos
and everything in that folder must be distributed together.If you wish to compile for macOS on Windows or vice versa, you can do so using the manual method below.
To build a Windows executable, in the root directory of the project, run the command:
nexe . --target win32-x86-10.13.0 -o ./dist/win32/notion-pdf-export.exe
When distributing the executable notion-pdf-export.exe
must be placed in a directory with the original utils
folder from the source.
To build a macOS executable, in the root directory of the project, run the command:
nexe . -t macos-10.13.0 -o ./dist/macos/npe
Note that this is built under the name npe
due to an issue with accessing the current directory.
When distributing, place the npe
executable it in a directory with the following:
utils
folder from the source codenotion-pdf-export
:
#/bin/bash
cd "$0"/..
./npe
This can be obtained from mac_script.sh
or found inside /dist/macos
This script is needed to set the current directory before the npe
executable is run.
This project uses wkhtmltopdf for the conversions. This brilliant tool was created by Jakob Truelsen and is now maintained by Ashish Kulkarni. Version 0.12.6
has been used, and can be downloaded here.
wkhtmltopdf is released under the LGPL-3.0 License which can be found at utils/wkhtmltopdf/LICENSE
. The source code is available at the wkhtmltopdf repository.
Icon by Alex Martynov obtained from IconScout.