1 50 51 package com.lowagie.text.pdf; 52 53 56 57 public class PdfLiteral extends PdfObject { 58 59 62 private int position; 63 64 public PdfLiteral(String text) { 65 super(0, text); 66 } 67 68 public PdfLiteral(byte b[]) { 69 super(0, b); 70 } 71 72 public PdfLiteral(int size) { 73 super(0, (byte[])null); 74 bytes = new byte[size]; 75 java.util.Arrays.fill(bytes, (byte)32); 76 } 77 78 public PdfLiteral(int type, String text) { 79 super(type, text); 80 } 81 82 public PdfLiteral(int type, byte b[]) { 83 super(type, b); 84 } 85 86 public void toPdf(PdfWriter writer, java.io.OutputStream os) throws java.io.IOException { 87 if (os instanceof OutputStreamCounter) 88 position = ((OutputStreamCounter)os).getCounter(); 89 super.toPdf(writer, os); 90 } 91 92 96 public int getPosition() { 97 return this.position; 98 } 99 100 104 public int getPosLength() { 105 if (bytes != null) 106 return bytes.length; 107 else 108 return 0; 109 } 110 111 } | Popular Tags |