@Test public void testCreateAndUpdateXMP() throws IOException { String created = destinationFolder + "testCreateAndUpdateXMP_create.pdf"; String updated = destinationFolder + "testCreateAndUpdateXMP_update.pdf"; PdfDocument pdfDocument = new PdfDocument(new PdfWriter(created)); pdfDocument.addNewPage(); pdfDocument.getXmpMetadata(true); pdfDocument.close(); pdfDocument = new PdfDocument(new PdfReader(created), new PdfWriter(updated)); PdfXrefTable xref = pdfDocument.getXref(); PdfDictionary catalog = pdfDocument.getCatalog().getPdfObject(); ((PdfIndirectReference)catalog.remove(PdfName.Metadata)).setFree(); PdfIndirectReference ref0 = xref.get(0); PdfIndirectReference freeRef = xref.get(6); pdfDocument.close(); Assert.assertTrue(freeRef.isFree()); Assert.assertEquals(ref0.offsetOrIndex, freeRef.objNr); Assert.assertEquals(1, freeRef.genNr); }
public PdfIndirectReference get(int index) { if (index > count) { return null; } return xref[index]; }
PdfXrefTable implements Serializable { public PdfIndirectReference get(int index) { if (index > count) { return null; } return xref[index]; } }
PdfXrefTable implements Serializable { public PdfIndirectReference get(int index) { if (index > count) { return null; } return xref[index]; } PdfXrefTable();  PdfXrefTable(int capacity); }
PdfXrefTable implements Serializable { public PdfIndirectReference get(int index) { if (index > count) { return null; } return xref[index]; } PdfXrefTable();  PdfXrefTable(int capacity); PdfIndirectReference add(PdfIndirectReference reference); int size(); int getCountOfIndirectObjects(); PdfIndirectReference get(int index); }
PdfXrefTable implements Serializable { public PdfIndirectReference get(int index) { if (index > count) { return null; } return xref[index]; } PdfXrefTable();  PdfXrefTable(int capacity); PdfIndirectReference add(PdfIndirectReference reference); int size(); int getCountOfIndirectObjects(); PdfIndirectReference get(int index);  }