/** Returns the PDF representation of this <CODE>PdfContentByte</CODE>-object. * * @param writer the <CODE>PdfWriter</CODE> * @return a <CODE>byte</CODE> array with the representation */ public byte[] toPdf(PdfWriter writer) { sanityCheck(); return content.toByteArray(); }
/** * Closes the encoder and returns the encoded data. * @return the encoded data */ public byte[] close() { Fax4PostEncode(); return outBuf.toByteArray(); }
/** * Closes the encoder and returns the encoded data. * @return the encoded data */ public byte[] close() { Fax4PostEncode(); return outBuf.toByteArray(); }
/** Returns the PDF representation of this <CODE>PdfContentByte</CODE>-object. * * @param writer the <CODE>PdfWriter</CODE> * @return a <CODE>byte</CODE> array with the representation */ public byte[] toPdf(PdfWriter writer) { sanityCheck(); return content.toByteArray(); }
/** * Closes the encoder and returns the encoded data. * @return the encoded data */ public byte[] close() { Fax4PostEncode(); return outBuf.toByteArray(); }
/** Returns the PDF representation of this <CODE>PdfContentByte</CODE>-object. * * @param writer the <CODE>PdfWriter</CODE> * @return a <CODE>byte</CODE> array with the representation */ public byte[] toPdf(PdfWriter writer) { sanityCheck(); return content.toByteArray(); }
/** * Escapes a <CODE>byte</CODE> array according to the PDF conventions. * * @param b the <CODE>byte</CODE> array to escape * @return an escaped <CODE>byte</CODE> array */ static byte[] escapeString(byte b[]) { ByteBuffer content = new ByteBuffer(); escapeString(b, content); return content.toByteArray(); }
/** * Escapes a <CODE>byte</CODE> array according to the PDF conventions. * * @param b the <CODE>byte</CODE> array to escape * @return an escaped <CODE>byte</CODE> array */ static byte[] escapeString(byte b[]) { ByteBuffer content = new ByteBuffer(); escapeString(b, content); return content.toByteArray(); }
/** * Escapes a <CODE>byte</CODE> array according to the PDF conventions. * * @param b the <CODE>byte</CODE> array to escape * @return an escaped <CODE>byte</CODE> array */ static byte[] escapeString(byte[] b) { ByteBuffer content = new ByteBuffer(); escapeString(b, content); return content.toByteArray(); }
ByteStore(PRStream str) throws IOException { try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } ByteBuffer bb = new ByteBuffer(); int level = 100; serObject(str, level, bb); this.b = bb.toByteArray(); md5 = null; }
ByteStore(PRStream str) throws IOException { try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } ByteBuffer bb = new ByteBuffer(); int level = 100; serObject(str, level, bb); this.b = bb.toByteArray(); md5 = null; }
ByteStore(PRStream str) throws IOException { try { md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { throw new ExceptionConverter(e); } ByteBuffer bb = new ByteBuffer(); int level = 100; serObject(str, level, bb); this.b = bb.toByteArray(); md5 = null; }
public void setDefaultAppearanceString(PdfContentByte cb) { byte[] b = cb.getInternalBuffer().toByteArray(); int len = b.length; for (int k = 0; k < len; ++k) { if (b[k] == '\n') { b[k] = 32; } } put(PdfName.DA, new PdfString(b)); }
public void setDefaultAppearanceString(PdfContentByte cb) { byte b[] = cb.getInternalBuffer().toByteArray(); int len = b.length; for (int k = 0; k < len; ++k) { if (b[k] == '\n') b[k] = 32; } put(PdfName.DA, new PdfString(b)); }
public void setDefaultAppearanceString(PdfContentByte cb) { byte b[] = cb.getInternalBuffer().toByteArray(); int len = b.length; for (int k = 0; k < len; ++k) { if (b[k] == '\n') b[k] = 32; } put(PdfName.DA, new PdfString(b)); }
/** * Gets the stream representing this object. * * @param compressionLevel the compressionLevel * @return the stream representing this template * @since 2.1.3 (replacing the method without param compressionLevel) */ PdfStream getFormXObject(int compressionLevel) { PdfStream s = new PdfStream(content.toByteArray()); s.put(PdfName.TYPE, PdfName.XOBJECT); s.put(PdfName.SUBTYPE, PdfName.PS); s.flateCompress(compressionLevel); return s; }
public static PdfObject createInfoId(byte id[]) { ByteBuffer buf = new ByteBuffer(90); buf.append('[').append('<'); for (int k = 0; k < 16; ++k) buf.appendHex(id[k]); buf.append('>').append('<'); id = createDocumentId(); for (int k = 0; k < 16; ++k) buf.appendHex(id[k]); buf.append('>').append(']'); return new PdfLiteral(buf.toByteArray()); }
public static PdfObject createInfoId(byte[] id) { ByteBuffer buf = new ByteBuffer(90); buf.append('[').append('<'); for (int k = 0; k < 16; ++k) buf.appendHex(id[k]); buf.append('>').append('<'); id = createDocumentId(); for (int k = 0; k < 16; ++k) buf.appendHex(id[k]); buf.append('>').append(']'); return new PdfLiteral(buf.toByteArray()); }
public static PdfObject createInfoId(byte id[]) { ByteBuffer buf = new ByteBuffer(90); buf.append('[').append('<'); for (int k = 0; k < 16; ++k) buf.appendHex(id[k]); buf.append('>').append('<'); id = createDocumentId(); for (int k = 0; k < 16; ++k) buf.appendHex(id[k]); buf.append('>').append(']'); return new PdfLiteral(buf.toByteArray()); }
private void flushObjStm() throws IOException { if (numObj == 0) return; int first = index.size(); index.append(streamObjects); PdfStream stream = new PdfStream(index.toByteArray()); stream.flateCompress(writer.getCompressionLevel()); stream.put(PdfName.TYPE, PdfName.OBJSTM); stream.put(PdfName.N, new PdfNumber(numObj)); stream.put(PdfName.FIRST, new PdfNumber(first)); add(stream, currentObjNum); index = null; streamObjects = null; numObj = 0; }