Skip to content

Commit 78d0cbb

Browse files
committed
code cleanup and readme update
1 parent 75d3e20 commit 78d0cbb

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Validate PDF Accessibility with PDFix
22

3-
A Java CLI application to validate and report accessibility issues in PDF documents.
3+
A Java CLI application to validate and report accessibility issues in PDF documents. We use free version of PDFix SDK for PDF reading operations.
4+
5+
## Table of Contents
6+
- [Validate PDF Accessibility with PDFix](#validate-pdf-accessibility-with-pdfix)
7+
- [Table of Contents](#table-of-contents)
8+
- [Command-Line options](#command-line-options)
9+
- [Run the CLI Commands](#run-the-cli-commands)
10+
- [Report Duplicate MCID in Tagged PDF](#report-duplicate-mcid-in-tagged-pdf)
11+
- [Build Instructions](#build-instructions)
12+
- [1. Download and Install PDFix SDK for Java](#1-download-and-install-pdfix-sdk-for-java)
13+
- [2. Compile, Test and Package](#2-compile-test-and-package)
14+
- [Have a question? Need help?](#have-a-question-need-help)
15+
416

517
## Command-Line options
618
```
@@ -18,7 +30,7 @@ Arguments:
1830
## Run the CLI Commands
1931

2032
### Report Duplicate MCID in Tagged PDF
21-
```
33+
```bash
2234
java -jar target/net.pdfix.validate-pdf-1.0.0 duplicate-mcid -i "<path to pdf>"
2335
```
2436
**Output**
@@ -40,15 +52,15 @@ Total 1 duplicate MCIDs found
4052
## Build Instructions
4153

4254
### 1. Download and Install PDFix SDK for Java
43-
```
55+
```bash
4456
mkdir -p lib
4557
curl -L https://github.com/pdfix/pdfix_sdk_builds/releases/download/v8.4.3/java8-net.pdfix.pdfixlib-8.4.3.jar.zip -o lib/pdfixlib-8.4.3.jar.zip
4658
unzip lib/pdfixlib-8.4.3.jar.zip -d lib/
4759
mvn install:install-file -Dfile=lib/net.pdfix.pdfixlib-8.4.3.jar -DgroupId=net.pdfix -DartifactId=net.pdfix.pdfixlib -Dversion=8.4.3 -Dpackaging=jar
4860
```
4961

5062
### 2. Compile, Test and Package
51-
```
63+
```bash
5264
mvn compile
5365
mvn test
5466
mvn package

src/main/java/net/pdfix/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static void processFile(File file) throws Exception {
7474
return;
7575
}
7676

77-
int count = FindDuplicateMcid.checkDuplicateMcid(file.getAbsolutePath(), false);
77+
int count = FindDuplicateMcid.checkDuplicateMcid(file.getAbsolutePath());
7878
if (count == 0) {
7979
System.out.println("No duplicate MCIDs found");
8080
} else {

src/main/java/net/pdfix/FindDuplicateMcid.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private static String getObjContent(PdsPageObject obj) {
4343

4444
// Check for duplicate MCIDs in a PDF file. Return the number of dulicate mcids
4545
// found
46-
public static int checkDuplicateMcid(String path, boolean autotag) throws Exception {
46+
public static int checkDuplicateMcid(String path) throws Exception {
4747
Pdfix pdfix = new Pdfix();
4848

4949
PdfDoc doc = pdfix.OpenDoc(path, "");
@@ -53,13 +53,6 @@ public static int checkDuplicateMcid(String path, boolean autotag) throws Except
5353

5454
int found = 0;
5555

56-
if (autotag) {
57-
PdfTagsParams params = new PdfTagsParams();
58-
doc.RemoveTags();
59-
doc.RemoveStructTree();
60-
doc.AddTags(params);
61-
}
62-
6356
for (int i = 0; i < doc.GetNumPages(); i++) {
6457
PdfPage page = doc.AcquirePage(i);
6558
if (page == null) {

0 commit comments

Comments
 (0)