Merge branch 'RED-7075' into 'master'
RED-7075: WatermarkRemoval last changes Closes RED-7075 See merge request redactmanager/commons/pdftron-logic-commons!13
This commit is contained in:
commit
300b5da99d
@ -16,16 +16,16 @@ import lombok.SneakyThrows;
|
|||||||
class InvisibleElementRemovalServiceTest {
|
class InvisibleElementRemovalServiceTest {
|
||||||
|
|
||||||
InvisibleElementRemovalService invisibleElementRemovalService;
|
InvisibleElementRemovalService invisibleElementRemovalService;
|
||||||
private static final String pdftronLicense = "demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a";
|
|
||||||
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void createService() {
|
void createService() {
|
||||||
|
|
||||||
PDFNet.initialize(pdftronLicense);
|
PDFNet.initialize(PDFTronConfig.license);
|
||||||
invisibleElementRemovalService = new InvisibleElementRemovalService();
|
invisibleElementRemovalService = new InvisibleElementRemovalService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
void removeInvisibleText() {
|
void removeInvisibleText() {
|
||||||
@ -78,6 +78,7 @@ class InvisibleElementRemovalServiceTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
void removeInvisibleElementsThinFilledTable() {
|
void removeInvisibleElementsThinFilledTable() {
|
||||||
@ -100,6 +101,7 @@ class InvisibleElementRemovalServiceTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
void removeInvisibleElementsChineseOverlapped() {
|
void removeInvisibleElementsChineseOverlapped() {
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.iqser.red.pdftronlogic.commons;
|
||||||
|
|
||||||
|
public class PDFTronConfig {
|
||||||
|
public static final String license = "demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a";
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,9 +1,5 @@
|
|||||||
package com.iqser.red.pdftronlogic.commons;
|
package com.iqser.red.pdftronlogic.commons;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -23,8 +19,7 @@ class WatermarkRemovalServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
void removeWatermarks() {
|
void removeWatermarks() {
|
||||||
|
|
||||||
PDFNet.addResourceSearchPath("C:/Users/RaphaelArnold/knecon/pdftron/ocrirismodule/Lib");
|
PDFNet.initialize(PDFTronConfig.license);
|
||||||
PDFNet.initialize("demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a");
|
|
||||||
|
|
||||||
String filename = "files/PO_82_277_H_2013 (1).pdf";
|
String filename = "files/PO_82_277_H_2013 (1).pdf";
|
||||||
|
|
||||||
@ -40,9 +35,9 @@ class WatermarkRemovalServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean isWindows() {
|
public static String createTmpFileName(String filename, String suffix) {
|
||||||
|
|
||||||
return System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows");
|
return Path.of(getTemporaryDirectory()).resolve(Path.of(filename).getFileName()).toString().replace(".pdf", "_" + suffix + ".pdf");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -56,9 +51,9 @@ class WatermarkRemovalServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String createTmpFileName(String filename, String suffix) {
|
private static boolean isWindows() {
|
||||||
|
|
||||||
return Path.of(getTemporaryDirectory()).resolve(Path.of(filename).getFileName()).toString().replace(".pdf", "_" + suffix + ".pdf");
|
return System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user