files

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RMFileInfo

type RMFileInfo struct {
	RelPDFPath         string // full relative path to PDF
	RelPDFTemplatePath string // full relative path to PDF template
	Identifier         string // the uuid used to identify the PDF file
	Version            int    // version from metadata
	VisibleName        string // visibleName from metadata (used in reMarkable interface)
	LastModified       time.Time
	OriginalPageCount  int
	PageCount          int
	Pages              []RMPage
	RedirectionPageMap []int // page insertion info
	Debugging          bool
	// contains filtered or unexported fields
}

RMFileInfo is a struct defining the collected metadata about a PDF from the reMarkable file collection

func RMFiler

func RMFiler(inputpath string, template string) (RMFileInfo, error)

RMFiler collects information from the reMarkable files associated with the uuid of interest. Either a pdf at <path/uuid.pdf> is expected, or a single A4 page template is to be provided instead. The uuid (identified by its filepath plus <uuid>), is used to collect information from the .metadata and .content files. It then collects layer information for each associated .rm file in a directory named by the uuid of the pdf.

func (*RMFileInfo) Debug

func (r *RMFileInfo) Debug(d string)

Debug prints a message if the debugging switch is on

func (*RMFileInfo) InsertedPages added in v0.0.3

func (r *RMFileInfo) InsertedPages() string

InsertedPages is a public export of the embedded insertedPages human readable page numbers func

func (*RMFileInfo) PageIterate added in v0.0.3

func (r *RMFileInfo) PageIterate() (pageNo, pdfPageNo int, inserted, isTemplate bool)

PageIterate iterates over pages using the rmfile iterator which provides a page number and the pdf to use (either the annotated pdf or the template). For annotated pdfs with inserted pages one might receive the following output from the iterator:

pageno | pdfPage | inserted | template | -------+---------+----------+---------------+ 0 | 0 | no | annotated.pdf | 1 | 0 | yes | template.pdf | 2 | 1 | no | annotated.pdf |

This function returns 0-indexed pdf pages

type RMPage

type RMPage struct {
	PageNo     int
	Identifier string   // the uuid used to identify the RM file
	RelRMPath  string   // full relative path to the .rm file
	Exists     bool     // file exists on disk
	LayerNames []string // layer names by implicit index
}

RMPage is a struct defining metadata about each .rm file associated with the PDF described in an RMFileInfo. Note that while the .content file records page UUIDs for each page of the original PDF, .rm and related file are only made for those pages which have marks

Jump to

Keyboard shortcuts

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