Version: (using KDE KDE 3.4.0) Installed from: Debian testing/unstable Packages KPDF should handle gzipped and bzipped PDFs (files of the form *.pdf.bz2 and *.pdf.gz) Reason: As PDFs can be very big and are generally read-only it is very convenient to store them in compressed form. gv handles this natively (it decompresses the files on the fly), which is very nice. It would be great if KPDF could do this, too.
Definitely we must do this. Already on TODO list, thanks for signaling.
can gv really decomress bzip2 compressed files? my gv could not do that, i tested. however at the same time do not forget to add decompression support for files comressed with compress (ie: *.ps.Z or *.pdf.Z) maybe zip compressed files should be supported as well? after all kmail in kde 3.4 has compress attachment that uses zip.
The gv from Ubuntu and Debian can decompress bzip2 files, but the changelog says that they patched it in. Support for zip would be nice but is more difficult as a .zip can contain multiple files.
Kghostview does have transparent support for compressed (.gz) files. May be some code can be ported from it (o may be the kde libraries could provide a uniform way of doing this for all applications; if a file is compressed and some application is required to open it, it should be uncompressed to a temporary file)
Created attachment 11458 [details] patch implementing this feature This is a patch implementing this feature, against the sources in SVN. It actually works!. However, it doesn need some clean up like: - isolating the code related to uncompressing the file in another function - deleting the temporary files created - dislay the filename properly in the window bar. I've put the code in part::openURL (in part.cpp) as suggested in the sources. However, I think that it would be better to do this, in KPDFDocument::openDocument in file core/document.cpp There are two reasons for that: - the mime type is used to recognize compressed files and this is checked in KPDFDocument::openDocument - we should delete the temporary files when closing the document, and this seems to be much easier to implement in KPDFDocument::closeDocument() The code is taken from Ghostview (method KGDocument::uncompressFile()) Any help or comment is much appreciated, as I'm new to KDE development.
- isolating the code related to uncompressing the file in another function Don't see why, you just call it from one place in all the code, where's the need of making this a funcion? - deleting the temporary files created Obviously this is mandatory - dislay the filename properly in the window bar. And this is needed too Ok, try putting it in openDocument and see if that helps you in the 2 things that need to be done. Also what is the emit canceled suposed to do? IIRC we don't use such a signal
Albert, I implemented this in oKular
*** This bug has been confirmed by popular vote. ***
If it's in okular already, maybe this bug can be closed? KDE 4 isn't that far away anymore.
Of course can _not_ be closed, as this bug refers to 'kpdf', not to 'okular'.
Please fix this in kpdf as well. KDE4 might not be far away. But some users like me do not want to upgrade to the latest and greatest as it might introduce some other new bugs.
As discussed with Pino, this isn't going to be implemented for KPDF.