public void init() {

        if (inited) {
            return;
        }

        // try and find the form's resources dictionary.
        Resources leafResources = library.getResources(entries, "Resources");
        // apply resource for tiling if any, otherwise we use the default dictionary.
        if (leafResources != null) {
            resources = leafResources;
//            resources.addReference(this);
            //  todo, need a way do dispose of reference when we implement this fully
        }

        // Build a new content parser for the content streams and apply the
        // content stream of the calling content stream.
        ContentParser cp = new ContentParser(library, leafResources);
        cp.setGraphicsState(parentGraphicState);
        InputStream in = getInputStreamForDecodedStreamBytes();
        if (in != null) {
            try {
                shapes = cp.parse(in);
            }
            catch (Throwable e) {
                logger.log(Level.FINE, "Error processing tiling pattern.", e);
            }
            finally {
                try {
                    in.close();
                }
                catch (IOException e) {
                }
            }
        }
    }