FormatConversions

From Tomes Support Wiki

Jump to: navigation, search

Contents

ShelfServer Format Conversions

PalmOS type files (Mobi, Plucker, PalmDoc / AportisDoc) files are always transmitted to the device completely un-modified.

Other formats need a bit more help.

Actual Parsed Formats

While Tomes + ShelfServer are marketed as supporting a wide array of formats, quite a bit of the magic is done on the desktop in ShelfServer. Tomes currently reads all (supported) Palm formats natively as well as plain text and HTML. Everything else (CHM, MHT, RTF, etc.) is converted into either plain text or HTML as appropriate for the format.

Text requirements

Tomes is designed to process only UTF-8 encoded text files. ShelfServer automatically converts any other encoding into UTF-8 as the file is transmitted to the device. Behavior with any other character encoding is unknown at this time, but would likely result in file truncation or poor chunking of files.

HTML requirements

HTML files must also use only UTF-8 encoding. ShelfServer converts all other encodings into UTF-8 before transmitting the HTML. The same applies to any other formats which are translated into HTML.

Files must be only well formed XHTML. All tags must be nested properly. CSS should exist only in the HEAD element or as individual style attributes on individual tags. Style blocks embedded anywhere else in the file outside the HEAD element will cause problems with chunking and display. All JavaScript, Flash, or other OBJECT or EMBED tags must be removed.

Elements wider than the screen such as tables will either be cut of and unreadable or will cause text to scale to unreadably small font sizes.

Any references to external elements (link tags for CSS or similar) should be removed or resolved locally and embedded before transmitting the file to the device. It may cause problems and unexpected behavior for end users if any auto-loading external URL elements are left in documents. Such elements include style blocks, link elements, images, etc.

Users expect to be able to read documents fully off-line in airplane mode. Some users may pay per-byte for bandwidth or have limited amounts of download bandwidth in their contracts. It is thus extremely important that no files be loaded which would cause external files to be constantly downloaded each time the user reads a file.

Frames must be stripped.

Certain HTML attributes and CSS elements should be removed for best results. Anything which sets an explicit size, color, or font on an object will cause problems.

Images may be embedded directly into HTML files using the following syntax:

  1.  
  2. <img src="data:image/png;base64,iVBORw0KGgoAA....."/>
  3.  

Images will also be read off the device file system if relative img-src URLs are used. This use is discouraged, however; and is never used by the current ShelfServer implementation. Any stand alone image files will not be shown in file listings and are not deleted along with the document which references them. Only removing the entire containing folder will delete such images.

File Extensions

Tomes uses the file extension to determine how to read each file:

txt Plain-text
html HTML
mobi Always a MobiPocket PalmOS file
prc, pdb Any type of Palm file, including MobiPocket


The prc and pdb file extensions are examined for a known MagicCookie in the appropriate place for a PalmOS database header. The mobi extension is assumed to ALWAYS contain a MobiPocket file, and the PalmOS magic is not checked for such files. Any pdb or prc file containing an unsupported PalmOS file type will not appear in the on-device file listing. Deleting the containing directory will be the only way to remove such files.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox