/** * Adds a Collection field to the Schema. * @param name the name of the collection field * @param field a Collection Field */ public void addField(String name, PdfCollectionField field) { put(new PdfName(name), field); } }
/** Sets the field value as a name. * @param field the fully qualified field name * @param value the value * @return <CODE>true</CODE> if the value was inserted, * <CODE>false</CODE> if the name is incompatible with * an existing field */ public boolean setFieldAsName(String field, String value) { return setField(field, new PdfName(value)); }
/** * Constructs a new <CODE>Section</CODE>. * * @param title a <CODE>Paragraph</CODE> * @param numberDepth the numberDepth */ protected Section(final Paragraph title, final int numberDepth) { this.numberDepth = numberDepth; this.title = title; if (title != null) title.setRole(new PdfName("H" + numberDepth)); }
/** * Called when no resource name is provided in our constructor. This generates a * name that is required to be unique within a given resource dictionary. * @since 5.0.1 */ private void generateImgResName( Image img ) { name = new PdfName( "img" + Long.toHexString( img.getMySerialId() ) ); } }
/** * Constructs a PDF Collection Sort Dictionary. * @param key the key of the field that will be used to sort entries */ public PdfCollectionSort(String key) { super(PdfName.COLLECTIONSORT); put(PdfName.S, new PdfName(key)); }
PdfName addSimplePattern(final PdfPatternPainter painter) { PdfName name = documentPatterns.get(painter); try { if ( name == null ) { name = new PdfName("P" + patternNumber); ++patternNumber; documentPatterns.put(painter, name); } } catch (Exception e) { throw new ExceptionConverter(e); } return name; }
/** * Constructs a PDF Collection Sort Dictionary. * @param key the key of the field that will be used to sort entries */ public PdfCollectionSort(String key) { super(PdfName.COLLECTIONSORT); put(PdfName.S, new PdfName(key)); }
/** * Called when no resource name is provided in our constructor. This generates a * name that is required to be unique within a given resource dictionary. * @since 5.0.1 */ private void generateImgResName( Image img ) { name = new PdfName( "img" + Long.toHexString( img.getMySerialId() ) ); } }
/** Sets the field value as a name. * @param field the fully qualified field name * @param value the value * @return <CODE>true</CODE> if the value was inserted, * <CODE>false</CODE> if the name is incompatible with * an existing field */ public boolean setFieldAsName(String field, String value) { return setField(field, new PdfName(value)); }
/** * Constructs a new <CODE>Section</CODE>. */ protected Section() { title = new Paragraph(); numberDepth = 1; title.setRole(new PdfName("H" + numberDepth)); }
/** * Sets the value of the collection item. * @param n */ public void addItem(String key, PdfNumber n) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.NUMBER) { put(fieldname, n); } }
/** * Sets the value of the collection item. * @param value */ public void addItem(String key, PdfString value) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.TEXT) { put(fieldname, value); } }
/** * Sets the value of the collection item. * @param n */ public void addItem(String key, PdfNumber n) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.NUMBER) { put(fieldname, n); } }
public void setAppearanceState(String state) { if (state == null) { remove(PdfName.AS); return; } put(PdfName.AS, new PdfName(state)); }
private PdfDictionary getFontBaseType(PdfIndirectReference CIDFont) { PdfDictionary dic = new PdfDictionary(PdfName.FONT); dic.put(PdfName.SUBTYPE, PdfName.TYPE0); String name = fontName; if (style.length() > 0) name += "-" + style.substring(1); name += "-" + CMap; dic.put(PdfName.BASEFONT, new PdfName(name)); dic.put(PdfName.ENCODING, new PdfName(CMap)); dic.put(PdfName.DESCENDANTFONTS, new PdfArray(CIDFont)); return dic; }
/** * Sets the value of the collection item. * @param value */ public void addItem(String key, String value) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); put(fieldname, field.getValue(value)); }
/** * Constructs a PDF Collection Sort Dictionary. * @param keys the keys of the fields that will be used to sort entries */ public PdfCollectionSort(String[] keys) { super(PdfName.COLLECTIONSORT); PdfArray array = new PdfArray(); for (int i = 0; i < keys.length; i++) { array.add(new PdfName(keys[i])); } put(PdfName.S, array); }
/** * Sets the value of the collection item. * @param value */ public void addItem(String key, String value) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); put(fieldname, field.getValue(value)); }
PdfRendition(String file, PdfFileSpecification fs, String mimeType) throws IOException{ put(PdfName.S, new PdfName("MR")); put(PdfName.N, new PdfString("Rendition for "+file)); put(PdfName.C, new PdfMediaClipData(file, fs, mimeType)); }
private void createBlankN0() { PdfTemplate t = app[0] = new PdfTemplate(writer); t.setBoundingBox(new Rectangle(100, 100)); writer.addDirectTemplateSimple(t, new PdfName("n0")); t.setLiteral("% DSBlank\n"); }