Tool to edit PDFs?

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
Neo_78
Posts: 378
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Tool to edit PDFs?

Post by Neo_78 »

Is there a light tool (gui or cli) in the FatDog repository available to achieve the following?

- Merge multiple PDF files into one PDF.
- Optimize / reduce PDF file size.
- Encrypt PDF with a password OR zip multiple PDFs in one directory and encrypt that folder with a password.

Thanks for your feedback.

User avatar
JakeSFR
Posts: 260
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 135 times

Re: Tool to edit PDFs?

Post by JakeSFR »

- Merge multiple PDF files into one PDF.

pdfunite

'pdfunite --help' wrote:

Usage: pdfunite [options] <PDF-sourcefile-1>..<PDF-sourcefile-n> <PDF-destfile>

___________

- Optimize / reduce PDF file size.

qpdf

'qpdf --help' wrote:

--optimize-images compress images with DCT (JPEG) when advantageous

Also, with some PDFs, simply doing this:

Code: Select all

libreoffice --convert-to pdf:writer_pdf_Export --outdir output_directory input.pdf

can reduce their size significantly, but YMMV.
___________

- Encrypt PDF with a password

qpdf

'qpdf --help' wrote:

Encryption Options
------------------

--encrypt user-password owner-password key-length flags --

Note that -- terminates parsing of encryption flags.

Either or both of the user password and the owner password may be
empty strings.

key-length may be 40, 128, or 256
[...]

User Password prevents opening a PDF document, whereas Owner Password doesn't prevent opening, but can prevent printing, editing, etc.
___________

OR zip multiple PDFs in one directory and encrypt that folder with a password.

Right-click a directory -> PackIt

However, ZIP encryption is considered weak nowadays, so I'd recommend using 7zip instead.

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 88 times

Re: Tool to edit PDFs?

Post by user1234 »

I don't know about Fatdog specifically, but on Fossapup there is a KDE application named Okular, which not only allows you to edit PDFs but also allows you to open many different file formats which a lot of other applications don't allow you to. And the UI is great too, just like any other KDE application!

If you plan to install this and it is gonna be the first KDE application that you're going to install, then it may well take few hundreds of MBs of space to be installed. But if any other KDE application is already installed, then it will be taking up around 20-30MBs of space, I guess.

But I don't think it might be providing the features you have asked for.

PuppyLinux 🐾 gives new life to old computers ✨

Neo_78
Posts: 378
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Re: Tool to edit PDFs?

Post by Neo_78 »

Thanks @JakeSFR. The mentioned cli tools are exactly what I was looking for.

I am not sure if there are any alternative to 7zip for file encryption. 7zip seems to leave files unencrypted in temporary storage, which has been criticized:

https://sourceforge.net/p/sevenzip/bugs/1448/

Are there any encryption libraries that do not leave files in clear text in temporary storage?

User avatar
JakeSFR
Posts: 260
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 135 times

Re: Tool to edit PDFs?

Post by JakeSFR »

Neo_78 wrote: Wed Sep 21, 2022 10:18 pm

Thanks @JakeSFR. The mentioned cli tools are exactly what I was looking for.

Great!

I am not sure if there are any alternative to 7zip for file encryption. 7zip seems to leave files unencrypted in temporary storage, which has been criticized:

https://sourceforge.net/p/sevenzip/bugs/1448/

Are there any encryption libraries that do not leave files in clear text in temporary storage?

Sure, there are more encryption tools OOTB in FD, like bcrypt (also not considered secure anymore), ccrypt, scrypt, gpg, cryptsetup.

However, it looks like the criticism is about how the Windows' 7zip GUI works, not necessarily the CLI utility itself (or its Linux port - p7zip), let alone the encryption, which is a real problem in PKZIP.

But still, if you open a file in an encrypted archive using e.g. Engrampa, it has to be extracted somewhere (/tmp/.fr-random_chars in this case), so the corresponding application can read it.

For more secure approach, you might be better off with a LUKS or Veracrypt container.
But even then, when you mount that container and open some file in an application, the application itself can create a temporary/backup copy of it somewhere and fail to delete it after closing.
For example, LibreOffice Writer also uses the /tmp dir, where it puts a copy of the opened file and if you kill LO's processes, the file will remain there.

The difference is that a file in /tmp is in a RAM disk, so at least it won't survive the reboot, even if the application fails to delete it beforehand, whereas locations like C:\Users\<user>\AppData\Local\Temp\ are more durable.

I guess the bottom line is: if you have an encrypted e.g. 7zip archive, it is reasonably secure (no practical attacks available), until you open it and access the files, in which case other factors come into play.

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Neo_78
Posts: 378
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 206 times
Been thanked: 9 times

Re: Tool to edit PDFs?

Post by Neo_78 »

I guess encryption only makes sense for secure data storage and transmission @JakeSFR. As you mentioned, as soon as you decrypt the data locally and the data is available in clear text, security depends on the state of your local system and a potential compromise.

Is there a way in FatDog to encrypt /tmp in a RAM-only system? But I guess that would require decryption for every save and access operation, which would not be very practical... :roll:

Post Reply

Return to “Software”