public void init() {

        if (inited) {
            return;
        }
        inited = true;

        // 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) {
                }
            }
        }
        // some encoders set the step to 2^15
        if (xStep == Short.MAX_VALUE) {
            xStep = (float) bBox.getWidth();
        }
        if (yStep == Short.MAX_VALUE) {
            yStep = (float) bBox.getHeight();
        }
        // adjust the bBox so that xStep and yStep can be applied
        // for tile spacing.
        bBoxMod = new Rectangle2D.Double(
                bBox.getX(), bBox.getY(),
                bBox.getWidth() == xStep ? bBox.getWidth() : xStep,
                bBox.getHeight() == yStep ? bBox.getHeight() : yStep);
        bBoxMod = matrix.createTransformedShape(bBoxMod).getBounds2D();
    }