Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Initial support for annotations #38

Merged
merged 2 commits into from
Jan 5, 2019
Merged

Conversation

juruen
Copy link
Owner

@juruen juruen commented Jan 4, 2019

So far the most common way to handle rM annotations by open source tools is to use the scripts that are available in https://github.com/reHackable/maxio/blob/master/tools/rM2svg

As we mentioned in #34, we would like to provide a similar functionality for rMapi. However, it'd be nice if we could avoid depending on multiple external tools and make it pure Go.

This PR, inspired by rM2svg and @peerdavid's work lays the foundations to do exactly that. We start by exporting annotations from Quick Sheets and notebooks.

This initial implementation doesn't support different brushes, tilts and pressure yet. But it's enough to render handwriting and simple sketches.

In this implementation I'm not using SVG and try to generate the PDF directly to simplify things.

/cc @peerdavid

@juruen juruen merged commit 8d297a5 into master Jan 5, 2019
@juruen juruen deleted the juruen/initial-annotations branch January 5, 2019 18:35
@lobre lobre mentioned this pull request Feb 22, 2019
@torwag
Copy link

torwag commented Feb 20, 2020

Downloading an annotated PDF via rmapi geta (version 0.0.9), I get a segfault with the following backtrace:

geta testfile
downloading: [testfile]...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5597dcd61124]

goroutine 1 [running]:
github.com/juruen/rmapi/annotations.(*PdfGenerator).Generate(0xc0004fba10, 0x0, 0x0)
	src/github.com/juruen/rmapi/annotations/pdf.go:62 +0x444
github.com/juruen/rmapi/shell.getACmd.func1(0xc00055c270)
	src/github.com/juruen/rmapi/shell/geta.go:54 +0x77a
github.com/abiosoft/ishell.(*Shell).handleCommand(0xc0001c60c0, 0xc0002a8520, 0x2, 0x2, 0xc0000e7c48, 0x20, 0xc000000180)
	pkg/mod/github.com/abiosoft/[email protected]/ishell.go:248 +0x2fb
github.com/abiosoft/ishell.handleInput(0xc0001c60c0, 0xc0002a8520, 0x2, 0x2, 0xc0002aa101, 0xc0002ae000)
	pkg/mod/github.com/abiosoft/[email protected]/ishell.go:202 +0x4f
github.com/abiosoft/ishell.(*Shell).run(0xc0001c60c0)
	pkg/mod/github.com/abiosoft/[email protected]/ishell.go:181 +0x215
github.com/abiosoft/ishell.(*Shell).Run(0xc0001c60c0)
	pkg/mod/github.com/abiosoft/[email protected]/ishell.go:97 +0x3b
github.com/juruen/rmapi/shell.RunShell(0xc00021a230, 0xc, 0xc0000e7ee8)
	src/github.com/juruen/rmapi/shell/shell.go:74 +0x951
main.run_shell(0xc00021a230)
	src/github.com/juruen/rmapi/main.go:14 +0x31
main.main()
	src/github.com/juruen/rmapi/main.go:38 +0x12e

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants