class InspectPDF extends AbstractTool {

    static {
        addVersion("$Id: InspectPDF.java 3826 2009-03-31 17:46:18Z blowagie $");
    }

    /**
     * Constructs an InpectPDF object.
     */
    public InspectPDF() {
        arguments.add(new FileArgument(this, "srcfile", "The file you want to inspect", false, new PdfFilter()));
        arguments.add(new StringArgument(this, "ownerpassword", "The owner password if the file is encrypt"));
    }

    /**
     * Inspects an existing PDF file.
     *
     * @param args String[]
     */
    public static void main(String[] args) {<FILL_FUNCTION_BODY>}

    /**
     * @see com.lowagie.toolbox.AbstractTool#createFrame()
     */
    protected void createFrame() {
        internalFrame = new JInternalFrame("Pdf Information", true, false, true);
        internalFrame.setSize(300, 80);
        internalFrame.setJMenuBar(getMenubar());
        System.out.println("=== Pdf Information OPENED ===");
    }

    /**
     * @see com.lowagie.toolbox.AbstractTool#execute()
     */
    public void execute() {
        try {
            if (getValue("srcfile") == null) {
                throw new InstantiationException("You need to choose a sourcefile");
            }
            PdfReader reader;
            if (getValue("ownerpassword") == null) {
                reader = new PdfReader(((File) getValue("srcfile")).getAbsolutePath());
            } else {
                reader = new PdfReader(((File) getValue("srcfile")).getAbsolutePath(),
                        ((String) getValue("ownerpassword")).getBytes());
            }
            // Some general document information and page size
            System.out.println("=== Document Information ===");
            System.out.println("PDF Version: " + reader.getPdfVersion());
            System.out.println("Number of pages: " + reader.getNumberOfPages());
            System.out.println("Number of PDF objects: " + reader.getXrefSize());
            System.out.println("File length: " + reader.getFileLength());
            System.out.println("Encrypted? " + reader.isEncrypted());
            if (reader.isEncrypted()) {
                System.out.println("Permissions: " + PdfEncryptor.getPermissionsVerbose(reader.getPermissions()));
                System.out.println("128 bit? " + reader.is128Key());
            }
            System.out.println("Rebuilt? " + reader.isRebuilt());
            // Some metadata
            System.out.println("=== Metadata ===");
            Map<String, String> info = reader.getInfo();
            String key;
            String value;
            for (Map.Entry<String, String> entry : info.entrySet()) {
                key = entry.getKey();
                value = entry.getValue();
                System.out.println(key + ": " + value);
            }
            if (reader.getMetadata() == null) {
                System.out.println("There is no XML Metadata in the file");
            } else {
                System.out.println("XML Metadata: " + new String(reader.getMetadata()));
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(internalFrame,
                    e.getMessage(),
                    e.getClass().getName(),
                    JOptionPane.ERROR_MESSAGE);
            System.err.println(e.getMessage());
        }
    }

    /**
     * @param arg StringArgument
     * @see com.lowagie.toolbox.AbstractTool#valueHasChanged(com.lowagie.toolbox.arguments.AbstractArgument)
     */
    public void valueHasChanged(AbstractArgument arg) {
        if (internalFrame == null) {
            // if the internal frame is null, the tool was called from the command line
            return;
        }
        // represent the changes of the argument in the internal frame
    }

    /**
     * @return File
     * @throws InstantiationException on error
     * @see com.lowagie.toolbox.AbstractTool#getDestPathPDF()
     */
    protected File getDestPathPDF() throws InstantiationException {
        throw new InstantiationException("There is no file to show.");
    }

}

        InspectPDF tool = new InspectPDF();
        if (args.length < 1) {
            System.err.println(tool.getUsage());
        }
        tool.setMainArguments(args);
        tool.execute();
    
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String getUsage() ,public java.lang.Object getValue(java.lang.String) throws java.lang.InstantiationException,public void setArguments(ArrayList<com.lowagie.toolbox.arguments.AbstractArgument>) ,public void setInternalFrame(javax.swing.JInternalFrame) ,public void setMainArguments(java.lang.String[]) ,public void setMenubar(javax.swing.JMenuBar) ,public abstract void valueHasChanged(com.lowagie.toolbox.arguments.AbstractArgument) <variables>public static final int MENU_EXECUTE,public static final int MENU_EXECUTE_PRINT,public static final int MENU_EXECUTE_PRINT_SILENT,public static final int MENU_EXECUTE_SHOW,protected ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> arguments,private java.awt.Desktop awtdesktop,protected javax.swing.JInternalFrame internalFrame,private javax.swing.JMenuBar menubar,protected int menuoptions,public static ArrayList<java.lang.String> versionsarray