diff --git a/pom.xml b/pom.xml index 078855ac..7aafd310 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 2.2.0 3.7 78.2 - 9.5.0 + 9.6.0 2.21.1 1.5.25 diff --git a/src/main/java/com/itextpdf/rups/io/encoders/ASCII85CompressionStrategy.java b/src/main/java/com/itextpdf/rups/io/encoders/ASCII85CompressionStrategy.java deleted file mode 100644 index d30afa35..00000000 --- a/src/main/java/com/itextpdf/rups/io/encoders/ASCII85CompressionStrategy.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.kernel.pdf.IStreamCompressionStrategy; -import com.itextpdf.kernel.pdf.PdfName; -import com.itextpdf.kernel.pdf.PdfObject; -import com.itextpdf.kernel.pdf.PdfStream; - -import java.io.OutputStream; - -/** - * A compression strategy that uses the {@code ASCII85Decode} filter for PDF - * streams. - * - *

- * This strategy implements the {@link IStreamCompressionStrategy} interface - * and provides {@code ASCII85Decode} encoding. - * - *

- * The strategy ensures, that streams are saved using just 7-bit ASCII - * characters, but it typically increases sizes of streams by 25% compared to - * just saving them as-is. So calling this a "compression strategy" is a - * misnomer. - */ -public class ASCII85CompressionStrategy implements IStreamCompressionStrategy { - /** - * Constructs a new {@link ASCII85CompressionStrategy} instance. - */ - public ASCII85CompressionStrategy() { - // empty constructor - } - - /** - * Returns the name of the compression filter. - * - * @return {@link PdfName#ASCII85Decode} representing the {@code ASCII85Decode} filter - */ - @Override - public PdfName getFilterName() { - return PdfName.ASCII85Decode; - } - - /** - * Returns the decode parameters for the {@code ASCII85Decode} filter. - *

- * This implementation returns {@code null} as no special decode parameters - * are required for standard ASCII85 compression. - * - * @return {@code null} as no decode parameters are needed - */ - @Override - public PdfObject getDecodeParams() { - return null; - } - - /** - * Creates a new output stream with ASCII85 compression applied. - *

- * This method wraps the original output stream in a {@link ASCII85OutputStream} - * that applies ASCII85 compression. - * - * @param original the original output stream to wrap - * @param stream the PDF stream containing compression configuration - * - * @return a new {@link ASCII85OutputStream} that compresses data using the ASCII85 algorithm - */ - @Override - public OutputStream createNewOutputStream(OutputStream original, PdfStream stream) { - return new ASCII85OutputStream(original); - } -} diff --git a/src/main/java/com/itextpdf/rups/io/encoders/ASCII85OutputStream.java b/src/main/java/com/itextpdf/rups/io/encoders/ASCII85OutputStream.java deleted file mode 100644 index 63b556ba..00000000 --- a/src/main/java/com/itextpdf/rups/io/encoders/ASCII85OutputStream.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.io.source.IFinishable; - -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * An output stream that encodes data according to the {@code ASCII85Decode} - * filter from the PDF specification. - */ -public class ASCII85OutputStream extends FilterOutputStream implements IFinishable { - private static final int BASE = 85; - /** - * Offset to the first base-85 output char. - */ - private static final int OFFSET = 33; - /** - * Size of the encoding block. After this amount of bytes data is converted - * and flush to the backing stream. - */ - private static final int INPUT_LENGTH = 4; - /** - * Amount of bytes produced from a block of input bytes. - */ - private static final int OUTPUT_LENGTH = 5; - /** - * Marker written, when all input bytes are zero. Not used for partial - * blocks. - */ - private static final byte ALL_ZEROS_MARKER = 'z'; - /** - * End Of Data marker. - */ - private static final byte[] EOD = new byte[]{'~', '>'}; - - /** - * Encoding block buffer. Reused for encoding output, when flushing. - */ - private final byte[] buffer = new byte[OUTPUT_LENGTH]; - /** - * Bitwise OR of all bytes within the encoding block. Used to quickly - * check, whether the encoding block contains only zeros. - */ - private int inputOr = 0; - /** - * Input bytes cursor within the buffer. - */ - private int inputCursor = 0; - - /** - * Flag for detecting, whether {@link #finish} has been called. - */ - private final AtomicBoolean finished = new AtomicBoolean(false); - - /** - * Creates a new {@code ASCIIHexDecode} encoding stream. - * - * @param out the output stream to write encoded data to - */ - public ASCII85OutputStream(OutputStream out) { - super(out); - } - - /** - * {@inheritDoc} - */ - @Override - public void write(int b) throws IOException { - int value = b & 0xFF; - buffer[inputCursor] = (byte) value; - inputOr |= value; - ++inputCursor; - writeBufferIfFull(); - } - - /** - * {@inheritDoc} - */ - @Override - public void close() throws IOException { - finish(); - super.close(); - } - - /** - * {@inheritDoc} - */ - @Override - public void finish() throws IOException { - if (finished.getAndSet(true)) { - return; - } - // Writing the remainder - if (inputCursor > 0) { - if (inputOr == 0) { - // If all zeros, output is just n + 1 exclamation points - Arrays.fill(buffer, 0, inputCursor + 1, (byte) '!'); - } else { - Arrays.fill(buffer, inputCursor, INPUT_LENGTH, (byte) 0); - convertBuffer(); - } - out.write(buffer, 0, inputCursor + 1); - resetBuffer(); - } - out.write(EOD); - flush(); - } - - private void writeBufferIfFull() throws IOException { - if (inputCursor < INPUT_LENGTH) { - return; - } - if (inputOr == 0) { - // Special case, if all zeros - out.write(ALL_ZEROS_MARKER); - } else { - convertBuffer(); - out.write(buffer); - } - resetBuffer(); - } - - private void resetBuffer() { - inputOr = 0; - inputCursor = 0; - } - - private void convertBuffer() { - long num = ((buffer[0] & 0xFFL) << 24) - | ((buffer[1] & 0xFFL) << 16) - | ((buffer[2] & 0xFFL) << 8) - | (buffer[3] & 0xFFL); - for (int i = OUTPUT_LENGTH - 1; i >= 0; --i) { - buffer[i] = (byte) (OFFSET + (num % BASE)); - num /= BASE; - } - } -} diff --git a/src/main/java/com/itextpdf/rups/io/encoders/ASCIIHexCompressionStrategy.java b/src/main/java/com/itextpdf/rups/io/encoders/ASCIIHexCompressionStrategy.java deleted file mode 100644 index 8a1cb822..00000000 --- a/src/main/java/com/itextpdf/rups/io/encoders/ASCIIHexCompressionStrategy.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.kernel.pdf.IStreamCompressionStrategy; -import com.itextpdf.kernel.pdf.PdfName; -import com.itextpdf.kernel.pdf.PdfObject; -import com.itextpdf.kernel.pdf.PdfStream; - -import java.io.OutputStream; - -/** - * A compression strategy that uses the {@code ASCIIHexDecode} filter for PDF - * streams. - * - *

- * This strategy implements the {@link IStreamCompressionStrategy} interface - * and provides {@code ASCIIHexDecode} encoding. - * - *

- * The strategy ensures, that streams are saved using just 7-bit ASCII - * characters, but it doubles the sizes of streams compared to just saving - * them as-is. So calling this a "compression strategy" is a misnomer. - */ -public class ASCIIHexCompressionStrategy implements IStreamCompressionStrategy { - /** - * Constructs a new {@link ASCIIHexCompressionStrategy} instance. - */ - public ASCIIHexCompressionStrategy() { - // empty constructor - } - - /** - * Returns the name of the compression filter. - * - * @return {@link PdfName#ASCIIHexDecode} representing the {@code ASCIIHexDecode} filter - */ - @Override - public PdfName getFilterName() { - return PdfName.ASCIIHexDecode; - } - - /** - * Returns the decode parameters for the {@code ASCIIHexDecode} filter. - *

- * This implementation returns {@code null} as no special decode parameters - * are required for standard ASCIIHex compression. - * - * @return {@code null} as no decode parameters are needed - */ - @Override - public PdfObject getDecodeParams() { - return null; - } - - /** - * Creates a new output stream with ASCIIHex compression applied. - *

- * This method wraps the original output stream in a {@link ASCIIHexOutputStream} - * that applies ASCIIHex compression. - * - * @param original the original output stream to wrap - * @param stream the PDF stream containing compression configuration - * - * @return a new {@link ASCIIHexOutputStream} that compresses data using the ASCIIHex algorithm - */ - @Override - public OutputStream createNewOutputStream(OutputStream original, PdfStream stream) { - return new ASCIIHexOutputStream(original); - } -} diff --git a/src/main/java/com/itextpdf/rups/io/encoders/ASCIIHexOutputStream.java b/src/main/java/com/itextpdf/rups/io/encoders/ASCIIHexOutputStream.java deleted file mode 100644 index bf9838df..00000000 --- a/src/main/java/com/itextpdf/rups/io/encoders/ASCIIHexOutputStream.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.io.source.IFinishable; - -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * An output stream that encodes data according to the {@code ASCIIHexDecode} - * filter from the PDF specification. - */ -public class ASCIIHexOutputStream extends FilterOutputStream implements IFinishable { - /** - * End Of Data marker. - */ - private static final byte EOD = '>'; - /** - * Array for mapping nibble values to the corresponding lowercase - * hexadecimal characters. - */ - private static final byte[] CHAR_MAP = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' - }; - - /** - * Buffer for storing the output hex char pair. - */ - private final byte[] buffer = new byte[2]; - - /** - * Flag for detecting, whether {@link #finish} has been called. - */ - private final AtomicBoolean finished = new AtomicBoolean(false); - - /** - * Creates a new {@code ASCIIHexDecode} encoding stream. - * - * @param out the output stream to write encoded data to - */ - public ASCIIHexOutputStream(OutputStream out) { - super(out); - } - - /** - * {@inheritDoc} - */ - @Override - public void write(int b) throws IOException { - int value = (b & 0xFF); - // Writing via a 2-elem buffer, in case `write(byte[])` on the - // underlying stream is more performant - buffer[0] = CHAR_MAP[value >> 4]; - buffer[1] = CHAR_MAP[value & 0x0F]; - out.write(buffer); - } - - /** - * {@inheritDoc} - */ - @Override - public void close() throws IOException { - finish(); - super.close(); - } - - /** - * {@inheritDoc} - */ - @Override - public void finish() throws IOException { - if (finished.getAndSet(true)) { - return; - } - out.write(EOD); - flush(); - } -} diff --git a/src/main/java/com/itextpdf/rups/io/encoders/RunLengthCompressionStrategy.java b/src/main/java/com/itextpdf/rups/io/encoders/RunLengthCompressionStrategy.java deleted file mode 100644 index a31e6e2d..00000000 --- a/src/main/java/com/itextpdf/rups/io/encoders/RunLengthCompressionStrategy.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.kernel.pdf.IStreamCompressionStrategy; -import com.itextpdf.kernel.pdf.PdfName; -import com.itextpdf.kernel.pdf.PdfObject; -import com.itextpdf.kernel.pdf.PdfStream; - -import java.io.OutputStream; - -/** - * A compression strategy that uses the {@code RunLengthDecode} filter for PDF - * streams. - * - *

- * This strategy implements the {@link IStreamCompressionStrategy} interface - * and provides {@code RunLengthDecode} encoding. - * - *

- * Run-length encoding works best, when input data has long sequences of - * identical bytes. This is, usually, not the case for PDF content streams, so - * using this strategy will often cause a marginal size increase instead. - */ -public class RunLengthCompressionStrategy implements IStreamCompressionStrategy { - /** - * Constructs a new {@link RunLengthCompressionStrategy} instance. - */ - public RunLengthCompressionStrategy() { - // empty constructor - } - - /** - * Returns the name of the compression filter. - * - * @return {@link PdfName#RunLengthDecode} representing the {@code RunLengthDecode} filter - */ - @Override - public PdfName getFilterName() { - return PdfName.RunLengthDecode; - } - - /** - * Returns the decode parameters for the {@code RunLengthDecode} filter. - *

- * This implementation returns {@code null} as no special decode parameters - * are required for standard run length compression. - * - * @return {@code null} as no decode parameters are needed - */ - @Override - public PdfObject getDecodeParams() { - return null; - } - - /** - * Creates a new output stream with run length compression applied. - *

- * This method wraps the original output stream in a {@link RunLengthOutputStream} - * that applies run length compression. - * - * @param original the original output stream to wrap - * @param stream the PDF stream containing compression configuration - * - * @return a new {@link RunLengthOutputStream} that compresses data using the run length algorithm - */ - @Override - public OutputStream createNewOutputStream(OutputStream original, PdfStream stream) { - return new RunLengthOutputStream(original); - } -} diff --git a/src/main/java/com/itextpdf/rups/io/encoders/RunLengthOutputStream.java b/src/main/java/com/itextpdf/rups/io/encoders/RunLengthOutputStream.java deleted file mode 100644 index ae3b19f0..00000000 --- a/src/main/java/com/itextpdf/rups/io/encoders/RunLengthOutputStream.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.io.source.IFinishable; - -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * An output stream that encodes data according to the {@code RunLengthDecode} - * filter from the PDF specification. - */ -public class RunLengthOutputStream extends FilterOutputStream implements IFinishable { - /** - * Maximum length of a run. Applies to both "unique" and repeating ones. - */ - private static final int MAX_LENGTH = 128; - /** - * End Of Data marker. - */ - private static final byte EOD = (byte) 128; - - /** - * Buffer for storing the pending run. - */ - private final byte[] buffer = new byte[MAX_LENGTH]; - /** - * Value, that repeats in a repeating run. Set to {@code -1}, when the - * pending run is a "unique" one. - */ - private int repeatValue = -1; - /** - * Current length of the pending run. - */ - private int currentLength = 0; - - /** - * Flag for detecting, whether {@link #finish} has been called. - */ - private final AtomicBoolean finished = new AtomicBoolean(false); - - /** - * Creates a new {@code RunLengthDecode} encoding stream. - * - * @param out the output stream to write encoded data to - */ - public RunLengthOutputStream(OutputStream out) { - super(out); - } - - /** - * {@inheritDoc} - */ - @Override - public void write(int b) throws IOException { - int value = b & 0xFF; - // Case for continuing a repeating run - if (value == repeatValue) { - ++currentLength; - if (currentLength == MAX_LENGTH) { - writePending(); - } - return; - } - /* - * If there was a repeating run, but we got a different value, then we - * need to write the current repeating run we had and start a new - * "unique" run. - */ - if (repeatValue != -1) { - writePending(); - buffer[currentLength] = (byte) value; - ++currentLength; - return; - } - /* - * As soon as we detect a sequence of 3 or more bytes, which are the - * same, we need to switch to a repeating run. For this we will write - * the values before the repeated one as a "unique" run and start a - * new repeating run at length 3. - * - * Technically speaking we can switch to a repeating run at 2 bytes, - * but in the vast majority of cases this will make the compression - * ratio worse. - */ - if (currentLength >= 2 - && buffer[currentLength - 1] == (byte) value - && buffer[currentLength - 2] == (byte) value) { - currentLength -= 2; - writePending(); - repeatValue = value; - currentLength = 3; - return; - } - // Just continuing (or starting) a "unique" run - buffer[currentLength] = (byte) value; - ++currentLength; - if (currentLength == MAX_LENGTH) { - writePending(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void close() throws IOException { - finish(); - super.close(); - } - - /** - * {@inheritDoc} - */ - @Override - public void finish() throws IOException { - if (finished.getAndSet(true)) { - return; - } - writePending(); - out.write(EOD); - flush(); - } - - private void writePending() throws IOException { - if (currentLength <= 0) { - return; - } - if (repeatValue < 0) { - // Writing "unique" run - out.write(currentLength - 1); - out.write(buffer, 0, currentLength); - } else { - // Writing repeating run - out.write(257 - currentLength); - out.write(repeatValue); - } - resetPending(); - } - - private void resetPending() { - repeatValue = -1; - currentLength = 0; - } -} diff --git a/src/main/java/com/itextpdf/rups/view/contextmenu/PdfTreeContextMenu.java b/src/main/java/com/itextpdf/rups/view/contextmenu/PdfTreeContextMenu.java index 5c40c490..c48ad815 100644 --- a/src/main/java/com/itextpdf/rups/view/contextmenu/PdfTreeContextMenu.java +++ b/src/main/java/com/itextpdf/rups/view/contextmenu/PdfTreeContextMenu.java @@ -43,12 +43,12 @@ This file is part of the iText (R) project. package com.itextpdf.rups.view.contextmenu; import com.itextpdf.brotlicompressor.BrotliStreamCompressionStrategy; +import com.itextpdf.kernel.pdf.ASCII85CompressionStrategy; +import com.itextpdf.kernel.pdf.ASCIIHexCompressionStrategy; import com.itextpdf.kernel.pdf.FlateCompressionStrategy; import com.itextpdf.kernel.pdf.PdfName; +import com.itextpdf.kernel.pdf.RunLengthCompressionStrategy; import com.itextpdf.rups.controller.PdfReaderController; -import com.itextpdf.rups.io.encoders.ASCII85CompressionStrategy; -import com.itextpdf.rups.io.encoders.ASCIIHexCompressionStrategy; -import com.itextpdf.rups.io.encoders.RunLengthCompressionStrategy; import com.itextpdf.rups.util.ExcludeFromGeneratedJacocoReport; import com.itextpdf.rups.view.Language; import com.itextpdf.rups.view.itext.PdfTree; diff --git a/src/test/java/com/itextpdf/rups/io/encoders/ASCII85OutputStreamTest.java b/src/test/java/com/itextpdf/rups/io/encoders/ASCII85OutputStreamTest.java deleted file mode 100644 index b9c223be..00000000 --- a/src/test/java/com/itextpdf/rups/io/encoders/ASCII85OutputStreamTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.rups.io.util.CloseableByteArrayOutputStream; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -@Tag("UnitTest") -public class ASCII85OutputStreamTest { - public static Iterable encodeTestArguments() { - // These inputs were generated randomly just in case - return Arrays.asList( - new Object[]{ - new byte[0], - "~>", - "Empty input", - }, - new Object[]{ - new byte[]{0x0C}, - "$i~>", - "Single 1-byte block", - }, - new Object[]{ - new byte[]{0x39, 0x14}, - "3>;~>", - "Single 2-byte block", - }, - new Object[]{ - new byte[]{0x21, (byte) 0xD8, 0x6C}, - "+kUT~>", - "Single 3-byte block", - }, - new Object[]{ - new byte[]{0x7F, 0x1D, (byte) 0xEA, 0x50}, - "Ii[fN~>", - "Single full block", - }, - new Object[]{ - new byte[]{0x2D, 0x1E, (byte) 0xB7, 0x7D, - 0x1F}, - "/KVBL*r~>", - "Single full block + single 1-byte block", - }, - new Object[]{ - new byte[]{0x54, (byte) 0x8E, 0x0A, (byte) 0xAD, - 0x20, 0x3F}, - "", - "Single full block + single 2-byte block", - }, - new Object[]{ - new byte[]{(byte) 0xA1, 0x72, 0x6A, 0x6C, - (byte) 0xAC, 0x56, 0x09}, - "TlOmaXB#W~>", - "Single full block + single 3-byte block", - }, - new Object[]{ - new byte[]{(byte) 0x99, 0x0D, (byte) 0xCA, 0x53, - (byte) 0xFF, (byte) 0x94, (byte) 0xC4, 0x26}, - "R17;;s-1GK~>", - "Two full blocks", - }, - // Single full block + single partial zero block variations - new Object[]{ - new byte[]{(byte) 0xA9, 0x1A, (byte) 0x9D, 0x59, - 0x00}, - "W>_=1!!~>", - "Single full block + single zeroed 1-byte block", - }, - new Object[]{ - new byte[]{(byte) 0xFC, 0x17, 0x09, (byte) 0x8A, - 0x00, 0x00}, - "r\"fZs!!!~>", - "Single full block + single zeroed 2-byte block", - }, - new Object[]{ - new byte[]{0x65, (byte) 0x87, 0x11, (byte) 0xFF, - 0x00, 0x00, 0x00}, - "AVUlt!!!!~>", - "Single full block + single zeroed 3-byte block", - }, - new Object[]{ - new byte[]{0x45, 0x35, (byte) 0xD6, (byte) 0xCE, - 0x00, 0x00, 0x00, 0x00}, - "75`ZAz~>", - "Single full block + single zeroed full block", - } - ); - } - - @ParameterizedTest(name = "{2}") - @MethodSource("encodeTestArguments") - public void encodeTest(byte[] input, String output, String name) throws IOException { - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - try (ASCII85OutputStream encoder = new ASCII85OutputStream(baos)) { - encoder.write(input); - } - Assertions.assertEquals(output, toString(baos)); - } - - @Test - public void finishableImplTest() throws IOException { - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - ASCII85OutputStream encoder = new ASCII85OutputStream(baos); - - encoder.write(new byte[]{(byte) 0xBF, 0x1B, 0x25, 0x03, (byte) 0x94}); - encoder.flush(); - Assertions.assertEquals("^DeI$", toString(baos)); - - // Should add encoded partial block and EOD - encoder.finish(); - Assertions.assertFalse(baos.isClosed()); - Assertions.assertEquals("^DeI$PQ~>", toString(baos)); - - // Should be noop, since idempotent - encoder.finish(); - Assertions.assertFalse(baos.isClosed()); - Assertions.assertEquals("^DeI$PQ~>", toString(baos)); - - // Should not append data, since finished - encoder.close(); - Assertions.assertTrue(baos.isClosed()); - Assertions.assertEquals("^DeI$PQ~>", toString(baos)); - } - - private static String toString(java.io.ByteArrayOutputStream baos) { - return baos.toString(StandardCharsets.US_ASCII); - } -} diff --git a/src/test/java/com/itextpdf/rups/io/encoders/ASCIIHexOutputStreamTest.java b/src/test/java/com/itextpdf/rups/io/encoders/ASCIIHexOutputStreamTest.java deleted file mode 100644 index 1fcb596c..00000000 --- a/src/test/java/com/itextpdf/rups/io/encoders/ASCIIHexOutputStreamTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.rups.io.util.CloseableByteArrayOutputStream; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -@Tag("UnitTest") -public class ASCIIHexOutputStreamTest { - @Test - public void encodeTest() throws IOException { - byte[] input = new byte[256]; - for (int i = 0; i < input.length; ++i) { - input[i] = (byte) i; - } - String expected = "000102030405060708090a0b0c0d0e0f101112131415161718" - + "191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435" - + "363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152" - + "535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f" - + "707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c" - + "8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9" - + "aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6" - + "c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3" - + "e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff>"; - - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - try (ASCIIHexOutputStream encoder = new ASCIIHexOutputStream(baos)) { - encoder.write(input); - } - Assertions.assertEquals(expected, toString(baos)); - } - - @Test - public void emptyStreamTest() throws IOException { - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - ASCIIHexOutputStream encoder = new ASCIIHexOutputStream(baos); - Assertions.assertEquals("", toString(baos)); - - encoder.finish(); - Assertions.assertEquals(">", toString(baos)); - - encoder.close(); - Assertions.assertEquals(">", toString(baos)); - } - - @Test - public void finishableImplTest() throws IOException { - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - ASCIIHexOutputStream encoder = new ASCIIHexOutputStream(baos); - - encoder.write(new byte[]{0x1F, 0x3A, 0x7F, 0x59}); - encoder.flush(); - Assertions.assertEquals("1f3a7f59", toString(baos)); - - // Should add EOD - encoder.finish(); - Assertions.assertFalse(baos.isClosed()); - Assertions.assertEquals("1f3a7f59>", toString(baos)); - - // Should be noop, since idempotent - encoder.finish(); - Assertions.assertFalse(baos.isClosed()); - Assertions.assertEquals("1f3a7f59>", toString(baos)); - - // Should not append data, since finished - encoder.close(); - Assertions.assertTrue(baos.isClosed()); - Assertions.assertEquals("1f3a7f59>", toString(baos)); - } - - private static String toString(java.io.ByteArrayOutputStream baos) { - return baos.toString(StandardCharsets.US_ASCII); - } -} diff --git a/src/test/java/com/itextpdf/rups/io/encoders/RunLengthOutputStreamTest.java b/src/test/java/com/itextpdf/rups/io/encoders/RunLengthOutputStreamTest.java deleted file mode 100644 index c9710799..00000000 --- a/src/test/java/com/itextpdf/rups/io/encoders/RunLengthOutputStreamTest.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - This file is part of the iText (R) project. - Copyright (c) 1998-2026 Apryse Group NV - Authors: Apryse Software. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License version 3 - as published by the Free Software Foundation with the addition of the - following permission added to Section 15 as permitted in Section 7(a): - FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY - APRYSE GROUP. APRYSE GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT - OF THIRD PARTY RIGHTS - - 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 Affero 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 or write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA, 02110-1301 USA, or download the license from the following URL: - http://itextpdf.com/terms-of-use/ - - The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU Affero General Public License. - - In accordance with Section 7(b) of the GNU Affero General Public License, - a covered work must retain the producer line in every PDF that is created - or manipulated using iText. - - You can be released from the requirements of the license by purchasing - a commercial license. Buying such a license is mandatory as soon as you - develop commercial activities involving the iText software without - disclosing the source code of your own applications. - These activities include: offering paid services to customers as an ASP, - serving PDFs on the fly in a web application, shipping iText with a closed - source product. - - For more information, please contact iText Software Corp. at this - address: sales@itextpdf.com - */ -package com.itextpdf.rups.io.encoders; - -import com.itextpdf.rups.io.util.CloseableByteArrayOutputStream; - -import java.io.IOException; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -@Tag("UnitTest") -public class RunLengthOutputStreamTest { - public static Iterable encodeTestArguments() { - return Arrays.asList( - new Object[]{ - new byte[0], - new byte[]{(byte) 0x80}, - "Empty input" - }, - new Object[]{ - // We do not collapse 2 elem repeating runs - concat(uniqueRun(1), repeatingRun(2, 0x42), uniqueRun(2), - repeatingRun(3, 0x43), - uniqueRun(3), - repeatingRun(4, 0x44), - uniqueRun(4)), - concat( 4, uniqueRun(1), repeatingRun(2, 0x42), uniqueRun(2), - 254, 0x43, - 2, uniqueRun(3), - 253, 0x44, - 3, uniqueRun(4), - 0x80), - "Variable run types" - }, - new Object[]{ - uniqueRun(300, 0x00), - concat(127, uniqueRun(128, 0x00), - 127, uniqueRun(128, 0x80), - 43, uniqueRun( 44, 0x00), - 0x80), - "Long unique run" - }, - new Object[]{ - repeatingRun(300, 0xAD), - concat(129, 0xAD, 129, 0xAD, 213, 0xAD, 0x80), - "Long repeating run" - }, - new Object[]{ - concat(uniqueRun(128, 0x40), repeatingRun(128, 0x60)), - concat(127, uniqueRun(128, 0x40), 129, 0x60, 0x80), - "128 unique run + 128 repeating run" - }, - new Object[]{ - concat(repeatingRun(128, 0x40), uniqueRun(128, 0x60)), - concat(129, 0x40, 127, uniqueRun(128, 0x60), 0x80), - "128 repeating run + 128 unique run" - } - ); - } - - @ParameterizedTest(name = "{2}") - @MethodSource("encodeTestArguments") - public void encodeTest(byte[] input, byte[] output, String name) throws IOException { - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - try (RunLengthOutputStream encoder = new RunLengthOutputStream(baos)) { - encoder.write(input); - } - Assertions.assertArrayEquals(output, baos.toByteArray()); - } - - @Test - public void finishableImplTest() throws IOException { - CloseableByteArrayOutputStream baos = new CloseableByteArrayOutputStream(); - RunLengthOutputStream encoder = new RunLengthOutputStream(baos); - - encoder.write(uniqueRun(3, 0x00)); - encoder.write(repeatingRun(3, 0x00)); - encoder.write(repeatingRun(3, 0xFF)); - encoder.write(uniqueRun(3, 0x81)); - encoder.flush(); - Assertions.assertArrayEquals( - concat(2, uniqueRun(3, 0x00), 254, 0x00, 254, 0xFF), - baos.toByteArray() - ); - - // Should add encoded pending block and EOD - encoder.finish(); - Assertions.assertFalse(baos.isClosed()); - Assertions.assertArrayEquals( - concat(2, uniqueRun(3, 0x00), 254, 0x00, 254, 0xFF, 2, uniqueRun(3, 0x81), 0x80), - baos.toByteArray() - ); - - // Should be noop, since idempotent - encoder.finish(); - Assertions.assertFalse(baos.isClosed()); - Assertions.assertArrayEquals( - concat(2, uniqueRun(3, 0x00), 254, 0x00, 254, 0xFF, 2, uniqueRun(3, 0x81), 0x80), - baos.toByteArray() - ); - - // Should not append data, since finished - encoder.close(); - Assertions.assertTrue(baos.isClosed()); - Assertions.assertArrayEquals( - concat(2, uniqueRun(3, 0x00), 254, 0x00, 254, 0xFF, 2, uniqueRun(3, 0x81), 0x80), - baos.toByteArray() - ); - } - - private static byte[] concat(Object... values) { - int size = 0; - for (int i = 0; i < values.length; ++i) { - if (values[i] instanceof Integer) { - ++size; - } else if (values[i] instanceof byte[]) { - size += ((byte[]) values[i]).length; - } else { - throw new IllegalArgumentException("unexpected type"); - } - } - byte[] result = new byte[size]; - int offset = 0; - for (int i = 0; i < values.length; ++i) { - if (values[i] instanceof Integer) { - result[offset] = (byte) (((Integer) values[i]) & 0xFF); - ++offset; - } else { - byte[] arr = (byte[]) values[i]; - System.arraycopy(arr, 0, result, offset, arr.length); - offset += arr.length; - } - } - return result; - } - - private static byte[] uniqueRun(int length) { - return uniqueRun(length, 0); - } - - private static byte[] uniqueRun(int length, int offset) { - byte[] run = new byte[length]; - for (int i = 0; i < length; ++i) { - run[i] = (byte) ((offset + i) & 0xFF); - } - return run; - } - - private static byte[] repeatingRun(int length, int value) { - byte[] run = new byte[length]; - Arrays.fill(run, (byte) (value & 0xFF)); - return run; - } -} diff --git a/src/test/java/com/itextpdf/rups/util/PdfStreamUtilTest.java b/src/test/java/com/itextpdf/rups/util/PdfStreamUtilTest.java index 7b993f31..dd99e760 100644 --- a/src/test/java/com/itextpdf/rups/util/PdfStreamUtilTest.java +++ b/src/test/java/com/itextpdf/rups/util/PdfStreamUtilTest.java @@ -42,6 +42,8 @@ This file is part of the iText (R) project. */ package com.itextpdf.rups.util; +import com.itextpdf.kernel.pdf.ASCII85CompressionStrategy; +import com.itextpdf.kernel.pdf.ASCIIHexCompressionStrategy; import com.itextpdf.kernel.pdf.CompressionConstants; import com.itextpdf.kernel.pdf.PdfArray; import com.itextpdf.kernel.pdf.PdfDictionary; @@ -50,8 +52,6 @@ This file is part of the iText (R) project. import com.itextpdf.kernel.pdf.PdfNumber; import com.itextpdf.kernel.pdf.PdfObject; import com.itextpdf.kernel.pdf.PdfStream; -import com.itextpdf.rups.io.encoders.ASCII85CompressionStrategy; -import com.itextpdf.rups.io.encoders.ASCIIHexCompressionStrategy; import java.io.IOException; import java.util.List; diff --git a/src/test/java/com/itextpdf/rups/view/contextmenu/ApplyFilterActionTest.java b/src/test/java/com/itextpdf/rups/view/contextmenu/ApplyFilterActionTest.java index 0cc13256..2dbe3ba8 100644 --- a/src/test/java/com/itextpdf/rups/view/contextmenu/ApplyFilterActionTest.java +++ b/src/test/java/com/itextpdf/rups/view/contextmenu/ApplyFilterActionTest.java @@ -42,12 +42,12 @@ This file is part of the iText (R) project. */ package com.itextpdf.rups.view.contextmenu; +import com.itextpdf.kernel.pdf.ASCII85CompressionStrategy; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfName; import com.itextpdf.kernel.pdf.PdfNumber; import com.itextpdf.kernel.pdf.PdfStream; import com.itextpdf.rups.controller.PdfReaderController; -import com.itextpdf.rups.io.encoders.ASCII85CompressionStrategy; import com.itextpdf.rups.mock.NoopProgressDialog; import com.itextpdf.rups.model.IRupsEventListener; import com.itextpdf.rups.model.ObjectLoader;