View Single Post
Old 02-18-2010, 07:25 AM   #5
Tobago
Junior Member
Tobago began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: Palm m500
Smile

Hi John, sorry for my late reply.

I played with the PDF-PDBs and had some corresponding original 'non-palmed' PDFs to compare to.
The AdobeReader for PalmOS converter adds a stub to the original PDF-file and wraps it into a PDB-file.

This is for text-only PDFs, if there are images, overlarge fonts in it,
they are replaced with a lower size/resolution version, according to
the chosen colour-depth and size in Adobe Reader for PalmOS-Converter.

It's easy to get a PDF back, all it takes is finding first hex-values sequence
25 50 44 46 2D ('%PDF-') in the file, stripping everything before it and
finding the PDF-End-marker: hex: 25 25 45 4F 46 ('%%EOF') and remove
everything after it.

To put it in Perl-code:
Code:
  if ( $pdfPdb =~ m/(%PDF-.*%%EOF)/m ) {
 print "Successfully extracted PDF: <$1>\n";
 }
The procedure works with every PDF-PDB I have tested so far!
I am really glad I am finally not trapped with non-recoverable PDF-PDBs.

I searched the 'net before for a software or script to do this, but found none.
Now adding support for the PDB-type/identifier '.pdf'/'ADBE' in Calibre would be easy in my opinion!
This would be another feature only Calibre supports, to make it even more outstanding.

But please do not hardcode opening it with Adobe Reader, but with the system's default PDF-Reader.
(I uninstalled Adobe/Acrobat PDF because of frequent security problems and use Foxit PDF Reader instead.)

I can send you some PDFs if you want, but most are multi-Mebibite large.
Should I open a new ticket for Calibre?
Tobago is offline   Reply With Quote