Skip to content

Commit

Permalink
PDF/UA. Not process content item in XObject for tilling patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Aug 28, 2024
1 parent 4b17b01 commit ae00663
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
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 @@ -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

0 comments on commit ae00663

Please sign in to comment.