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

PDF/UA. Not process content item in XObject for tilling patterns #681

Merged
merged 1 commit into from
Sep 16, 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 @@ -537,7 +537,7 @@ void parseOperator(List<org.verapdf.model.operator.Operator> processedOperators,
parentStructElem = this.parentStructElem;
}
GFOp_Do op_do = new GFOp_Do(arguments, resourcesHandler.getXObject(getLastCOSName(arguments)),
resourcesHandler, this.graphicState.clone(), parentStructElem, parentsTags);
resourcesHandler, this.graphicState.clone(), parentStructElem, parentsTags, isRealContent);
org.verapdf.model.pdlayer.PDXObject pdxObject = op_do.getXObject();
if (pdxObject != null) {
this.transparencyGraphicState.setVeraXObject((GFPDXObject)pdxObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@ public class GFOp_Do extends GFOperator implements Op_Do {
private final GraphicState inheritedGraphicState;
private final COSObject parentStructElem;
private final List<String> parentsTags;
private final boolean isRealContent;

public GFOp_Do(List<COSBase> arguments, org.verapdf.pd.images.PDXObject pdXObject,
PDResourcesHandler resourcesHandler, GraphicState inheritedGraphicState,
COSObject parentStructElem, List<String> parentsTags) {
COSObject parentStructElem, List<String> parentsTags, boolean isRealContent) {
super(arguments, OP_DO_TYPE);
this.pbXObject = pdXObject;
this.resourcesHandler = resourcesHandler;
this.inheritedGraphicState = inheritedGraphicState;
this.parentStructElem = parentStructElem;
this.parentsTags = parentsTags;
this.isRealContent = isRealContent;
this.xObject = getXObject();
}

Expand Down Expand Up @@ -90,7 +92,7 @@ public PDXObject getXObject() {
return null;
}
this.xObject = GFPDXObject.getTypedPDXObject(this.pbXObject, this.resourcesHandler, inheritedGraphicState,
this.parentStructElem, this.parentsTags);
this.parentStructElem, this.parentsTags, isRealContent);
return this.xObject;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,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(), Collections.emptyList(),
annotLang == null ? null : annotLang.getString(), true, isSignature());
annotLang == null ? null : annotLang.getString(), true, isSignature(), false);
this.containsTransparency |= xForm.containsTransparency();
list.add(xForm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ public class GFPDXForm extends GFPDXObject implements PDXForm {

private final boolean isSignature;
private final boolean isAnnotation;
private final boolean isRealContent;

public GFPDXForm(org.verapdf.pd.images.PDXForm simplePDObject, PDResourcesHandler resourcesHandler,
GraphicState inheritedGraphicState, COSObject parentStructElem, List<String> parentsTags,
String defaultLang, boolean isAnnotation, boolean isSignature) {
String defaultLang, boolean isAnnotation, boolean isSignature, boolean isRealContent) {
super(simplePDObject, resourcesHandler.getExtendedResources(simplePDObject.getResources()), X_FORM_TYPE);
this.inheritedGraphicState = inheritedGraphicState;
this.parentStructElem = parentStructElem;
Expand All @@ -80,6 +81,7 @@ public GFPDXForm(org.verapdf.pd.images.PDXForm simplePDObject, PDResourcesHandle
this.defaultLang = defaultLang;
this.isAnnotation = isAnnotation;
this.isSignature = isSignature;
this.isRealContent = isRealContent;
}

@Override
Expand Down Expand Up @@ -200,7 +202,7 @@ private void initializeGroups() {

private void parseContentStream() {
GFPDContentStream gfContentStream;
if (isAnnotation || (!PDFFlavours.isPDFUARelatedFlavour(StaticContainers.getFlavour()))) {
if (!isRealContent || isAnnotation || (!PDFFlavours.isPDFUARelatedFlavour(StaticContainers.getFlavour()))) {
gfContentStream = new GFPDContentStream(
(org.verapdf.pd.images.PDXForm) this.simplePDObject, resourcesHandler,
this.inheritedGraphicState, new StructureElementAccessObject(this.simpleCOSObject),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ public Boolean getcontainsSMask() {
}

public static PDXObject getTypedPDXObject(org.verapdf.pd.images.PDXObject xObject, PDResourcesHandler resources,
GraphicState inheritedGraphicState, COSObject parentStructElem, List<String> parentsTags) {
GraphicState inheritedGraphicState, COSObject parentStructElem,
List<String> parentsTags, boolean isRealContent) {
ASAtom type = xObject.getType();
if (ASAtom.FORM.equals(type)) {
return new GFPDXForm((PDXForm) xObject, resources, inheritedGraphicState, parentStructElem, parentsTags, null, false, false);
return new GFPDXForm((PDXForm) xObject, resources, inheritedGraphicState, parentStructElem, parentsTags,
null, false, false, isRealContent);
} else if (ASAtom.IMAGE.equals(type)) {
return new GFPDXImage((PDXImage) xObject, resources, inheritedGraphicState.getFillColorSpace());
} else if (ASAtom.PS.equals(type)) {
Expand Down