/** * Construct a new <CODE>PdfAction</CODE> of Subtype URI that accepts the x and y coordinate of the position that was clicked. * @param url * @param isMap */ public PdfAction(String url, boolean isMap) { put(PdfName.S, PdfName.URI); put(PdfName.URI, new PdfString(url)); if (isMap) put(PdfName.ISMAP, PdfBoolean.PDFTRUE); }
/** * Construct a new <CODE>PdfAction</CODE> of Subtype URI that accepts the x and y coordinate of the position that was clicked. * @param url * @param isMap */ public PdfAction(String url, boolean isMap) { put(PdfName.S, PdfName.URI); put(PdfName.URI, new PdfString(url)); if (isMap) put(PdfName.ISMAP, PdfBoolean.PDFTRUE); }
/** * A Hide action hides or shows an object. * @param obj object to hide or show * @param hide true is hide, false is show * @return a Hide Action */ static PdfAction createHide(PdfObject obj, boolean hide) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.HIDE); action.put(PdfName.T, obj); if (!hide) action.put(PdfName.H, PdfBoolean.PDFFALSE); return action; }
/** * A Hide action hides or shows an object. * @param obj object to hide or show * @param hide true is hide, false is show * @return a Hide Action */ static PdfAction createHide(PdfObject obj, boolean hide) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.HIDE); action.put(PdfName.T, obj); if (!hide) action.put(PdfName.H, PdfBoolean.PDFFALSE); return action; }
/** * Constructs a new <CODE>PdfAction</CODE> of Subtype GoToR. * @param filename the file name to go to * @param name the named destination to go to */ public PdfAction(String filename, String name) { put(PdfName.S, PdfName.GOTOR); put(PdfName.F, new PdfString(filename)); put(PdfName.D, new PdfString(name)); }
/** * Constructs a new <CODE>PdfAction</CODE> of Subtype GoToR. * @param filename the file name to go to * @param page the page destination to go to */ public PdfAction(String filename, int page) { put(PdfName.S, PdfName.GOTOR); put(PdfName.F, new PdfString(filename)); put(PdfName.D, new PdfLiteral("[" + (page - 1) + " /FitH 10000]")); }
/** * Constructs a new <CODE>PdfAction</CODE> of Subtype GoToR. * @param filename the file name to go to * @param name the named destination to go to */ public PdfAction(String filename, String name) { put(PdfName.S, PdfName.GOTOR); put(PdfName.F, new PdfString(filename)); put(PdfName.D, new PdfString(name)); }
/** * Constructs a new <CODE>PdfAction</CODE> of Subtype GoToR. * @param filename the file name to go to * @param page the page destination to go to */ public PdfAction(String filename, int page) { put(PdfName.S, PdfName.GOTOR); put(PdfName.F, new PdfString(filename)); put(PdfName.D, new PdfLiteral("[" + (page - 1) + " /FitH 10000]")); }
public static PdfAction gotoRemotePage(String filename, String dest, boolean isName, boolean newWindow) { PdfAction action = new PdfAction(); action.put(PdfName.F, new PdfString(filename)); action.put(PdfName.S, PdfName.GOTOR); if (isName) action.put(PdfName.D, new PdfName(dest)); else action.put(PdfName.D, new PdfString(dest, PdfObject.TEXT_UNICODE)); if (newWindow) action.put(PdfName.NEWWINDOW, PdfBoolean.PDFTRUE); return action; }
/** * Creates a resetform. * @param names the objects to reset * @param flags submit properties * @return A PdfAction */ public static PdfAction createResetForm(Object names[], int flags) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.RESETFORM); if (names != null) action.put(PdfName.FIELDS, buildArray(names)); action.put(PdfName.FLAGS, new PdfNumber(flags)); return action; }
/** * Creates a resetform. * @param names the objects to reset * @param flags submit properties * @return A PdfAction */ public static PdfAction createResetForm(Object names[], int flags) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.RESETFORM); if (names != null) action.put(PdfName.FIELDS, buildArray(names)); action.put(PdfName.FLAGS, new PdfNumber(flags)); return action; }
/** * Creates a GoTo action to a named destination. * @param dest the named destination * @param isName if true sets the destination as a name, if false sets it as a String * @return a GoTo action */ public static PdfAction gotoLocalPage(String dest, boolean isName) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.GOTO); if (isName) action.put(PdfName.D, new PdfName(dest)); else action.put(PdfName.D, new PdfString(dest, PdfObject.TEXT_UNICODE)); return action; }
/** * Creates a GoTo action to a named destination. * @param dest the named destination * @param isName if true sets the destination as a name, if false sets it as a String * @return a GoTo action */ public static PdfAction gotoLocalPage(String dest, boolean isName) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.GOTO); if (isName) action.put(PdfName.D, new PdfName(dest)); else action.put(PdfName.D, new PdfString(dest, PdfObject.TEXT_UNICODE)); return action; }
/**Creates a Rendition action * @param file * @param fs * @param mimeType * @param ref * @return a Media Clip action * @throws IOException */ public static PdfAction rendition(String file, PdfFileSpecification fs, String mimeType, PdfIndirectReference ref) throws IOException { PdfAction js = new PdfAction(); js.put(PdfName.S, PdfName.RENDITION); js.put(PdfName.R, new PdfRendition(file, fs, mimeType)); js.put(new PdfName("OP"), new PdfNumber(0)); js.put(new PdfName("AN"), ref); return js; }
/** Creates a GoTo action to an internal page. * @param page the page to go. First page is 1 * @param dest the destination for the page * @param writer the writer for this action * @return a GoTo action */ public static PdfAction gotoLocalPage(int page, PdfDestination dest, PdfWriter writer) { PdfIndirectReference ref = writer.getPageReference(page); PdfDestination d = new PdfDestination(dest); d.addPage(ref); PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.GOTO); action.put(PdfName.D, d); return action; }
/** Creates a GoTo action to an internal page. * @param page the page to go. First page is 1 * @param dest the destination for the page * @param writer the writer for this action * @return a GoTo action */ public static PdfAction gotoLocalPage(int page, PdfDestination dest, PdfWriter writer) { PdfIndirectReference ref = writer.getPageReference(page); PdfDestination d = new PdfDestination(dest); d.addPage(ref); PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.GOTO); action.put(PdfName.D, d); return action; }