Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new pdf-rotate action #548

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pdf-rotate@goebbe/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

Version 0.1 2024/10/23

- Initial release

43 changes: 43 additions & 0 deletions pdf-rotate@goebbe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ROTATE PDF(s)
=============

Rotate PDF(s) clockwise by 90 degrees.

DESCRIPTION
-----------

This action simply rotates the selected PDF file(s) clockwise by 90 degrees.

It is intentionally kept simple for quick usage.


INSTALLATION
------------

First, use the software manager to verify that the package `qpdf` is installed on your computer.

The easiest way to install the nemo action is via "Menu > System Settings > Actions":

1. Download: In Actions, go to "Download" > "Refresh" the availabe actions > select the action > press the download button
2. Enable: In Actions, go to "Manage" > select the action > press the "+" button to enable the action
3. Restart the nemo file-manager


USAGE
------------

- Make sure the nemo action is installed and enabled.
- Select one or more PDF files.
- Right click on the selected files and choose "Rotate PDF(s)".
- The right click menu entry is only visible if the selected file(s) are actually PDF(s).


DEPENDENCIES
------------

The following programs must be installed and available:

* `qpdf` for PDF processing

On Debian based Linux Distributions, to install the package qpdf, in the terminal, type:
sudo apt install qpdf
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions pdf-rotate@goebbe/files/pdf-rotate@goebbe/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions pdf-rotate@goebbe/files/pdf-rotate@goebbe/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"description": "Rotate PDF(s) clockwise by 90 degrees",
"uuid": "pdf-rotate@goebbe",
"name": "Rotate PDF(s)",
"author": "goebbe",
"version": "0.1"
}
21 changes: 21 additions & 0 deletions pdf-rotate@goebbe/files/pdf-rotate@goebbe/pdf-rotate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#
# turn-pdf.sh
#
# Rotate the selected pdf-file(s) 90 degrees clockwise from the right-click context menu in Nemo file manager.
#
# Place this action in ~/.local/share/nemo/actions/...
# This file has to be executable, check the permisions.
# Restart Nemo once.
# INSTALL qpdf first:
# sudo apt install qpdf
#
# Usage: select pdf-files, right click, Rotate PDF(s)

echo "$@" | while read -r file
do
qpdf "$file" --replace-input --rotate=+90
done

exit 0

28 changes: 28 additions & 0 deletions pdf-rotate@goebbe/files/pdf-rotate@goebbe/po/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ROTATE PDF(S)
# This file is put in the public domain.
# goebbe, 2024
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pdf-rotate@goebbe 0.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-actions/"
"issues\n"
"POT-Creation-Date: 2024-11-13 04:30-0500\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. metadata.json->description
#. [email protected]_action.in->Comment
msgid "Rotate PDF(s) clockwise by 90 degrees"
msgstr ""

#. metadata.json->name
#. [email protected]_action.in->Name
msgid "Rotate PDF(s)"
msgstr ""
3 changes: 3 additions & 0 deletions pdf-rotate@goebbe/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"author": "goebbe"
}
15 changes: 15 additions & 0 deletions pdf-rotate@goebbe/[email protected]_action.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Nemo Action]

_Name=Rotate PDF(s)
_Comment=Rotate PDF(s) clockwise by 90 degrees
Icon-Name=object-rotate-right-symbolic
Exec=<pdf-rotate@goebbe/pdf-rotate.sh %F>

# propose action only for pdf-files:
Mimetypes=application/pdf;
# get one filepath per line:
Separator="\n"
# at least one file has to be selected:
Selection=notnone
# qpdf has to be installed on the system:
Dependencies=qpdf;