/** * This will set the application to be launched or the document * to be opened or printed. It is required if none of the entries * Win, Mac or Unix is present. If this entry is absent and the * viewer application does not understand any of the alternative * entries it should do nothing. * * @param fs The file specification. */ public void setFile( PDFileSpecification fs ) { getCOSObject().setItem(COSName.F, fs); }
/** * This will specify whether to open the destination document in a new window, in the same * window, or behave in accordance with the current user preference. * * @return A flag specifying how to open the destination document. */ public OpenMode getOpenInNewWindow() { if (getCOSObject().getDictionaryObject(COSName.NEW_WINDOW) instanceof COSBoolean) { COSBoolean b = (COSBoolean) getCOSObject().getDictionaryObject(COSName.NEW_WINDOW); return b.getValue() ? OpenMode.NEW_WINDOW : OpenMode.SAME_WINDOW; } return OpenMode.USER_PREFERENCE; }
/** * This will specify whether to open the destination document in a new window. * * @param value The flag value. */ public void setOpenInNewWindow(OpenMode value) { if (null == value) { getCOSObject().removeItem(COSName.NEW_WINDOW); return; } switch (value) { case USER_PREFERENCE: getCOSObject().removeItem(COSName.NEW_WINDOW); break; case SAME_WINDOW: getCOSObject().setBoolean(COSName.NEW_WINDOW, false); break; case NEW_WINDOW: getCOSObject().setBoolean(COSName.NEW_WINDOW, true); break; default: // shouldn't happen unless the enum type is changed break; } } }
/** * This will get the application to be launched or the document * to be opened or printed. It is required if none of the entries * Win, Mac or Unix is present. If this entry is absent and the * viewer application does not understand any of the alternative * entries it should do nothing. * * @return The F entry of the specific launch action dictionary. * * @throws IOException If there is an error creating the file spec. */ public PDFileSpecification getFile() throws IOException { return PDFileSpecification.createFS(getCOSObject().getDictionaryObject(COSName.F)); }
/** * This will set the application to be launched or the document * to be opened or printed. It is required if none of the entries * Win, Mac or Unix is present. If this entry is absent and the * viewer application does not understand any of the alternative * entries it should do nothing. * * @param fs The file specification. */ public void setFile( PDFileSpecification fs ) { getCOSObject().setItem(COSName.F, fs); }
/** * This will set the application to be launched or the document * to be opened or printed. It is required if none of the entries * Win, Mac or Unix is present. If this entry is absent and the * viewer application does not understand any of the alternative * entries it should do nothing. * * @param fs The file specification. */ public void setFile( PDFileSpecification fs ) { getCOSObject().setItem(COSName.F, fs); }
/** * This will specify whether to open the destination document in a new window, in the same * window, or behave in accordance with the current user preference. * * @return A flag specifying how to open the destination document. */ public OpenMode getOpenInNewWindow() { if (getCOSObject().getDictionaryObject(COSName.NEW_WINDOW) instanceof COSBoolean) { COSBoolean b = (COSBoolean) getCOSObject().getDictionaryObject(COSName.NEW_WINDOW); return b.getValue() ? OpenMode.NEW_WINDOW : OpenMode.SAME_WINDOW; } return OpenMode.USER_PREFERENCE; }
/** * This will specify whether to open the destination document in a new window. * * @param value The flag value. */ public void setOpenInNewWindow(OpenMode value) { if (null == value) { getCOSObject().removeItem(COSName.NEW_WINDOW); return; } switch (value) { case USER_PREFERENCE: getCOSObject().removeItem(COSName.NEW_WINDOW); break; case SAME_WINDOW: getCOSObject().setBoolean(COSName.NEW_WINDOW, false); break; case NEW_WINDOW: getCOSObject().setBoolean(COSName.NEW_WINDOW, true); break; default: // shouldn't happen unless the enum type is changed break; } } }
/** * This will get the application to be launched or the document * to be opened or printed. It is required if none of the entries * Win, Mac or Unix is present. If this entry is absent and the * viewer application does not understand any of the alternative * entries it should do nothing. * * @return The F entry of the specific launch action dictionary. * * @throws IOException If there is an error creating the file spec. */ public PDFileSpecification getFile() throws IOException { return PDFileSpecification.createFS(getCOSObject().getDictionaryObject(COSName.F)); }
/** * This will get the application to be launched or the document * to be opened or printed. It is required if none of the entries * Win, Mac or Unix is present. If this entry is absent and the * viewer application does not understand any of the alternative * entries it should do nothing. * * @return The F entry of the specific launch action dictionary. * * @throws IOException If there is an error creating the file spec. */ public PDFileSpecification getFile() throws IOException { return PDFileSpecification.createFS(getCOSObject().getDictionaryObject(COSName.F)); }