Custom action on right click: Convert pdf to png
[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
If the pdf has multiple pages, you will have multiple png files.
-----------
Let me explain this just in case you want to modify itExec=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"
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"
0 Comments:
Post a Comment
<< Home