/** * 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('>'); }