rm2pdf

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2020 License: AGPL-3.0 Imports: 8 Imported by: 1

README

go-remarkable2pdf

Go library to parse and render Remarkable lines files as PDF.

Usage

package main

import (
	"fmt"
	"os"

	rm2pdf "github.com/poundifdef/go-remarkable2pdf"
)

func main() {
    // Render a single .rm lines file as PDF
    input, _ := os.Open("4.rm")
    output, _ := os.Create("out.pdf")
    rm2pdf.RenderRmFile(input, output)
    output.Close()

    // Render a full Notebook file as PDF
    output, _ := os.Create("out.pdf")
    rm2pdf.RenderRmNotebook("Notebook.zip", output)
    output.Close()
}

Features Supported

  • Line thickness
  • Eraser
  • Highlighter
  • Multiple layers
  • Multiple pages
  • .rm lines file
  • Notebook .zip file

Not Currently Supported

  • Background templates (grid, lines, etc)
  • PDF annotations
  • ePUB
  • Layer naming and visibility
  • Line effects (ie, the painbrush shows "brush marks" based on the speed of your stroke)

Example Output

Remarkable Desktop:

go-remarkable2pdf

Original

Contributing

  1. If you want to make any other modification or refactor: please create an issue and talk to me prior to making your PR. This way we can talk about the feature, approach, and my own ability to commit to reviewing and merging code.

  2. I don't guarantee that I will keep this repo up to date, or that I will respond in any sort of timely fashion! Your best bet for any change is to keep PRs small and focused on the minimum changeset to add your feature.

  3. Of course, you are welcome to fork, modify, and distribute this code with your changes in accordance with the LICENSE.

Acknowledgements

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderRmFile

func RenderRmFile(input io.ReadCloser, output io.Writer) error

RenderRmFile converts a single .rm lines file and renders it as a single-page PDF.

input is a reader which points to the raw .rm file

output is where the PDF is written.

func RenderRmNotebook

func RenderRmNotebook(input string, output io.Writer) error

RenderRmNotebook converts an entire Remarkable Notebook and renders it as a multiple-page PDF.

input is the name of the Notebook, in zip, format, to open.

output is where the PDF is written.

func RenderRmNotebookFromBytes added in v0.2.0

func RenderRmNotebookFromBytes(input []byte, output io.Writer) error

RenderRmNotebookFromBytes is identical to RenderRmNotebook, but takes a byte array of the zip file as input.

func RenderRmNotebookFromZip added in v0.2.0

func RenderRmNotebookFromZip(reader *zip.Reader, output io.Writer) error

RenderRmNotebookFromBytes is identical to RenderRmNotebook, but takes a *zip.Reader as input.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL