class PdfImportedLink {

        float llx, lly, urx, ury;
        HashMap<PdfName, PdfObject> parameters = new HashMap<>();
        PdfArray destination;
        int newPage = 0;

        PdfImportedLink(PdfDictionary annotation) {
            parameters.putAll(annotation.hashMap);
            try {
                destination = (PdfArray) parameters.remove(PdfName.DEST);
            } catch (ClassCastException ex) {
                throw new IllegalArgumentException(
                        MessageLocalization.getComposedMessage(
                                "you.have.to.consolidate.the.named.destinations.of.your.reader"));
            }
            if (destination != null) {
                destination = new PdfArray(destination);
            }
            PdfArray rc = (PdfArray) parameters.remove(PdfName.RECT);
            llx = rc.getAsNumber(0).floatValue();
            lly = rc.getAsNumber(1).floatValue();
            urx = rc.getAsNumber(2).floatValue();
            ury = rc.getAsNumber(3).floatValue();
        }

        public boolean isInternal() {
            return destination != null;
        }

        public int getDestinationPage() {<FILL_FUNCTION_BODY>}

        public void setDestinationPage(int newPage) {
            if (!isInternal()) {
                throw new IllegalArgumentException(
                        MessageLocalization.getComposedMessage("cannot.change.destination.of.external.link"));
            }
            this.newPage = newPage;
        }

        public void transformDestination(float a, float b, float c, float d, float e, float f) {
            if (!isInternal()) {
                throw new IllegalArgumentException(
                        MessageLocalization.getComposedMessage("cannot.change.destination.of.external.link"));
            }
            if (destination.getAsName(1).equals(PdfName.XYZ)) {
                float x = destination.getAsNumber(2).floatValue();
                float y = destination.getAsNumber(3).floatValue();
                float xx = x * a + y * c + e;
                float yy = x * b + y * d + f;
                destination.set(2, new PdfNumber(xx));
                destination.set(3, new PdfNumber(yy));
            }
        }

        public void transformRect(float a, float b, float c, float d, float e, float f) {
            float x = llx * a + lly * c + e;
            float y = llx * b + lly * d + f;
            llx = x;
            lly = y;
            x = urx * a + ury * c + e;
            y = urx * b + ury * d + f;
            urx = x;
            ury = y;
        }

        public PdfAnnotation createAnnotation(PdfWriter writer) {
            PdfAnnotation annotation = new PdfAnnotation(writer, new Rectangle(llx, lly, urx, ury));
            if (newPage != 0) {
                PdfIndirectReference ref = writer.getPageReference(newPage);
                destination.set(0, ref);
            }
            if (destination != null) {
                annotation.put(PdfName.DEST, destination);
            }
            annotation.hashMap.putAll(parameters);
            return annotation;
        }

        /**
         * Returns a String representation of the link.
         *
         * @return a String representation of the imported link
         * @since 2.1.6
         */
        public String toString() {
            StringBuilder buf = new StringBuilder("Imported link: location [");
            buf.append(llx);
            buf.append(' ');
            buf.append(lly);
            buf.append(' ');
            buf.append(urx);
            buf.append(' ');
            buf.append(ury);
            buf.append("] destination ");
            buf.append(destination);
            buf.append(" parameters ");
            buf.append(parameters);
            return buf.toString();
        }
    }

            if (!isInternal()) {
                return 0;
            }

            // here destination is something like
            // [132 0 R, /XYZ, 29.3898, 731.864502, null]
            PdfIndirectReference ref = destination.getAsIndirectObject(0);

            PRIndirectReference pr = (PRIndirectReference) ref;
            PdfReader r = pr.getReader();
            for (int i = 1; i <= r.getNumberOfPages(); i++) {
                PRIndirectReference pp = r.getPageOrigRef(i);
                if (pp.getGeneration() == pr.getGeneration() && pp.getNumber() == pr.getNumber()) {
                    return i;
                }
            }
            throw new IllegalArgumentException(MessageLocalization.getComposedMessage("page.not.found"));
        
<methods>public void <init>() ,public void <init>(com.lowagie.text.pdf.PdfName) ,public void clear() ,public boolean contains(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfObject get(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfArray getAsArray(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfBoolean getAsBoolean(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfDictionary getAsDict(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfIndirectReference getAsIndirectObject(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfName getAsName(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfNumber getAsNumber(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfStream getAsStream(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfString getAsString(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfObject getDirectObject(com.lowagie.text.pdf.PdfName) ,public Set<com.lowagie.text.pdf.PdfName> getKeys() ,public Set<Entry<com.lowagie.text.pdf.PdfName,com.lowagie.text.pdf.PdfObject>> getKeysAndValues() ,public boolean isCatalog() ,public boolean isFont() ,public boolean isOutlineTree() ,public boolean isPage() ,public boolean isPages() ,public void merge(com.lowagie.text.pdf.PdfDictionary) ,public void mergeDifferent(com.lowagie.text.pdf.PdfDictionary) ,public void put(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject) ,public void putAll(com.lowagie.text.pdf.PdfDictionary) ,public void putEx(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject) ,public void remove(com.lowagie.text.pdf.PdfName) ,public int size() ,public void toPdf(com.lowagie.text.pdf.PdfWriter, java.io.OutputStream) throws java.io.IOException,public java.lang.String toString() <variables>public static final com.lowagie.text.pdf.PdfName CATALOG,public static final com.lowagie.text.pdf.PdfName FONT,public static final com.lowagie.text.pdf.PdfName OUTLINES,public static final com.lowagie.text.pdf.PdfName PAGE,public static final com.lowagie.text.pdf.PdfName PAGES,private com.lowagie.text.pdf.PdfName dictionaryType,protected Map<com.lowagie.text.pdf.PdfName,com.lowagie.text.pdf.PdfObject> hashMap