Houston4444 / DoAllWithPDF

KDE service menu for PDF files
GNU General Public License v2.0
0 stars 0 forks source link

"Stamp" not working #1

Open corradomella opened 5 years ago

corradomella commented 5 years ago

In the version installed from the PPA, the "Stamp" function doesn't work. I fixed the bug in the past but then forgot to contribute back (sorry!), and now cannot remember what I did exactly. Off the top of my head was simply a typo in a variable in the code. On new, fresh installs the path to the file to use as a stamp remains empty. On mine, where I had it working on 16.04 before upgrading to 18.04 and losing all Dolphin ServiceMenus (THANKS, CANONICAL!), it keeps using the last file I used on 16.04. This should point you to the right spot, and solve the bug much faster than I could do. Cheers

Houston4444 commented 5 years ago

Stamp works on my Neon 18.04. But there is something mega annoying with Ubuntu 18.04: the disparition of the very useful pdftk package. Because I upgraded from 16.04 to 18.04, the 16.04 pdftk package is still here and works. Else, the solution is :

sudo add-apt-repository ppa:malteworld/ppa sudo apt update sudo apt install pdftk

Is it this your problem ?

corradomella commented 5 years ago

Hi,

Thanks for the quick response.

No, it's not a problem - I have already added the PPA and installed pdftk. I wouldn't have bothered opening and issue on GitHub if it was that simple.

As far as I can see and have used them, all other features work, and "Stamp" works too, but it's using the wrong stamp. I'll copy / paste the output of the "PDF Stamp" window below. That's what I do:

Input PDF Filenames & Passwords in Order ( [, ] ) /home/konrad/Business/ScotBBTel/Promotional materials/Yealink/Originals/T48GN_0002.pdf

The operation to be performed:

filter - Apply 'filters' to a single, input PDF based on output args. (When the operation is omitted, this is the default.)

The output file will be named: /home/konrad/Business/ScotBBTel/Promotional materials/Yealink/Originals/T48GN_0002 (stamp).pdf

Output PDF encryption settings: Output PDF will not be encrypted.

No compression or uncompression being performed on output. Creating Output ... Error: Failed to open stamp PDF file: /home/konrad/Business/ScotBBTel/Suppliers/Daisy/HV.Select User Manuals/Branded User Guides/HV.Select Branded Stamp (landscape).pdf No output created.


As you see, it's still trying to use **the non-existing file** preselected in the first pop-up as a stamp instead of **the file I navigated to and selected**.
You only encounter and can see this error because the file is not there and the window doesn't close automatically.
If the last stamp PDF file you used is still there, there will be no output errors and the window would close without errors, **but the stamped PDF file would still be using the old stamp**, not the one you chose.

Last time I had the time to debug the script and found the bug. Now I can't remember if it was a typo in a variable or some missing quotes around the function call that was leaving parameters behind.

The "Watermark" function - that I assume is very similar - works perfectly. It should be easy for you that know how the code flows to see where the difference between the two functions is.
Houston4444 commented 5 years ago

The "Watermark" function - that I assume is very similar - works perfectly.

As far I can remember, they are very very similar, yes. So I think that the trouble comes when file saved as last stamp/watermark doesn't exists. The config file is probably here: ~/.config/DoAllWithPDF/DoAllWithPDF.conf edit it and remove line starting with StampPath= .

then, try again.

I've got to look what is wrong with this dialog/code too, I'll take a look. Thanks for this detailed issue.

corradomella commented 5 years ago

Hi,

Nope. No luck. I've removed the parameter from the .conf file, gone through the same motions, and no stamp is applied. The "PDF Stamp" window just flashes by. The "StampPath" in the .conf file remains empty.

FOUND THE BUG My memory is still good!

You're welcome.

Houston4444 commented 5 years ago

oh yes you're right ! I am really surprised that python accepts accents in variables, didn't know. In all cases, it's not a good idea to use them for this. Here, for sure it is a typo. Thanks.