Source Code : Pdf action: jump locally
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Pdf action: jump locally

import java.awt.Color;
import java.io.FileOutputStream;
import com.lowagie.text.Anchor;
import com.lowagie.text.Document;
import com.lowagie.text.Font;
import com.lowagie.text.FontFactory;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class JumpLocalDestinationPDF {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream("JumpLocalDestinationPDF.pdf"));
document.open();
Paragraph paragraph = new Paragraph();
Anchor anchor1 = new Anchor("some text", FontFactory.getFont(FontFactory.HELVETICA, 12, Font.UNDERLINE, new Color(0, 0, 255)));
anchor1.setName("top");
paragraph.add(anchor1);
document.add(paragraph);
Anchor anchor2 = new Anchor("please jump to a local destination", FontFactory.getFont(FontFactory.HELVETICA, 12, Font.NORMAL, new Color(0, 0, 255)));
anchor2.setReference("#top");
document.add(anchor2);
} catch (Exception e) {
System.err.println(e.getMessage());
}
document.close();
}
}
Thank with us