private PDDeviceGray(boolean isInherited) { super(COSName.construct(ASAtom.DEVICEGRAY)); setInherited(isInherited); }
private PDDeviceCMYK(boolean isInherited) { super(COSName.construct(ASAtom.DEVICECMYK)); setInherited(isInherited); }
private PDDeviceRGB(boolean isInherited) { super(COSName.construct(ASAtom.DEVICERGB)); setInherited(isInherited); }
private void setUcsCMapFromIdentity(PDCIDSystemInfo cidSystemInfo) { if (cidSystemInfo != null) { String registry = cidSystemInfo.getRegistry(); if (ADOBE.equals(registry)) { String ordering = cidSystemInfo.getOrdering(); if (JAPAN_1.equals(ordering) || CNS_1.equals(ordering) || KOREA_1.equals(ordering) || GB_1.equals(ordering)) { String ucsName = "Adobe-" + ordering + "-" + UCS2; this.ucsCMap = new PDCMap(COSName.construct(ucsName)); } } } }
private List<CosUnicodeName> getRoleMapNames() { if (this.simplePDObject != null) { Map<ASAtom, ASAtom> roleMap = ((org.verapdf.pd.structure.PDStructTreeRoot) simplePDObject).getRoleMap(); if (roleMap != null) { List<CosUnicodeName> res = new ArrayList<>(); for (Map.Entry<ASAtom, ASAtom> entry : roleMap.entrySet()) { res.add(new GFCosUnicodeName((COSName) COSName.construct(entry.getKey()).get())); res.add(new GFCosUnicodeName((COSName) COSName.construct(entry.getValue()).get())); } return res; } } return Collections.emptyList(); }
/** * @return link to the name Object referenced by BaseFont key. */ private List<CosUnicodeName> getBaseFont() { String name = this.pdFont.getName(); if (name != null) { ArrayList<CosUnicodeName> list = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); list.add(new GFCosUnicodeName((COSName) COSName.construct(ASAtom.getASAtom(name)).get())); return Collections.unmodifiableList(list); } return Collections.emptyList(); }
public void visitFromName(COSName obj) { this.copy.assign(COSName.construct(obj.get())); }
public PDColorSpace getColorSpace(ASAtom name, boolean isDefault) { if (colorSpaceMap.containsKey(name)) { return colorSpaceMap.get(name); } PDColorSpace colorSpace; COSObject rawColorSpace = getResource(ASAtom.COLORSPACE, name); if (rawColorSpace != null && !rawColorSpace.empty()) { colorSpace = ColorSpaceFactory.getColorSpace(rawColorSpace, this, isDefault); } else { colorSpace = ColorSpaceFactory.getColorSpace(COSName.construct(name), this, isDefault); } colorSpaceMap.put(name, colorSpace); return colorSpace; }
protected void updateToObject() { COSObject filters = getObject(); filters.clearArray(); for (ASAtom entry : this.entries) { filters.add(COSName.construct(entry)); } }
protected COSObject getName() throws IOException { if (this.flag) { nextToken(); } this.flag = true; final Token token = getToken(); if (token.type != Token.Type.TT_NAME) { return new COSObject(); } return COSName.construct(token.getValue()); }
protected COSObject getName() throws IOException { if (this.flag) { nextToken(); } this.flag = true; final Token token = getToken(); if (token.type != Token.Type.TT_NAME) { return new COSObject(); } return COSName.construct(token.getValue()); }
return COSName.construct(token.getValue()); case TT_OPENARRAY: this.flag = false;
&& lastOperand.getString().equals("Encoding")) { operandStack.pop(); userDict.put(lastOperand.getName(), COSName.construct(ASAtom.STANDARD_ENCODING));
private static COSObject psCopyObject(COSObject toCopy) { switch (toCopy.getType()) { case COS_BOOLEAN: return COSBoolean.construct(toCopy.getBoolean()); case COS_INTEGER: return COSInteger.construct(toCopy.getInteger()); case COS_NAME: return COSName.construct(toCopy.getName()); case COS_REAL: return COSReal.construct(toCopy.getReal()); default: // In all other cases copied object share the same memory location return toCopy; } } }
@Override public void checkMetadataStream( MetadataFixerResultImpl.Builder resultBuilder, PDFAFlavour flavour) { PDFAFlavour.Specification part = flavour.getPart(); if (part != PDFAFlavour.Specification.ISO_19005_1) { COSFilters filters = ((COSStream) this.stream.getDirectBase()).getFilters(); if (filters.size() == 1 && filters.getFilters().get(0) == ASAtom.FLATE_DECODE) { return; } try { ((COSStream) this.stream.getDirectBase()).setFilters(new COSFilters( COSName.construct(ASAtom.FLATE_DECODE))); this.doc.addChangedObject(stream); resultBuilder.addFix("Metadata stream filtered with FlateDecode"); } catch (IOException e) { LOGGER.log(Level.FINE, "Problems with setting filter for stream.", e); } } this.setRequiredDictionaryValue(ASAtom.METADATA, ASAtom.TYPE, resultBuilder); this.setRequiredDictionaryValue(ASAtom.getASAtom("XML"), ASAtom.SUBTYPE, resultBuilder); }
String ordering = pdcMap.getOrdering(); String ucsName = registry + "-" + ordering + "-" + UCS2; PDCMap pdUCSCMap = new PDCMap(COSName.construct(ucsName)); CMap ucsCMap = pdUCSCMap.getCMapFile(); if (ucsCMap != null) {
return PDPattern.INSTANCE; } else if (ASAtom.CALCMYK == name) { return getColorSpaceFromName(COSName.construct(ASAtom.DEVICECMYK), resources, false);