supernote_pdf

Crates.iosupernote_pdf
lib.rssupernote_pdf
version0.1.1
created_at2025-08-08 10:09:51.540992+00
updated_at2025-08-13 12:40:18.647951+00
descriptionCLI to convert .note files (and directories of them) into pdfs for archival and backup
homepage
repositoryhttps://github.com/RohanGautam/supernote_pdf
max_upload_size
id1786542
size114,014
Rohan Gautam (RohanGautam)

documentation

README

supernote-pdf

Crates.io License: MIT

A blazing-fast CLI tool for converting Supernote .note files to PDF, optimized for archival and backup.

demo

supernote_pdf converting a 800Mb folder of Notes into pdfs in 14s.


This tool is designed for one thing: converting Supernote .note files to PDF at maximum speed. It leverages parallel processing and custom PDF generation logic to handle large collections of notes.

✨ Features

  • πŸš€ Blazing Fast: Asynchronously decodes pages and processes entire folders in parallel. See Benchmarks for details.
  • πŸ“‚ Directory Conversion: Converts an entire folder of .note files, perfectly preserving the original directory structure.
  • πŸ’» Simple & Powerful CLI: A straightforward command-line interface for single-file or batch conversions.
  • πŸ”§ Optimized for Archival: Creates PDFs with embedded images, keeping file sizes small and conversion times low for densely written notes.
  • βœ… Robust: Includes safety checks to prevent accidental data loss (e.g., won't overwrite an existing output directory).

Here’s how directory conversion works:

Input Directory         Output Directory
-----------------       ------------------
notes/                  notes_pdf/
β”œβ”€β”€ Meeting.note  ====> β”œβ”€β”€ Meeting.pdf
└── project/            └── project/
    β”œβ”€β”€ Ideas.note      ====> β”œβ”€β”€ Ideas.pdf
    └── Draft.note          └── Draft.pdf

Conception

Several key design decisions were made to optimize for the primary goal of fast, reliable backups:

  • Device Support: The tool works with the files generated from the A5X and A5X2(Manta). A5X2 supoprt was added by @kkettinger . If you have other devices open an issue with a test .note file and I can work on adding support for that too!
  • Archival Focus: This conversion is for backup and viewing. It does not (yet) support interactive PDF features like hyperlinks or tags from the original note.
  • Raster over Vector: The converter embeds page images (raster graphics) directly into the PDF. While vector graphics are infinitely scalable, this approach was chosen because:
    • It keeps file sizes significantly smaller for notes with a lot of writing.
    • It drastically reduces the compute and storage costs associated with complex vector conversions.

πŸ“¦ Installation

From Crates.io (Recommended)

Ensure you have the Rust toolchain installed. Then, you can install supernote_pdf CLI directly from Crates.io using cargo:

cargo install supernote_pdf

and supernote_pdf will be available as a tool in your shell.

From Source

  1. Clone the repository:
    git clone https://github.com/your-username/supernote_pdf.git
    cd supernote-pdf
    
  2. Build and run the project:
    cargo run --release -- -i <input-path> -o <output-path>
    

πŸš€ Usage

The CLI is simple, requiring an input path and an output path.

supernote_pdf -i <input-path> -o <output-path>

Example 1: Convert a Single File

To convert a single .note file to a .pdf file:

supernote_pdf -i "My Notes/Meeting Agenda.note" -o "Archive/Meeting Agenda.pdf"

Example 2: Convert an Entire Directory

To convert your entire Note folder (copied from your Supernote) into a new Note_PDFs directory:

supernote_pdf -i path/to/your/Note_folder -o path/to/your/Note_PDFs

The tool will scan for all .note files in the input directory, recreate the folder structure in the output directory, and convert every file.

Note: For safety, the output directory must not already exist. This prevents you from accidentally overwriting previous backups.

πŸ“Š Benchmarks

supernote_pdf is significantly faster than available tools, making it ideal for large and frequent backups.

Single File Conversion

Test converting a 30-page, ~50MB .note file:

Tool Time Performance
supernote-tool 18.6 s Baseline
supernote_pdf (this tool) ~600 ms ~30x Faster

Full Directory Conversion

Test converting a local copy of my Supernote's Note folder:

  • Input: ~800 MB directory of .note files
  • Time Taken: ~14 s
  • Output: ~84 MB directory of .pdf files

Testing environment for the benchmarks above was on my Thinkpad X1 Extreme Gen2, Core i7 9th Gen. Your results may vary. supernote-tool was run using uvx --from supernotelib supernote-tool convert -t pdf ... several times.

πŸ—ΊοΈ Roadmap

  • Vector graphic support as an optional feature.
  • Support for more Supernote device formats (A6X, etc.). See jya-dev/supernote-tool for a project that supports more formats.
  • A web-based interface (WASM) for drag-and-drop conversion.
  • Support for PDF hyperlinks and tags.
  • CI pipeline

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

πŸ™ Acknowledgements

  • This tool stands on the shoulders of giants. A big thank you to the developers of supernote-tool, whose work provided the initial understanding of the .note file format and served as a valuable benchmark.
Commit count: 0

cargo fmt