@Override protected void copyContent(PdfObject from, PdfDocument document) { super.copyContent(from, document); PdfPrimitiveObject object = (PdfPrimitiveObject) from; if (object.content != null) content = Arrays.copyOf(object.content, object.content.length); }
@Override protected void copyContent(PdfObject from, PdfDocument document) { super.copyContent(from, document); PdfDictionary dictionary = (PdfDictionary) from; for (Map.Entry<PdfName, PdfObject> entry : dictionary.map.entrySet()) { map.put(entry.getKey(), entry.getValue().processCopying(document, false)); } }
@Override protected void copyContent(PdfObject from, PdfDocument document) { super.copyContent(from, document); PdfArray array = (PdfArray) from; for (PdfObject entry : array.list) { add(entry.processCopying(document, false)); } }
/** * Creates clone of the object which belongs to the same document as original object. * New object shall not be used in other documents. * * @return cloned object. */ @SuppressWarnings("CloneDoesntCallSuperClone") @Override public PdfObject clone() { PdfObject newObject = newInstance(); if (indirectReference != null || checkState(MUST_BE_INDIRECT)) { newObject.setState(MUST_BE_INDIRECT); } newObject.copyContent(this, null); return newObject; }
newObject.copyContent(obj, documentTo);