-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed automated filtering, added all remaining options to scanproce…
…ssing. updated pdfbox due to security vulnerabilities
- Loading branch information
1 parent
b5dfa44
commit 5fd2b6e
Showing
18 changed files
with
224 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 0 additions & 151 deletions
151
src/main/java/XIS/sections/automatedfilter/AutomatedFilterModuleController.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/java/XIS/sections/automatedfilter/AutomatedFilterModuleVista.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/main/java/XIS/sections/automatedfilter/automatedFilter.fxml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package XIS.sections.scanprocessing; | ||
|
||
import XIS.sections.Interruptible; | ||
import XIS.toolset.JavaFXTools; | ||
import XIS.toolset.scanfilters.Filter; | ||
|
||
import java.io.File; | ||
|
||
public class PdfFilter { | ||
public static void filter(File inputFile, File outputFile, Filter filter, Interruptible interruptible, JavaFXTools.SetImageDelegate delegate, int dpi) { | ||
PdfImageList pdfImageList = null; | ||
PdfCreator creator = null; | ||
try { | ||
|
||
|
||
pdfImageList = PdfImageList.create(inputFile, dpi); | ||
if (pdfImageList == null) { | ||
interruptible.reportProgress("Failure"); | ||
return; | ||
} | ||
creator = new PdfCreator(); | ||
creator.setDelegate(delegate); | ||
for (int i = 0; i < pdfImageList.size(); i++) { | ||
var image = pdfImageList.at(i); | ||
var filteredImage = filter.filter(image, interruptible); | ||
interruptible.reportProgress((1.0*i + 1) / pdfImageList.size()); | ||
interruptible.reportProgress("Progress: page " + (i + 1) + "/" + pdfImageList.size() + "."); | ||
creator.append(filteredImage); | ||
|
||
} | ||
interruptible.reportProgress("Finished"); | ||
creator.save(outputFile); | ||
|
||
|
||
} finally { | ||
try { | ||
if (pdfImageList != null) { | ||
pdfImageList.close(); | ||
} | ||
if (creator != null) { | ||
creator.close(); | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ections/automatedfilter/PdfImageList.java → ...sections/scanprocessing/PdfImageList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.