public static COSObject construct(final COSDictionary dictionary, final ASInputStream stream) { return construct(dictionary, stream, FilterFlags.RAW_DATA); }
public static COSObject construct(final COSDictionary dictionary, final String string) { return construct(dictionary, string, FilterFlags.RAW_DATA); }
public void setData(final ASInputStream stream, final COSStream.FilterFlags flags) { if (stream != null && (this.base == null || !this.base.setData(stream, flags))) { COSObject obj; if (this.base instanceof COSDictionary) { obj = COSStream.construct((COSDictionary) this.base, stream, flags); } else { obj = COSStream.construct(stream); } this.base = obj.base; } }
public void setStreamKeywordCRLFCompliant(final boolean streamKeywordCRLFCompliant) { if (this.base == null || !this.base.setStreamKeywordCRLFCompliant(streamKeywordCRLFCompliant)) { COSObject obj; if (this.base instanceof COSDictionary) { obj = COSStream.construct((COSDictionary) this.base); } else { obj = COSStream.construct(); } this.base = obj.base; this.base.setStreamKeywordCRLFCompliant(streamKeywordCRLFCompliant); } }
public void setRealStreamSize(final long realStreamSize) { if (this.base == null || !this.base.setRealStreamSize(realStreamSize)) { COSObject obj; if (this.base instanceof COSDictionary) { obj = COSStream.construct((COSDictionary) this.base); } else { obj = COSStream.construct(); } this.base = obj.base; this.base.setRealStreamSize(realStreamSize); } }
public void setEndstreamKeywordCRLFCompliant(final boolean endstreamKeywordCRLFCompliant) { if (this.base == null || !this.base.setEndstreamKeywordCRLFCompliant(endstreamKeywordCRLFCompliant)) { COSObject obj; if (this.base instanceof COSDictionary) { obj = COSStream.construct((COSDictionary) this.base); } else { obj = COSStream.construct(); } this.base = obj.base; this.base.setEndstreamKeywordCRLFCompliant(endstreamKeywordCRLFCompliant); } }
public static COSObject concatenateStreams(COSArray streams) throws IOException { List<ASInputStream> resList = new ArrayList<>(); for (COSObject stream : streams) { if (stream.getType() == COSObjType.COS_STREAM) { ASInputStream streamData = stream.getData(FilterFlags.DECODE); resList.add(streamData); } } ASInputStream[] asInputStreams = resList.toArray(new ASInputStream[resList.size()]); ASInputStream inputContentStream = new ASConcatenatedInputStream(asInputStreams); return COSStream.construct(inputContentStream); } }
public PDICCBased(int numberOfComponents, byte[] profile) { ASInputStream iccProfileStream = new ASMemoryInStream(profile); COSObject cosObject = COSStream.construct(iccProfileStream); cosObject.setIntegerKey(ASAtom.N, numberOfComponents); setObject(cosObject); this.iccProfile = new ICCProfile(cosObject); Long n = this.iccProfile.getNumberOfColorants(); this.numberOfComponents = n == null ? -1 : n.intValue(); }
public void visitFromStream(COSStream obj) { visitFromDictionary(obj); this.copy.assign(COSStream.construct((COSDictionary) this.copy.get(), obj.getData(), obj.getFilterFlags())); }
private MetadataImpl parseMetadata() { PDCatalog catalog = this.document.getCatalog(); PDMetadata meta = catalog.getMetadata(); if (meta == null) { COSObject stream = COSStream.construct(); catalog.setKey(ASAtom.METADATA, stream); this.document.getDocument().addObject(stream); VeraPDFMeta xmp = VeraPDFMeta.create(); return new MetadataImpl(xmp, stream, this.document.getDocument(), true); } return parseMetadata(meta, this.document); }