PdfArray extends PdfObject implements Iterable<PdfObject> { public void add(PdfObject pdfObject) { list.add(pdfObject); } PdfArray();  PdfArray(PdfObject obj);  PdfArray(PdfArray arr);  PdfArray(Rectangle rectangle);  PdfArray(List<? extends PdfObject> objects);  PdfArray(float[] numbers);  PdfArray(double[] numbers);  PdfArray(int[] numbers);  PdfArray(boolean[] values);  PdfArray(List<String> strings, boolean asNames);  PdfArray(Iterable<? extends PdfObject> objects, int initialCapacity); int size(); boolean isEmpty(); boolean contains(PdfObject o); Iterator<PdfObject> iterator(); void add(PdfObject pdfObject); void add(int index, PdfObject element); PdfObject set(int index, PdfObject element); void addAll(Collection<PdfObject> c); void addAll(PdfArray a); PdfObject get(int index); void remove(int index); void remove(PdfObject o); void clear(); int indexOf(PdfObject o); List<PdfObject> subList(int fromIndex, int toIndex); @Override byte getType(); @Override String toString(); PdfObject get(int index, boolean asDirect); PdfArray getAsArray(int index); PdfDictionary getAsDictionary(int index); PdfStream getAsStream(int index); PdfNumber getAsNumber(int index); PdfName getAsName(int index); PdfString getAsString(int index); PdfBoolean getAsBoolean(int index); Rectangle toRectangle(); float[] toFloatArray(); double[] toDoubleArray(); long[] toLongArray(); int[] toIntArray(); boolean[] toBooleanArray();  }
@Test public void pdfUncoloredPatternColorSize1Test() { PdfDocument pdfDocument = new PdfDocument(new PdfWriter(new ByteArrayOutputStream())); String contentColorSpace = "/Cs1 cs\n"; PdfDictionary pageDictionary = (PdfDictionary) new PdfDictionary().makeIndirect(pdfDocument); PdfStream contentStream = new PdfStream(contentColorSpace.getBytes()); pageDictionary.put(PdfName.Contents, contentStream); PdfPage page = pdfDocument.addNewPage(); page.getPdfObject().put(PdfName.Contents, contentStream); PdfArray pdfArray = new PdfArray(); pdfArray.add(PdfName.Pattern); PdfColorSpace space = PdfColorSpace.makeColorSpace(pdfArray); page.getResources().addColorSpace(space); Rectangle rectangle = new Rectangle(50, 50, 1000, 1000); page.setMediaBox(rectangle); PdfCanvasProcessor processor = new PdfCanvasProcessor(new NoOpListener()); processor.processPageContent(page); Assert.assertTrue(processor.getGraphicsState().getFillColor().getColorSpace() instanceof PdfSpecialCs.Pattern); }