Documentation
¶
Overview ¶
Package archive is used to parse a .zip file retrieved by the API.
Here is the content of an archive retried on the tablet as example: 384327f5-133e-49c8-82ff-30aa19f3cfa4.content 384327f5-133e-49c8-82ff-30aa19f3cfa4//0-metadata.json 384327f5-133e-49c8-82ff-30aa19f3cfa4//0.rm 384327f5-133e-49c8-82ff-30aa19f3cfa4.pagedata 384327f5-133e-49c8-82ff-30aa19f3cfa4.thumbnails/0.jpg
As the .zip file from remarkable is simply a normal .zip file containing specific file formats, this package is a helper to read and write zip files with the correct format expected by the tablet.
At the core of this archive package, we have the Zip struct that is defined and that represents a Remarkable zip file. Then it provides a Zip.Read() method to unmarshal data from an io.Reader into a Zip struct and a Zip.Write() method to marshal a Zip struct into a io.Writer.
In order to correctly use this package, you will have to understand the format of a Remarkable zip file, and the format of the files that it contains.
You can find some help about the format at the following URL: https://remarkablewiki.com/tech/filesystem
You can also display the go documentation of public structs of this package to have more information. This will be completed in the future hopefully to have a precise overall documentation directly held in this Golang package.
Note that the binary format ".rm" holding the drawing contained in a zip has a dedicated golang package and is not decoded/encoded from the archive package. See encoding/rm in this repository.
To have a more concrete example, see the test files of this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶ added in v0.0.6
type Content struct { ExtraMetadata ExtraMetadata `json:"extraMetadata"` // FileType is "pdf", "epub" or empty for a simple note FileType string `json:"fileType"` FontName string `json:"fontName"` LastOpenedPage int `json:"lastOpenedPage"` LineHeight int `json:"lineHeight"` Margins int `json:"margins"` // Orientation can take "portrait" or "landscape". Orientation string `json:"orientation"` PageCount int `json:"pageCount"` // Pages is a list of page IDs Pages []string `json:"pages"` TextScale int `json:"textScale"` Transform Transform `json:"transform"` }
Content represents the structure of a .content json file.
type ExtraMetadata ¶ added in v0.0.6
type ExtraMetadata struct { LastBrushColor string `json:"LastBrushColor"` LastBrushThicknessScale string `json:"LastBrushThicknessScale"` LastColor string `json:"LastColor"` LastEraserThicknessScale string `json:"LastEraserThicknessScale"` LastEraserTool string `json:"LastEraserTool"` LastPen string `json:"LastPen"` LastPenColor string `json:"LastPenColor"` LastPenThicknessScale string `json:"LastPenThicknessScale"` LastPencil string `json:"LastPencil"` LastPencilColor string `json:"LastPencilColor"` LastPencilThicknessScale string `json:"LastPencilThicknessScale"` LastTool string `json:"LastTool"` ThicknessScale string `json:"ThicknessScale"` }
ExtraMetadata is a struct contained into a Content struct.
type Layer ¶ added in v0.0.6
type Layer struct {
Name string `json:"name"`
}
Layers is a struct contained into a Metadata struct.
type Metadata ¶ added in v0.0.6
type Metadata struct {
Layers []Layer `json:"layers"`
}
Metadata represents the structure of a .metadata json file associated to a page.
type Page ¶
type Page struct { // Data is the rm binary encoded file representing the drawn content Data *rm.Rm // Metadata is a json file containing information about layers Metadata Metadata // Thumbnail is a small image of the overall page Thumbnail []byte // Pagedata contains the name of the selected background template Pagedata string }
A Page represents a note page.
type Transform ¶ added in v0.0.6
type Transform struct { M11 int `json:"m11"` M12 int `json:"m12"` M13 int `json:"m13"` M21 int `json:"m21"` M22 int `json:"m22"` M23 int `json:"m23"` M31 int `json:"m31"` M32 int `json:"m32"` M33 int `json:"m33"` }
Transform is a struct contained into a Content struct.