PdfTarget extends PdfObjectWrapper<PdfDictionary> { public PdfTarget put(PdfName key, PdfObject value) { getPdfObject().put(key, value); return this; } private  PdfTarget(PdfDictionary pdfObject); static PdfTarget create(PdfDictionary pdfObject); static PdfTarget createParentTarget(); static PdfTarget createChildTarget(); static PdfTarget createChildTarget(String embeddedFileName); static PdfTarget createChildTarget(String namedDestination, String annotationIdentifier); static PdfTarget createChildTarget(int pageNumber, int annotationIndex); PdfTarget setName(String name); String getName(); PdfTarget setAnnotation(PdfFileAttachmentAnnotation pdfAnnotation, PdfDocument pdfDocument); PdfFileAttachmentAnnotation getAnnotation(PdfDocument pdfDocument); PdfTarget setTarget(PdfTarget target); PdfTarget getTarget(); PdfTarget put(PdfName key, PdfObject value);  }
@Test public void putTest() { final PdfName key1 = new PdfName("Key1"); final PdfName key2 = new PdfName("Key2"); final PdfDictionary dictionary = new PdfDictionary(); PdfTarget target = PdfTarget.create(dictionary); target.put(key1, new PdfNumber(23)) .put(key2, new PdfString("Hello, world!")); Assert.assertEquals(23, dictionary.getAsNumber(key1).intValue()); Assert.assertEquals("Hello, world!", dictionary.getAsString(key2).getValue()); }