22 August 2013

Custom action on right click: Convert pdf to png


This is for Linux / KDE

Sometimes I need to convert a pdf to png (1 or more pages). There is a simple command that does that, but I'd like it to be simpler.


Well, the trick is:

1. Copy the text below in a text file


[Desktop Entry]
Type=Service
ServiceTypes=application/pdf
Actions=Convert_PDF_to_PNG

[Desktop Action Convert_PDF_to_PNG]
Name=Convert_PDF_to_PNG
Exec=convert -density 300 %u %d/`basename %u .pdf`.png
Icon=kfm



2. Save it as  ~/.kde/share/apps/konqueror/servicemenus/pdf_to_png.desktop


Now, if you right click over a pdf, in Actions you should see your script.

If the pdf has multiple pages, you will have multiple png files.

-----------

Let me explain this just in case you want to modify it

Exec=convert -density 300 %u %d/`basename %u .pdf`.png

The command is  "convert -density 300  in.pdf  out.png"
%u is the URL  to the selected file
%d is the location of the file
with `basename %u .pdf`.png     I get the /path/to/in.pdf to  just   "in"  and then add ".png", otherwise the png files would be named   "in.pdf.png"
  

17 August 2013

Forcing firefox to remember password


It happens sometimes that Firefox get messed up with so many stored information in a particular site that it won't remember or ask to remember the password.

I just found a solution, a bookmarklet that will force Firefox to offer you to remember the password.

http://kb.mozillazine.org/User_name_and_password_not_remembered#Using_a_bookmarklet

It says that it works even on sites that explicitly don't want the browser to offer to remember the password. I still have to see if that works well.
Too Cool for Internet Explorer