Hi guys,

I'm having trouble reading a pdb file with PHP-PDB (http://php-pdb.sourceforge.net/modules/doc.php)
I want it to upload a PDB and spit out the actual text content from that palm doc. So here's my code (the upload works fine so just the PDB doc is screwing up right now):

$pdb = new PalmDoc("doc");
$fp = fopen($tmpName, "r");
$pdb->ReadFile($fp);
fclose($fp);
echo $pdb->WriteToStdout();

(This file is being uploaded hence $tempName)

At the moment it spits out a bunch of weird characters:

Yko»vý®_Ácà"	 )Ûs‘s€•eÙVo,’sÒþBÍPÆ£á”äXV~}×Ú¤dÙI{(8¶4š!÷cíµ×¦î¶ÿzòñÝŸNzwEïn9ö

I experimented like crazy and could not get it to echo actual text!
All help is definitely appreciated!

EDIT:
Further experimentation with the following code led to these results (still doesn't work)

$pdb = new PalmDoc("Name Of Document");
$fp = fopen("craphound.pdb", "r");
$pdb->ReadFile($fp);
fclose($fp);

echo $pdb->TypeID;

$recids = $pdb->GetRecordIDs();
foreach ($recids as $ID) {
  $record = $pdb->GetRecordRaw($ID);
echo $record;
}

led to the follwing:

000a000000006240009b00f7000800050001000...(etc)

    Please let me know if there is anything else I could post to help you guys help me. I need to have it done for work, and I just need a bit of help. Thank you in advance!

    If there is a different/better way of doing this I'm all ears!

      Write a Reply...