Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable content item parsing for annotation appearance stream #649

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ private void addAppearance(List<PDXForm> list, PDAppearanceStream toAdd) {
PDResourcesHandler resources = this.resources.getExtendedResources(toAdd.getResources());
COSString annotLang = getLang();
GFPDXForm xForm = new GFPDXForm(toAdd, resources, null, getParentDictionary(), "",
annotLang == null ? null : annotLang.getString(), isSignature());
annotLang == null ? null : annotLang.getString(), true, isSignature());
this.containsTransparency |= xForm.containsTransparency();
list.add(xForm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,18 @@ public class GFPDXForm extends GFPDXObject implements PDXForm {
private final PDColorSpace blendingColorSpace;

private final boolean isSignature;
private final boolean isAnnotation;

public GFPDXForm(org.verapdf.pd.images.PDXForm simplePDObject, PDResourcesHandler resourcesHandler,
GraphicState inheritedGraphicState, COSObject parentStructElem, String parentsTags,
String defaultLang, boolean isSignature) {
String defaultLang, boolean isAnnotation, boolean isSignature) {
super(simplePDObject, resourcesHandler.getExtendedResources(simplePDObject.getResources()), X_FORM_TYPE);
this.inheritedGraphicState = inheritedGraphicState;
this.parentStructElem = parentStructElem;
this.parentsTags = parentsTags;
this.blendingColorSpace = getBlendingColorSpace();
this.defaultLang = defaultLang;
this.isAnnotation = isAnnotation;
this.isSignature = isSignature;
}

Expand Down Expand Up @@ -197,10 +199,9 @@ private void initializeGroups() {
}

private void parseContentStream() {
List<PDContentStream> streams = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS);
GFPDContentStream gfContentStream;
if (!PDFAFlavour.IsoStandardSeries.ISO_14289.equals(StaticContainers.getFlavour().getPart().getSeries()) &&
PDFAFlavour.SpecificationFamily.WCAG != StaticContainers.getFlavour().getPart().getFamily()) {
if (isAnnotation || (PDFAFlavour.IsoStandardSeries.ISO_14289 != StaticContainers.getFlavour().getPart().getSeries() &&
PDFAFlavour.SpecificationFamily.WCAG != StaticContainers.getFlavour().getPart().getFamily())) {
gfContentStream = new GFPDContentStream(
(org.verapdf.pd.images.PDXForm) this.simplePDObject, resourcesHandler,
this.inheritedGraphicState, new StructureElementAccessObject(this.simpleCOSObject),
Expand All @@ -212,6 +213,7 @@ this.inheritedGraphicState, new StructureElementAccessObject(this.simpleCOSObjec
parentStructElem, parentsTags, defaultLang, isSignature);
}
this.contentStreamContainsTransparency = gfContentStream.isContainsTransparency();
List<PDContentStream> streams = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS);
streams.add(gfContentStream);
this.contentStreams = streams;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static PDXObject getTypedPDXObject(org.verapdf.pd.images.PDXObject xObjec
GraphicState inheritedGraphicState, COSObject parentStructElem, String parentsTags) {
ASAtom type = xObject.getType();
if (ASAtom.FORM.equals(type)) {
return new GFPDXForm((PDXForm) xObject, resources, inheritedGraphicState, parentStructElem, parentsTags, null, false);
return new GFPDXForm((PDXForm) xObject, resources, inheritedGraphicState, parentStructElem, parentsTags, null, false, false);
} else if (ASAtom.IMAGE.equals(type)) {
return new GFPDXImage((PDXImage) xObject, resources, inheritedGraphicState.getFillColorSpace());
} else if (ASAtom.PS.equals(type)) {
Expand Down
Loading