Bug 102704 - Handle gzipped and bzipped PDFs
Summary: Handle gzipped and bzipped PDFs
Status: RESOLVED INTENTIONAL
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-29 01:26 UTC by Thomas Bleher
Modified: 2008-11-30 03:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch implementing this feature (2.70 KB, patch)
2005-06-15 01:37 UTC, Pablo De Napoli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Bleher 2005-03-29 01:26:13 UTC
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.
Comment 1 Enrico Ros 2005-04-02 09:53:57 UTC
Definitely we must do this. Already on TODO list, thanks for signaling.
Comment 2 disclosed 2005-06-01 22:08:30 UTC
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.
Comment 3 Thomas Bleher 2005-06-01 22:43:38 UTC
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.
Comment 4 Pablo De Napoli 2005-06-12 20:59:33 UTC
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) 
Comment 5 Pablo De Napoli 2005-06-15 01:37:13 UTC
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.
Comment 6 Albert Astals Cid 2005-06-16 18:22:17 UTC
- 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
Comment 7 Piotr Szymański 2005-08-13 14:46:08 UTC
Albert, I implemented this in oKular
Comment 8 Antti Salmela 2006-12-29 09:40:29 UTC
*** This bug has been confirmed by popular vote. ***
Comment 9 Ludo 2007-01-03 16:25:58 UTC
If it's in okular already, maybe this bug can be closed? KDE 4 isn't that far away anymore.
Comment 10 Pino Toscano 2007-01-03 16:34:54 UTC
Of course can _not_ be closed, as this bug refers to 'kpdf', not to 'okular'.
Comment 11 Kamaraju Kusumanchi 2007-04-05 07:23:24 UTC
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.
Comment 12 Brad Hards 2008-11-30 03:23:05 UTC
As discussed with Pino, this isn't going to be implemented for KPDF.