public void toPdf(PdfWriter writer, java.io.OutputStream os) throws java.io.IOException { if (os instanceof OutputStreamCounter) position = ((OutputStreamCounter)os).getCounter(); super.toPdf(writer, os); }
public void toPdf(PdfWriter writer, java.io.OutputStream os) throws java.io.IOException { if (os instanceof OutputStreamCounter) position = ((OutputStreamCounter)os).getCounter(); super.toPdf(writer, os); }
/** * Writes efficiently to a stream * * @param os the stream to write to * @throws IOException on write error */ protected void writeTo(OutputStream os) throws IOException { os.write(DocWriter.getISOBytes(String.valueOf(number))); os.write(' '); os.write(DocWriter.getISOBytes(String.valueOf(generation))); os.write(STARTOBJ); object.toPdf(writer, os); os.write(ENDOBJ); }
/** * Writes efficiently to a stream * * @param os the stream to write to * @throws IOException on write error */ protected void writeTo(OutputStream os) throws IOException { os.write(DocWriter.getISOBytes(String.valueOf(number))); os.write(' '); os.write(DocWriter.getISOBytes(String.valueOf(generation))); os.write(STARTOBJ); object.toPdf(writer, os); os.write(ENDOBJ); }
/** * Writes the PDF representation of this <CODE>PdfDictionary</CODE> as an * array of <CODE>byte</CODE> to the given <CODE>OutputStream</CODE>. * * @param writer for backwards compatibility * @param os the <CODE>OutputStream</CODE> to write the bytes to. * @throws IOException */ @Override public void toPdf(final PdfWriter writer, final OutputStream os) throws IOException { PdfWriter.checkPdfIsoConformance(writer, PdfIsoKeys.PDFISOKEY_OBJECT, this); os.write('<'); os.write('<'); // loop over all the object-pairs in the HashMap PdfObject value; int type = 0; for (Entry<PdfName, PdfObject> e: hashMap.entrySet()) { e.getKey().toPdf(writer, os); value = e.getValue(); type = value.type(); if (type != PdfObject.ARRAY && type != PdfObject.DICTIONARY && type != PdfObject.NAME && type != PdfObject.STRING) os.write(' '); value.toPdf(writer, os); } os.write('>'); os.write('>'); }
/** * Writes the PDF representation of this <CODE>PdfDictionary</CODE> as an * array of <CODE>byte</CODE> to the given <CODE>OutputStream</CODE>. * * @param writer for backwards compatibility * @param os the <CODE>OutputStream</CODE> to write the bytes to. * @throws IOException */ @Override public void toPdf(final PdfWriter writer, final OutputStream os) throws IOException { PdfWriter.checkPdfIsoConformance(writer, PdfIsoKeys.PDFISOKEY_OBJECT, this); os.write('<'); os.write('<'); // loop over all the object-pairs in the HashMap PdfObject value; int type = 0; for (Entry<PdfName, PdfObject> e: hashMap.entrySet()) { e.getKey().toPdf(writer, os); value = e.getValue(); type = value.type(); if (type != PdfObject.ARRAY && type != PdfObject.DICTIONARY && type != PdfObject.NAME && type != PdfObject.STRING) os.write(' '); value.toPdf(writer, os); } os.write('>'); os.write('>'); }
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.key.1.didn.t.reserve.space.in.preclose", key.toString())); bf.reset(); obj.toPdf(null, bf); if (bf.size() > lit.getPosLength()) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.key.1.is.too.big.is.2.reserved.3", key.toString(), String.valueOf(bf.size()), String.valueOf(lit.getPosLength())));
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.key.1.didn.t.reserve.space.in.preclose", key.toString())); bf.reset(); obj.toPdf(null, bf); if (bf.size() > lit.getPosLength()) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.key.1.is.too.big.is.2.reserved.3", key.toString(), String.valueOf(bf.size()), String.valueOf(lit.getPosLength())));
protected PdfWriter.PdfBody.PdfCrossReference addToObjStm(final PdfObject obj, final int nObj) throws IOException { if (numObj >= OBJSINSTREAM) flushObjStm(); if (index == null) { index = new ByteBuffer(); streamObjects = new ByteBuffer(); currentObjNum = getIndirectReferenceNumber(); numObj = 0; } int p = streamObjects.size(); int idx = numObj++; PdfEncryption enc = writer.crypto; writer.crypto = null; obj.toPdf(writer, streamObjects); writer.crypto = enc; streamObjects.append(' '); index.append(nObj).append(' ').append(p).append(' '); return new PdfWriter.PdfBody.PdfCrossReference(2, nObj, currentObjNum, idx); }
protected PdfWriter.PdfBody.PdfCrossReference addToObjStm(final PdfObject obj, final int nObj) throws IOException { if (numObj >= OBJSINSTREAM) flushObjStm(); if (index == null) { index = new ByteBuffer(); streamObjects = new ByteBuffer(); currentObjNum = getIndirectReferenceNumber(); numObj = 0; } int p = streamObjects.size(); int idx = numObj++; PdfEncryption enc = writer.crypto; writer.crypto = null; obj.toPdf(writer, streamObjects); writer.crypto = enc; streamObjects.append(' '); index.append(nObj).append(' ').append(p).append(' '); return new PdfWriter.PdfBody.PdfCrossReference(2, nObj, currentObjNum, idx); }
value = cs; value.toPdf(null, content); content.append('\n');
value = cs; value.toPdf(null, content); content.append('\n');