/** * Changes the content of this <CODE>PdfObject</CODE>. * * @param content the new content of this <CODE>PdfObject</CODE> */ protected void setContent(String content) { bytes = PdfEncodings.convertToBytes(content, null); }
/** Sets the text that will form the barcode. This text is converted * to bytes using the encoding Cp437. * @param s the text that will form the barcode */ public void setText(String s) { this.text = PdfEncodings.convertToBytes(s, "cp437"); }
/** * Constructs a <CODE>PdfObject</CODE> of a certain <VAR>type</VAR> * with a certain <VAR>content</VAR>. * * @param type type of the new <CODE>PdfObject</CODE> * @param content content of the new <CODE>PdfObject</CODE> as a * <CODE>String</CODE>. */ protected PdfObject(int type, String content) { this.type = type; bytes = PdfEncodings.convertToBytes(content, null); }
/** Sets the text that will form the barcode. This text is converted * to bytes using the encoding Cp437. * @param s the text that will form the barcode */ public void setText(String s) { this.text = PdfEncodings.convertToBytes(s, "cp437"); }
/** * Constructs a <CODE>PdfObject</CODE> of a certain <VAR>type</VAR> * with a certain <VAR>content</VAR>. * * @param type type of the new <CODE>PdfObject</CODE> * @param content content of the new <CODE>PdfObject</CODE> as a * <CODE>String</CODE>. */ protected PdfObject(int type, String content) { this.type = type; bytes = PdfEncodings.convertToBytes(content, null); }
/** * Constructs a <CODE>PdfObject</CODE> of a certain <VAR>type</VAR> * with a certain <VAR>content</VAR>. * * @param type type of the new <CODE>PdfObject</CODE> * @param content content of the new <CODE>PdfObject</CODE> as a * <CODE>String</CODE>. */ protected PdfObject(int type, String content) { this.type = type; bytes = PdfEncodings.convertToBytes(content, null); }
protected void writeFontString(String s) { byte b[] = PdfEncodings.convertToBytes(s, BaseFont.WINANSI); System.arraycopy(b, 0, outFont, fontPtr, b.length); fontPtr += b.length; }
protected void writeFontString(String s) { byte b[] = PdfEncodings.convertToBytes(s, BaseFont.WINANSI); System.arraycopy(b, 0, outFont, fontPtr, b.length); fontPtr += b.length; }
protected void writeFontString(String s) { byte[] b = PdfEncodings.convertToBytes(s, BaseFont.WINANSI); System.arraycopy(b, 0, outFont, fontPtr, b.length); fontPtr += b.length; }
public byte[] getBytes() { if (bytes == null) { if (encoding != null && encoding.equals(TEXT_UNICODE) && PdfEncodings.isPdfDocEncoding(value)) bytes = PdfEncodings.convertToBytes(value, TEXT_PDFDOCENCODING); else bytes = PdfEncodings.convertToBytes(value, encoding); } return bytes; }
public byte[] getBytes() { if (bytes == null) { if (encoding != null && encoding.equals(TEXT_UNICODE) && PdfEncodings.isPdfDocEncoding(value)) bytes = PdfEncodings.convertToBytes(value, TEXT_PDFDOCENCODING); else bytes = PdfEncodings.convertToBytes(value, encoding); } return bytes; }
public byte[] getOriginalBytes() { if (originalValue == null) return getBytes(); return PdfEncodings.convertToBytes(originalValue, null); }
/** * @return The original bytes used to create this PDF string, or the bytes of our current value * if the original bytes are missing. */ public byte[] getOriginalBytes() { if (originalValue == null) return getBytes(); return PdfEncodings.convertToBytes(originalValue, null); }
public byte[] getOriginalBytes() { if (originalValue == null) return getBytes(); return PdfEncodings.convertToBytes(originalValue, null); }
private void append(String s) { byte[] bytes = PdfEncodings.convertToBytes(s, "cp437"); textCompaction(bytes, 0, bytes.length); }
private void append(int in, int len) { StringBuffer sb = new StringBuffer(len+1); sb.append(in); for(int i = sb.length(); i < len; i++) { sb.insert(0, "0"); } byte[] bytes = PdfEncodings.convertToBytes(sb.toString(), "cp437"); numberCompaction(bytes, 0, bytes.length); }
private void append(String s) { byte[] bytes = PdfEncodings.convertToBytes(s, "cp437"); textCompaction(bytes, 0, bytes.length); }
public void toPdf(PdfWriter writer, OutputStream os) throws IOException { int n = writer.getNewObjectNumber(reader, number, generation); os.write(PdfEncodings.convertToBytes(new StringBuffer().append(n).append(" 0 R").toString(), null)); }
public void toPdf(PdfWriter writer, OutputStream os) throws IOException { int n = writer.getNewObjectNumber(reader, number, generation); os.write(PdfEncodings.convertToBytes(new StringBuffer().append(n).append(" 0 R").toString(), null)); }
/** * Decrypt an encrypted <CODE>PdfString</CODE> */ void decrypt(PdfReader reader) { PdfEncryption decrypt = reader.getDecrypt(); if (decrypt != null) { originalValue = value; decrypt.setHashKey(objNum, objGen); bytes = PdfEncodings.convertToBytes(value, null); bytes = decrypt.decryptByteArray(bytes); value = PdfEncodings.convertToString(bytes, null); } }