![]() Registered Member ![]()
|
Hi KDE experts
I have installed a KDE with KPDF. In most cases, they worked very well. However, yesterday, I converted a ppt file (MS powerpoint file) to pdf, forgot to rename the file (suppose it is foo.ppt) and try to use kpdf to open it. KPDF returned error of Unknown mimetype 'application/mspowerpoint'. After I corrected the file extension, renaming the file to foo.pdf, KPDF was able to open it. I remember on another host, KPDF is able to open PDF file even the file' extension is wrong. I have checked the code, KPDF calles KMimetype::findbyPath to determine the file type. But it seem the magic mechanism does not work so that KDE had to fall back to use file extension to judge the file type. I also checked my KDE environment referring to google with key work "KDE, mime, magic", it seems the $KDEDIR/share/mimelnk/magic is in correct format. Could anyone tell me what's wrong with my system?
Last edited by yueche on Tue Nov 10, 2009 10:15 am, edited 1 time in total.
|
![]() Registered Member ![]()
|
more detailed debug information shows kfile could not recognize the file, either.
But I don't know how to fix this ![]() |
![]() Administrator ![]()
|
It is probable that Windows based Powerpoint does not set the vital mime type information on the file, which Mac's also use I believe ( in addition to file extensions )
You can confirm this by using the "file" command. Therefore KDE applications have to implicitly trust that anything *.ppt is a Powerpoint file.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Hi bcooksley
Thanks for the reply. I have figured out the root cause. My current kpdf version is newer(0.5.10) than the one( which does accept pdf file with ppt extention in file name. I guess it is a new feature introduced, because after I changed the API KMime::FindbyFilePath to KMime::FindbyFileContent. It can recognize the file mentioned before. |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]