@Override public String toPDFString() { StringBuilder sb = new StringBuilder(); sb.append(mHeader.toPDFString()); sb.append(mBody.toPDFString()); mCRT.setObjectNumberStart(mBody.getObjectNumberStart()); int x = 0; while (x < mBody.getObjectsCount()) { IndirectObject iobj = mBody.getObjectByNumberID(++x); if (iobj != null) { mCRT.addObjectXRefInfo(iobj.getByteOffset(), iobj.getGeneration(), iobj.getInUse()); } } mTrailer.setObjectsCount(mBody.getObjectsCount()); mTrailer.setCrossReferenceTableByteOffset(sb.length()); mTrailer.setId(Indentifiers.generateId()); return sb.toString() + mCRT.toPDFString() + mTrailer.toPDFString(); }
public IndirectObject newDictionaryObject(String dictionaryContent) { IndirectObject iobj = mBody.getNewIndirectObject(); iobj.setDictionaryContent(dictionaryContent); return iobj; }
public IndirectObject newStreamObject(String streamContent) { IndirectObject iobj = mBody.getNewIndirectObject(); iobj.setDictionaryContent(" /Length " + Integer.toString(streamContent.length()) + "\n"); iobj.setStreamContent(streamContent); return iobj; }
public IndirectObject newRawObject(String content) { IndirectObject iobj = mBody.getNewIndirectObject(); iobj.setContent(content); return iobj; }