From c455b051034f2f64ca8fa8dda0fc19845f7c4b25 Mon Sep 17 00:00:00 2001 From: IFo Hancroft Date: Fri, 5 Feb 2021 19:13:56 +0200 Subject: [PATCH 1/5] Changed /usr/local/ to /usr/ to avoid the problems that come from using /usr/local/ --- install.sh | 4 ++-- uninstall.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 40dc2e7..d66d0ed 100755 --- a/install.sh +++ b/install.sh @@ -10,7 +10,7 @@ Installer="$(readlink -f "$0")" SourcePath="${Installer%/*}" -InstallPath="/usr/local" +InstallPath="/usr" BinPath="$InstallPath/bin" LauncherPath="$InstallPath/share/applications" IconPath="$InstallPath/share/icons/hicolor/scalable/apps" @@ -90,4 +90,4 @@ sudo cp -v "pdfmted-editor" "pdfmted-inspector" "pdfmted-thumbnailer" "${BinPath sudo cp -v "desktop/pdfmted-editor.desktop" "desktop/pdfmted-inspector.desktop" "${LauncherPath}/" sudo cp -v "desktop/pdfmted.svg" "${IconPath}/" -echo "Done." \ No newline at end of file +echo "Done." diff --git a/uninstall.sh b/uninstall.sh index f9cd23c..9e3941d 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -7,7 +7,7 @@ # Variables -InstallPath="/usr/local" +InstallPath="/usr" BinPath="$InstallPath/bin" LauncherPath="$InstallPath/share/applications" IconPath="$InstallPath/share/icons/hicolor/scalable/apps" @@ -39,4 +39,4 @@ echo "Uninstalling $Application ..." [[ -f "$LauncherPath/pdfmted-inspector.desktop" ]] && sudo rm -v "$LauncherPath/pdfmted-inspector.desktop" [[ -f "$IconPath/pdfmted.svg" ]] && sudo rm -v "$IconPath/pdfmted.svg" -echo "Done." \ No newline at end of file +echo "Done." From 97b2dc88d10395eff940398da3ad3dd8b8761571 Mon Sep 17 00:00:00 2001 From: IFo Hancroft Date: Thu, 9 Sep 2021 19:57:29 +0300 Subject: [PATCH 2/5] Added Publisher field --- pdfmted-editor | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pdfmted-editor b/pdfmted-editor index bdaeb43..6182d82 100755 --- a/pdfmted-editor +++ b/pdfmted-editor @@ -351,6 +351,7 @@ gui_metadata_entry_multi(){ --field="Year:":NUM "$YEAR_ORIGINAL[!0..3000[!1]]" \ --field="Keywords:" "$KEYWORDS_ORIGINAL" \ --field="Subject:" "$SUBJECT_ORIGINAL" \ + --field="Publisher:" "$PUBLISHER_ORIGINAL" \ --field "$TEXT_BTTN_CLRALL!gtk-clear!$TEXT_HOVR_CLRALL":FBTN \ "@bash -c gui_clear_fields" \ --field="":LBL "" \ @@ -459,6 +460,7 @@ duplicate_metadata () { TITLE_ORIGINAL="$TITLE" YEAR_ORIGINAL="$YEAR" SUBJECT_ORIGINAL="$SUBJECT" + PUBLISHER_ORIGINAL="$PUBLISHER" KEYWORDS_ORIGINAL="$KEYWORDS" } @@ -470,9 +472,10 @@ process_yad_formchoices(){ YEAR="$(echo "$NEW_METADATA" | cut -d '|' -f6 | cut -d ',' -f1 | cut -d '.' -f1)" KEYWORDS="$(echo "$NEW_METADATA" | cut -d '|' -f7)" SUBJECT="$(echo "$NEW_METADATA" | cut -d '|' -f8)" - SAVECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f14)" - RENAMECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f15)" - DUPLICATECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f16)" + PUBLISHER="$(echo "$NEW_METADATA" | cut -d '|' -f9)" + SAVECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f15)" + RENAMECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f16)" + DUPLICATECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f17)" MODIFYDATE="$(date +"%Y:%m:%d %H:%M:%S")" if [[ "$YEAR" = "0" ]]; then CREATEDATE="" @@ -485,7 +488,7 @@ process_yad_formchoices(){ read_metadata() { echo "#Reading embedded metadata..." - exiftool -e -S -PDF:Title -PDF:Author -PDF:Subject \ + exiftool -e -S -PDF:Title -PDF:Author -PDF:Subject -PDF:Producer \ -PDF:Keywords -PDF:CreateDate -PDF:ModifyDate \ "$FILE" > "$PROGPIPE" } @@ -498,7 +501,8 @@ print_original_metadata() { echo "Year: $YEAR_ORIGINAL" echo "Creation date: $CREATEDATE_ORIGINAL" echo "Modification date: $MODIFYDATE_ORIGINAL" - echo "Subject: $SUBJECT_ORIGINAL" + echo "Subject: $SUBJECT_ORIGINAL" + echo "Publisher: $PUBLISHER_ORIGINAL" echo "Keywords: $KEYWORDS_ORIGINAL" } @@ -510,6 +514,7 @@ evaluate_original_metadata() { YEAR_ORIGINAL="${CREATEDATE_ORIGINAL:0:4}" MODIFYDATE_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/ModifyDate: //p')" SUBJECT_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Subject: //p')" + PUBLISHER_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Producer: //p')" KEYWORDS_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Keywords: //p')" } @@ -524,9 +529,9 @@ write_metadata(){ echo "#Writing new metadata" exiftool -e -overwrite_original -password "$PASSWORD" -sep ";" \ -PDF:Title="$TITLE" -PDF:Author="$AUTHOR" \ - -PDF:Subject="$SUBJECT" -PDF:Keywords="$KEYWORDS" \ + -PDF:Subject="$SUBJECT" -PDF:Producer="$PUBLISHER" -PDF:Keywords="$KEYWORDS" \ -PDF:ModifyDate="$MODIFYDATE" -PDF:CreateDate="$CREATEDATE" \ - -XMP-dc:Subject="$KEYWORDS" -XMP-dc:Description="$SUBJECT" -XMP-dc:Title="$TITLE" \ + -XMP-dc:Subject="$KEYWORDS" -XMP-dc:Publisher="$PUBLISHER" -XMP-dc:Description="$SUBJECT" -XMP-dc:Title="$TITLE" \ -XMP-dc:Creator="$AUTHOR" -XMP-dc:Date="$CREATEDATE" \ "$FILE" echo "$?" > "$ERRORPIPE1" @@ -547,6 +552,7 @@ print_updated_metadata() { echo "Creation date: $CREATEDATE" echo "Modificaiton date: $MODIFYDATE" echo "Subject: $SUBJECT" + echo "Publisher: $PUBLISHER" echo "Keywords: $KEYWORDS" } @@ -739,4 +745,4 @@ arg_compose_filearray "${FILEARGS[@]}" ################ MAIN #################### -main \ No newline at end of file +main From 3464b263a73b757f7a27064a5e2aabd0719ca7f5 Mon Sep 17 00:00:00 2001 From: IFo Hancroft Date: Thu, 9 Sep 2021 20:04:56 +0300 Subject: [PATCH 3/5] Reverted moving /usr/local to /usr --- install.sh | 2 +- uninstall.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index d66d0ed..e477757 100755 --- a/install.sh +++ b/install.sh @@ -10,7 +10,7 @@ Installer="$(readlink -f "$0")" SourcePath="${Installer%/*}" -InstallPath="/usr" +InstallPath="/usr/local" BinPath="$InstallPath/bin" LauncherPath="$InstallPath/share/applications" IconPath="$InstallPath/share/icons/hicolor/scalable/apps" diff --git a/uninstall.sh b/uninstall.sh index 9e3941d..1b8f627 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -7,7 +7,7 @@ # Variables -InstallPath="/usr" +InstallPath="/usr/local" BinPath="$InstallPath/bin" LauncherPath="$InstallPath/share/applications" IconPath="$InstallPath/share/icons/hicolor/scalable/apps" From 8035be19e17ee8b450f57d4219cd68d8b6424ac1 Mon Sep 17 00:00:00 2001 From: IFo Hancroft Date: Sat, 11 Sep 2021 00:00:22 +0300 Subject: [PATCH 4/5] Included the changes from my other PR as well Added: mkdir -p "$BinPath" mkdir -p "$LauncherPath" mkdir -p "$IconPath" to install.sh --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index 77aa2aa..399fd18 100755 --- a/install.sh +++ b/install.sh @@ -15,6 +15,10 @@ BinPath="$InstallPath/bin" LauncherPath="$InstallPath/share/applications" IconPath="$InstallPath/share/icons/hicolor/scalable/apps" +mkdir -p "$BinPath" +mkdir -p "$LauncherPath" +mkdir -p "$IconPath" + Application="PDFMtEd" InstallationFiles=("desktop/pdfmted-editor.desktop" "desktop/pdfmted-inspector.desktop"\ "desktop/pdfmted.svg" "pdfmted-editor" "pdfmted-inspector" "pdfmted-thumbnailer") From 6d4ecfd4ce1873d39da58700676f7bc3372d3cca Mon Sep 17 00:00:00 2001 From: IFo Hancroft Date: Wed, 6 Apr 2022 19:16:23 +0300 Subject: [PATCH 5/5] Added the new ui field to the UI field table in the README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d24214d..94f8925 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ To avert confusion and ensure consistency across different PDF handlers it is im | Year | CreateDate | Date | | Keywords | Keywords | Subject | | Subject | Subject | Description | +| Publisher | Producer | Publisher | ### Purging metadata