Skip to content
Commits on Source (7)
PDFsam (PDF Split And Merge)
==============================
Official SCM repository for PDFsam Basic, a free and open source, multi-platform software designed to split, merge and rotate PDF files.
Official SCM repository for PDFsam Basic, a free and open source, multi-platform software designed to extract pages, split, merge, mix and rotate PDF files.
[![Build Status](https://travis-ci.org/torakiki/pdfsam.png)](https://travis-ci.org/torakiki/pdfsam)
[![License](http://img.shields.io/badge/license-AGPLv3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Join the chat at https://gitter.im/PDFsam/Lobby](https://badges.gitter.im/PDFsam/Lobby.svg)](https://gitter.im/PDFsam/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Where
-------------------
Official website [pdfsam.org](http://pdfsam.org/ "PDFsam")
Official website [pdfsam.org](https://pdfsam.org/ "PDFsam")
License
-------------------
PDFsam Version 3 is open source under the [GNU Affero General Public License] v3, previous versions are released under GPLv2.
PDFsam Basic is open source under the [GNU Affero General Public License] since version 3, previous versions are released under GPLv2.
Requirements
-------------------
PDFsam Basic is written using the JavaFX and requires a Java Runtime Environment 8 (or above) with JavaFx to run
PDFsam Basic is written using the JavaFX. Version 4 is released as a self-contained application and includes a jlinked OpenJDK 11 runtime while version 3 requires a Java Runtime Environment 8 with JavaFx installed in order to run.
Documentation
-------------------
Some [documentation](http://www.pdfsam.org/documentation/) and [FAQ](http://www.pdfsam.org/faq/)
Some [documentation](https://pdfsam.org/documentation/) and [FAQ](https://pdfsam.org/faq/)
Build
-------------------
......
version: '{build}'
environment:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
install:
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
......@@ -8,7 +6,8 @@ install:
(new-object System.Net.WebClient).DownloadFile('https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.19.8.1-v1.14/gettext0.19.8.1-iconv1.14-shared-64.zip', 'C:\gettext-bin.zip')
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\gettext-bin.zip", "C:\gettext")
}
- cmd: SET PATH=C:\gettext\bin;%PATH%
- cmd: SET JAVA_HOME=C:\Program Files\Java\jdk11
- cmd: SET PATH=C:\gettext\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-Xmx2g
- cmd: SET JAVA_OPTS=-Xmx2g
- cmd: mvn --version
......
pdfsam (4.0.1-1) unstable; urgency=medium
* New upstream version 4.0.1
* Declare compliance with Debian Policy 4.3.0.
* Use canonical VCS URI.
-- Markus Koschany <apo@debian.org> Sat, 12 Jan 2019 21:28:05 +0100
pdfsam (4.0.0-1) unstable; urgency=medium
* New upstream version 4.0.0.
......
......@@ -28,9 +28,9 @@ Build-Depends:
libslf4j-java (>= 1.7.21),
maven-debian-helper,
openjfx (>= 11)
Standards-Version: 4.2.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/pdfsam.git
Vcs-Browser: https://anonscm.debian.org/git/pkg-java/pdfsam.git
Standards-Version: 4.3.0
Vcs-Git: https://salsa.debian.org/java-team/pdfsam.git
Vcs-Browser: https://salsa.debian.org/java-team/pdfsam
Homepage: http://www.pdfsam.org
Package: pdfsam
......
......@@ -5,14 +5,14 @@ Files-Excluded:
*.dll
Files: *
Copyright: 2017-2018, Andrea Vacondio <andrea.vacondio@gmail.com>
Copyright: 2017-2019, Andrea Vacondio <andrea.vacondio@gmail.com>
Sober Lemur S.a.s di Vacondio Andrea <info@pdfsam.org>
License: AGPL-3+
Files: debian/*
Copyright: 2008-2010, Torsten Werner <twerner@debian.org>
2012, Miguel Landaeta <miguel@miguel.cc>
2017-2018, Markus Koschany <apo@debian.org>
2017-2019, Markus Koschany <apo@debian.org>
License: AGPL-3+
License: AGPL-3+
......
......@@ -6,35 +6,21 @@ Customize the start script for Debian.
Forwarded: not-needed
---
pdfsam-basic/src/assembly/resources/bin/pdfsam.sh | 33 +++++------------------
1 file changed, 6 insertions(+), 27 deletions(-)
pdfsam-basic/src/assembly/resources/bin/pdfsam.sh | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/pdfsam-basic/src/assembly/resources/bin/pdfsam.sh b/pdfsam-basic/src/assembly/resources/bin/pdfsam.sh
index af6182e..38b1678 100644
index 4e9e84b..17ebb63 100644
--- a/pdfsam-basic/src/assembly/resources/bin/pdfsam.sh
+++ b/pdfsam-basic/src/assembly/resources/bin/pdfsam.sh
@@ -16,32 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -30,17 +30,7 @@ while [ -h "$PRG" ]; do
done
-# resolve links - $0 may be a softlink
-PRG="$0"
-
-while [ -h "$PRG" ]; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`/"$link"
- fi
-done
-
-PRGDIR=`dirname "$PRG"`
PRGDIR=`dirname "$PRG"`
-BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd`
-RUNTIME="$BASEDIR"/runtime
-
-if [ -z "$PDFSAM_JAVA_PATH" ]; then
-if [ ! -d "$PDFSAM_JAVA_PATH" ]; then
- # the rutime is supplied
- if [ -d "$RUNTIME" ]; then
- JAVA_HOME="$RUNTIME"
......@@ -42,12 +28,11 @@ index af6182e..38b1678 100644
-else
- JAVA_HOME="$PDFSAM_JAVA_PATH"
-fi
+BASEDIR=/usr/share/pdfsam
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
@@ -95,7 +71,7 @@ if [ ! -x "$JAVACMD" ] ; then
@@ -95,7 +85,7 @@ if [ ! -x "$JAVACMD" ] ; then
exit 1
fi
......@@ -56,7 +41,7 @@ index af6182e..38b1678 100644
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -103,11 +79,14 @@ if $cygwin; then
@@ -103,11 +93,14 @@ if $cygwin; then
[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
fi
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -64,7 +64,7 @@ for %%i in ("%~dp0..") do set "BASEDIR=%%~fi"
:repoSetup
set "RUNTIME=%BASEDIR%\runtime"
if DEFINED PDFSAM_JAVA_PATH (
if exist "%PDFSAM_JAVA_PATH%" (
set "JAVACMD=%PDFSAM_JAVA_PATH%\bin\java"
) else (
if exist "%RUNTIME%" (
......
......@@ -33,7 +33,7 @@ PRGDIR=`dirname "$PRG"`
BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd`
RUNTIME="$BASEDIR"/runtime
if [ -z "$PDFSAM_JAVA_PATH" ]; then
if [ ! -d "$PDFSAM_JAVA_PATH" ]; then
# the rutime is supplied
if [ -d "$RUNTIME" ]; then
JAVA_HOME="$RUNTIME"
......
......@@ -17,7 +17,7 @@ if %ERRORLEVEL% NEQ 0 goto error
ECHO "Files harvested"
REM Build the MSI
"%WIX%bin\candle.exe" pdfsam.wxs featuresTree.wxs verifyWithLanguageDlg.wxs exitDlg.wxs harvestedFiles.wxs -ext WixUIExtension -ext WixUtilExtension -ext WixNetFxExtension
"%WIX%bin\candle.exe" pdfsam.wxs featuresTree.wxs verifyWithLanguageDlg.wxs exitDlg.wxs harvestedFiles.wxs -ext WixUIExtension -ext WixUtilExtension -ext WixNetFxExtension -arch x64
if %ERRORLEVEL% NEQ 0 goto error
ECHO "candle run ok"
......@@ -33,7 +33,7 @@ del /Q verifyWithLanguageDlg.wixobj
del /Q exitDlg.wixobj
del /Q harvestedFiles.wixobj
IF EXIST "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi" "signtool.exe" sign /t http://timestamp.verisign.com/scripts/timstamp.dll /a /d "PDFsam Basic" "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi"
IF EXIST "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi" "signtool.exe" sign /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /a /d "PDFsam Basic" "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi"
if %ERRORLEVEL% NEQ 0 goto error
ECHO "MSI signed"
POPD
......
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<?include $(sys.CURRENTDIR)pdfsamVariables.wxi ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)" Manufacturer="$(var.ProductManufacturer)" UpgradeCode="$(var.ProductUpgradeCode)">
<Package Description="!(loc.ProductDescription)" Comments="!(loc.ProductComments)" InstallerVersion="200" InstallPrivileges="elevated" Compressed="yes" Id="*" />
<Media Id="1" Cabinet="$(var.ProductCodeName).cab" EmbedCab="yes" />
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -66,7 +66,6 @@
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>${javafx.version}</version>
<scope>test</scope>
</dependency>
......
/*
* This file is part of the PDF Split And Merge source code
* Created on 2 gen 2019
* Copyright 2017 by Sober Lemur S.a.s di Vacondio Andrea (info@pdfsam.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.pdfsam.support;
import static java.util.Objects.nonNull;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Andrea Vacondio
*
*/
public final class EncryptionUtils {
private final static Logger LOG = LoggerFactory.getLogger(EncryptionUtils.class);
public static final String T_KEY = "j!$CEnv#8G6_61gSYpt%0H%CVXhxDv-E8UHOHQyDIz%OFPE%YsaCoNH&+^d1G_ZevL!8MAEiQ+dERnvl_4grOQMmDQ2vhn_55FXDbLNMfs!U|$y7iA|dXef3dmf*&KOa";
private EncryptionUtils() {
// hide
}
/**
* @param value
* @return the encrypted version of value or null if value is null
*/
public static String encrypt(String value) {
try {
if (nonNull(value)) {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE,
new SecretKeySpec(Arrays.copyOf(T_KEY.getBytes(StandardCharsets.UTF_8), 16), "AES"));
return Base64.getEncoder().encodeToString(cipher.doFinal(value.getBytes(StandardCharsets.UTF_8)));
}
} catch (GeneralSecurityException e) {
LOG.error("An error occurred while encrypting a string", e);
}
return null;
}
/**
* @param value
* @return the decrypted version of value of null if value is null
*/
public static String decrypt(String value) {
try {
if (nonNull(value)) {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE,
new SecretKeySpec(Arrays.copyOf(T_KEY.getBytes(StandardCharsets.UTF_8), 16), "AES"));
return new String(cipher.doFinal(Base64.getDecoder().decode(value)), StandardCharsets.UTF_8);
}
} catch (GeneralSecurityException e) {
LOG.error("An error occurred while decrypting a string", e);
}
return null;
}
}
/*
* This file is part of the PDF Split And Merge source code
* Created on 2 gen 2019
* Copyright 2017 by Sober Lemur S.a.s di Vacondio Andrea (info@pdfsam.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.pdfsam.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.junit.Test;
/**
* @author Andrea Vacondio
*
*/
public class EncryptionUtilsTest {
private static final String TEST = "Chuck Norris";
private static final String ENC = "vID7Tz17JKkHsEm2Vf1S1Q==";
@Test
public void testEncrypt() {
assertEquals(ENC, EncryptionUtils.encrypt(TEST));
}
@Test
public void testDecrypt() {
assertEquals(TEST, EncryptionUtils.decrypt(ENC));
}
@Test
public void nullInput() {
assertNull(EncryptionUtils.decrypt(null));
assertNull(EncryptionUtils.encrypt(null));
}
}
......@@ -5,7 +5,7 @@
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -57,10 +57,10 @@ public enum FileColumn implements SelectionTableColumn<File> {
@Override
public Callback<TableColumn<SelectionTableRowData, File>, TableCell<SelectionTableRowData, File>> cellFactory() {
return new Callback<TableColumn<SelectionTableRowData, File>, TableCell<SelectionTableRowData, File>>() {
return new Callback<>() {
@Override
public TableCell<SelectionTableRowData, File> call(TableColumn<SelectionTableRowData, File> param) {
return new TableCell<SelectionTableRowData, File>() {
return new TableCell<>() {
@Override
public void updateItem(final File item, boolean empty) {
super.updateItem(item, empty);
......
......@@ -77,7 +77,7 @@ public class LoadingColumn implements SelectionTableColumn<PdfDescriptorLoadingS
@Override
public Callback<TableColumn<SelectionTableRowData, PdfDescriptorLoadingStatus>, TableCell<SelectionTableRowData, PdfDescriptorLoadingStatus>> cellFactory() {
return new Callback<TableColumn<SelectionTableRowData, PdfDescriptorLoadingStatus>, TableCell<SelectionTableRowData, PdfDescriptorLoadingStatus>>() {
return new Callback<>() {
@Override
public TableCell<SelectionTableRowData, PdfDescriptorLoadingStatus> call(
TableColumn<SelectionTableRowData, PdfDescriptorLoadingStatus> param) {
......