예제 #1
0
        /**
         * Creates a GoToE action to an embedded file.
         * @param filename   the root document of the target (null if the target is in the same document)
         * @param target a path to the target document of this action
         * @param dest       the destination inside the target document, can be of type PdfDestination, PdfName, or PdfString
         * @param newWindow  if true, the destination document should be opened in a new window
         * @return a GoToE action
         */
        public static PdfAction GotoEmbedded(String filename, PdfTargetDictionary target, PdfObject dest, bool newWindow)
        {
            PdfAction action = new PdfAction();

            action.Put(PdfName.S, PdfName.GOTOE);
            action.Put(PdfName.T, target);
            action.Put(PdfName.D, dest);
            action.Put(PdfName.NEWWINDOW, new PdfBoolean(newWindow));
            if (filename != null)
            {
                action.Put(PdfName.F, new PdfString(filename));
            }
            return(action);
        }