Chained Actions : PDF Action « PDF RTF « Java

Chained Actions

Chained Actions

import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfAction;
import com.lowagie.text.pdf.PdfWriter;

public class ChainedActionsPDF {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("ChainedActionsPDF.pdf"));;
      PdfAction action = PdfAction.javaScript("app.alert('Welcome at my site');\r", writer); PdfAction(""));
      Paragraph p = new Paragraph(new Chunk("Click to go to a website").setAction(action));
    } catch (Exception de) {
       1,748 k)

Related examples in the same category

1.PdfAction: Goto Another Pdf FilePdfAction: Goto Another Pdf File
2.PdfAction: Goto Local Page 1PdfAction: Goto Local Page 1
3.PdfAction: Goto Local Page 2PdfAction: Goto Local Page 2
4.Pdf action: open application (notepad.exe)Pdf action: open application (notepad.exe)
5.Named Actions in PDF DocumentNamed Actions in PDF Document
6.Pdf action: jump locallyPdf action: jump locally