Exemple #1
0
}
if ($Stored) {
    $pdb = new PalmDoc("Stored Bookmark Test");
} else {
    $pdb = new PalmDoc("Embedded Bookmark Test");
}
if ($Stored) {
    $ThisTest = "stored";
    $OtherTest = "embedded";
    $UcFirst = "Stored";
} else {
    $ThisTest = "embedded";
    $OtherTest = "stored";
    $UcFirst = "Embedded";
}
$pdb->AddText("This is a test file to see if {$ThisTest} " . "bookmarks are recognized by a document reader.  To determine if " . "{$OtherTest} bookmarks are supported, you'll need to use the " . "other bookmark test, which is available from " . "https://github.com/fidian/php-pdb (in the examples)." . "To figure out if it worked, look for the bookmark list in this " . "document reader.  If it has a bookmark named \"{$UcFirst} " . "Bookmark\", then it worked.  If not, then this document reader " . "doesn't support {$ThisTest} style bookmarks.\n\n" . "This document was automatically generated using the PHP-PDB " . "library -- a free, GPL'd PHP library that manipulates PDB " . "files.  Feel free to give it a look at\n" . "https://github.com/fidian/php-pdb\n\n");
// Add the bookmark
if ($Stored) {
    $pdb->AddBookmark("Stored Bookmark");
} else {
    $pdb->AddText("*Embedded Bookmark\n");
}
$pdb->AddText("This is where \"{$UcFirst} Bookmark\" should " . "take you, if this document reader properly supports {$ThisTest} " . "bookmarks.\n\n" . "Don't forget to see if your document reader supports {$OtherTest} " . "style bookmarks!\n\n");
$pdb->AddText("Have a GREAT day!\n\n");
if (!$Stored) {
    $pdb->AddText("This next part is needed by the document " . "reader to detect where embedded bookmarks are located.  If " . "you plan on generating documents with embedded bookmarks, " . "you just need to add the special character (I'm using an " . "asterisk -- the star thing) at the beginning of the line and " . "the rest of the line becomes the bookmark.  Then, you just " . "include \"<X>\" at the end of your document (replacing the X " . "with the character you picked) to tell the doc reader which " . "character you used to define bookmarks, like what I have at " . "the end of this one.\n\n" . "Please note:  Aportis will use the special character if it " . "appears anywhere inside the file, so try to pick a character " . "that is not in the text you are converting into a doc " . "file:\n\n" . "<*>");
} else {
    $pdb->AddText("This is just some garbage that should fill " . "the screen so that when you jump to the stored bookmark, the " . "message saying that you are in the right spot should be " . "immediately at the top.  If this text is not there, and if " . "you use a small font, you may see it in the middle or closer " . "to the bottom.  This is annoying, and to keep things simple, " . "I just add this filler material at the bottom.");
}
$pdb->DownloadPDB("bookmark_" . $ThisTest . ".pdb");
// END HERE