vedang / pdf-tools

Emacs support library for PDF files.
https://pdftools.wiki
GNU General Public License v3.0
618 stars 89 forks source link

Writing files read via jka-compr overwrites compressed file with uncompressed file #257

Open piater opened 7 months ago

piater commented 7 months ago

Steps to reproduce the behaviour

  1. Find any compressed PDF file, say, compr.pdf.gz.
  2. Alter it, e.g. by adding annotations.
  3. Save it with C-x C-s.

This results in compr.pdf.gz containing the altered PDF, not compressed despite the .gz extension.

Writing to a new file with a .gz extension using C-x -C-w likewise results in an uncompressed file.

What is the expected behaviour? compr.pdf.gz is replaced by its altered PDF, transparently gzip-compressed by jka-compr.

Your pdf-tools install Status: Installed in ‘pdf-tools-20230611.239/’ (unsigned). Version: 20230611.239 Commit: c69e7656a4678fe25afbd29f3503dd19ee7f9896

This is perhaps best fixed jointly with #258 by changing the file-saving logic of pdf-tools.