|
|
|
|
|
|
|
|
How to generate Doc files for Palm devices from Notes (continued)
- The PDB header has date fields based on seconds from January 1, 1904. These are used in the HotSync process. I've written GetSecs() to handles this properly using a known seed value.
- Be aware that there's a problem opening our file in binary mode. We need to write out the binary data in the headers. Unfortunately, in this mode Notes writes out all strings in Unicode; that's two bytes per character rather than one. So, we need to write text data in output mode. The solution is to create our file in three parts, closing and re-opening each time as you can see in Table B.
| Mode |
Action |
| Output |
Write PDB Title. 32 bytes, 0 terminated. |
| Binary |
Write PDB header, record list and Doc header. |
| Output |
Write Doc records. |
Doc format example With the above problems sorted out and structures for the various headers created, we're ready to go. As an example we've created a small database that creates a PDB file from a Rich Text field using GetFormattedText and attaches it to the document. There is a design limit of 32K per PDB as that is the limit for a singlestring with the given code.
A final word about formatting Once you've gotten past the basics of creating a Doc file, you can go on to the niceties of formatting. You may find yourself experimenting with the format to get the result to look right on the Palm organizer's small screen -- especially where it may wrap text followed by your carriage return. Also worth noting is that RichText bullets do not convert, so replace them with the Chr(95) block instead. Happily most of the Doc viewers support HTML-like tags of some degree of complexity in the pre-converted text. This will help with formatting and navigation. As with browsers, the support varies and you can end up tied to a particular viewer if you make heavy use of particular features. Figure A shows a simple example of tags from the Notes database.
FIGURE A
 
Here's a poem with a simple tag in the Notes database. Roll over picture for a larger image.
Figure B shows how that Notes field translates onto the Palm device..
FIGURE B
Here's the converted poem as seen on a Palm device using TealDoc.
Mark Lawson is a consultant with Electric Memo Ltd. He can be reached at markl@electricmemo.com.
|
|
|
|
|
|
|
|
|
|
|