Skip to content

Commit

Permalink
Merge pull request #144 from veraPDF/wcag2_2
Browse files Browse the repository at this point in the history
Support WCAG 2.2 and PDF/UA-2
  • Loading branch information
MaximPlusov authored Dec 15, 2023
2 parents a86845b + e909066 commit c5a610d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public enum Corpus {
EnumSet.of(PDFAFlavour.PDFA_1_A, PDFAFlavour.PDFA_1_B, PDFAFlavour.PDFA_2_A, PDFAFlavour.PDFA_2_B,
PDFAFlavour.PDFA_2_U,
PDFAFlavour.PDFA_3_B, PDFAFlavour.PDFA_4, PDFAFlavour.PDFA_4_F, PDFAFlavour.PDFA_4_E,
PDFAFlavour.PDFUA_1),
PDFAFlavour.PDFUA_1, PDFAFlavour.PDFUA_2),
URI.create(VERA_URL), "veraCorp-"),
ISARTOR("Isartor", EnumSet.of(PDFAFlavour.PDFA_1_B), URI.create(ISARTOR_URL), "isartCorp-"),
BFO("BFO", EnumSet.of(PDFAFlavour.PDFA_2_B), URI.create(BFO_URL), "bfoCorp-"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ private static Set<ValidationProfile> fromGitHubBranch(final String branchName)
String PDFUApathPrefix = GITHUB_ROOT + branchName + PDFUA_PROFILE_PATH_PART + PDFUA_PROFILE_PREFIX;
Set<ValidationProfile> profileSet = new HashSet<>();
for (PDFAFlavour flavour : PDFAFlavour.values()) {
if (flavour == PDFAFlavour.NO_FLAVOUR || flavour == PDFAFlavour.WCAG2_1) {
if (flavour == PDFAFlavour.NO_FLAVOUR || flavour.getPart().getFamily() == PDFAFlavour.SpecificationFamily.WCAG) {
continue;
}
String profileURLString = (flavour != PDFAFlavour.PDFUA_1 ? PDFApathPrefix : PDFUApathPrefix)
String profileURLString = (flavour.getPart().getFamily() != PDFAFlavour.SpecificationFamily.PDF_UA ? PDFApathPrefix : PDFUApathPrefix)
+ flavour.getPart().getPartNumber() + flavour.getLevel().getCode().toUpperCase() + XML_SUFFIX;
try {
URL profileURL = new URL(profileURLString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void itemsMapFromZipSource(File zipFile, boolean isWcag) throws IOExcept
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
String entryName = entry.getName();
if ((isWcag == entryName.contains("WCAG-21")) && !entry.isDirectory()) {
if ((isWcag == entryName.contains("WCAG_2_2")) && !entry.isDirectory()) {
if (entryName.endsWith(".pdf")) {
this.pdfMap.put(entryName, entry);
} else if (entryName.endsWith(".sch")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public static boolean checkFlavour(final String item, final PDFAFlavour flavour)
if (flavour == PDFAFlavour.PDFUA_1) {
return item.contains("PDF_UA-1");
}
if (flavour == PDFAFlavour.PDFUA_2) {
return item.contains("PDF_UA-2");
}
if (flavour == PDFAFlavour.PDFA_4) {
return item.contains("PDF_A-4") && !matchFlavour(item, PDFAFlavour.PDFA_4_E) && !matchFlavour(item, PDFAFlavour.PDFA_4_F);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"ua1":
[
]
"ua2":
[
]
"BFO":
"2b":
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
"7.21.7-t1-pass-c",
"7.21.7-t2-pass-a",
]
"ua2":
[
]
"BFO":
"2b":
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class PDFRegressionTestUtils {
PDFAFlavour.PDFA_2_A, PDFAFlavour.PDFA_2_B, PDFAFlavour.PDFA_2_U,
PDFAFlavour.PDFA_3_A, PDFAFlavour.PDFA_3_B, PDFAFlavour.PDFA_3_U,
PDFAFlavour.PDFA_4, PDFAFlavour.PDFA_4_F, PDFAFlavour.PDFA_4_E,
PDFAFlavour.PDFUA_1);
PDFAFlavour.PDFUA_1, PDFAFlavour.PDFUA_2);
private static final EnumMap<PDFAFlavour, Set<String>> filesByFlavour = new EnumMap<>(PDFAFlavour.class);

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Map;

public class WCAGRegressionTestUtils {
private static final String wcagProfileUrl = "https://github.com/veraPDF/veraPDF-validation-profiles/raw/integration/PDF_UA/WCAG-21-Complete.xml";
private static final String wcagProfileUrl = "https://github.com/veraPDF/veraPDF-validation-profiles/raw/integration/PDF_UA/WCAG-2-2-Complete.xml";

public static void main(String[] args) {
test();
Expand Down

0 comments on commit c5a610d

Please sign in to comment.