Giter Club home page Giter Club logo

rm2pdf's Introduction

rm2pdf

Convert reMarkable tablet file 'bundles' to layered PDFs, with optional per-layer colours for selected pens.

This project is an adapted version of https://github.com/rorycl/rm2pdf . I've improved some parts, added the support for both rm file version 5 and 3, mainly to support my other project https://github.com/giorgiopiatti/container-remarkable-sync

rm2pdf -h

Invocation examples for annotated PDFs using the test files in testfiles:

rm2pdf testfiles/cc8313bb-5fab-4ab5-af39-46e6d4160df3.pdf /tmp/output.pdf
rm2pdf -c orange -c olivegreen testfiles/cc8313bb-5fab-4ab5-af39-46e6d4160df3.pdf /tmp/output2.pdf

Invocation examples for reMarkable notebooks using the test files in testfiles and the A4 template in templates.

rm2pdf -t templates/A4.pdf testfiles/d34df12d-e72b-4939-a791-5b34b3a810e7 /tmp/output3.pdf
rm2pdf -c blue -c red -t templates/A4.pdf testfiles/d34df12d-e72b-4939-a791-5b34b3a810e7 /tmp/output4.pdf

Details

rm2pdf requires "bundles" of files created on the reMarkable tablet, including the associated .metadata and .content files, together with the .rm binary and -metadata.json files associated with each page of reMarkable marks.

rm2pdf aims to create PDFs from both PDFs that are annotated on the reMarkable and reMarkable notebooks using these files. The latter uses an empty template PDF as the background. PDF templates can be made from the reMarkable png templates (in /usr/share/remarkable/templates) but should fit the standard 222.6264mm x 297.0000mm reMarkable output PDF size, or be A4.

Output PDFs are layered with the background PDF forming a "Background" layer and subsequent layers using the layer names created on the tablet. The layers can be turned on and off using tools provided by PDF readers such as Evince.

The pen widths and opacities are estimates and could be improved. The .rm file pressure and tilt information is not presently used.

Colours, base width and opacity are set for each pen are set in rmpdf/stroke.go. Those pens with ColourOverride true will have their colour overridden by the command-line options.

Some PDF files, notably those created by Microsoft Word, cannot be imported reliably, causing the programme to panic. Reprocessing problem PDFs with the pdftk tool seems to fix the problem.

Background

The project includes rmparse/rmparse.go, a remarkable tablet Go port of reMarkable tablet "lines" or ".rm" file parser, with binary decoding hints drawn from rm2svg https://github.com/reHackable/maxio/blob/master/tools/rM2svg which in turn refers to https://github.com/lschwetlick/maxio/tree/master/tools.

The project makes extensive use of the go PDF fpdf library and the contrib module gofpdi. The latter is used for including pages from existing PDF documents.

Build and test

Developed with go 1.13 on 64bit Linux.

Test: go test -v ./...

Build : go build; this should produce an executable called rm2pdf.

License

This project is licensed under the MIT Licence.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.