本文整理汇总了Java中org.apache.pdfbox.pdmodel.interactive.action.type.PDActionURI类的典型用法代码示例。如果您正苦于以下问题:Java PDActionURI类的具体用法?Java PDActionURI怎么用?Java PDActionURI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PDActionURI类属于org.apache.pdfbox.pdmodel.interactive.action.type包,在下文中一共展示了PDActionURI类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLink
import org.apache.pdfbox.pdmodel.interactive.action.type.PDActionURI; //导入依赖的package包/类
public static PDAnnotationLink createLink(PDPage page, PDRectangle rect, Color color,
LinkStyle linkStyle, final String uri) {
PDAnnotationLink pdLink = createLink(page, rect, color, linkStyle);
PDActionURI actionUri = new PDActionURI();
actionUri.setURI(uri);
pdLink.setAction(actionUri);
return pdLink;
}
示例2: testCreateRolloverAnnotation
import org.apache.pdfbox.pdmodel.interactive.action.type.PDActionURI; //导入依赖的package包/类
@Test
public void testCreateRolloverAnnotation() throws IOException, COSVisitorException
{
PDAnnotationLink txtLink = new PDAnnotationLink();
PDActionURI action = new PDActionURI();
action.setURI("http://www.pdfbox.org");
txtLink.setAction(action);
createRollover(txtLink, "rolloverAnnotation.pdf");
}
示例3: testCreateRolloverButton
import org.apache.pdfbox.pdmodel.interactive.action.type.PDActionURI; //导入依赖的package包/类
@Test
public void testCreateRolloverButton() throws IOException, COSVisitorException
{
PDAnnotationWidget widget = new PDAnnotationWidget();
COSDictionary dictionary = widget.getDictionary();
dictionary.setName("FT", "Btn");
dictionary.setInt("Ff", 65536);
dictionary.setString("T", "Push");
PDActionURI action = new PDActionURI();
action.setURI("http://www.pdfbox.org");
widget.setAction(action);
createRollover(widget, "rolloverButton.pdf");
}
示例4: endPage
import org.apache.pdfbox.pdmodel.interactive.action.type.PDActionURI; //导入依赖的package包/类
@Override
protected void endPage(PDPage page) throws IOException {
try {
writeParagraphEnd();
// TODO: remove once PDFBOX-1143 is fixed:
if (config.getExtractAnnotationText()) {
for (Object o : page.getAnnotations()) {
if (o instanceof PDAnnotationLink) {
PDAnnotationLink annotationlink = (PDAnnotationLink) o;
if (annotationlink.getAction() != null) {
PDAction action = annotationlink.getAction();
if (action instanceof PDActionURI) {
PDActionURI uri = (PDActionURI) action;
String link = uri.getURI();
if (link != null) {
handler.startElement("div", "class", "annotation");
handler.startElement("a", "href", link);
handler.endElement("a");
handler.endElement("div");
}
}
}
}
if (o instanceof PDAnnotationMarkup) {
PDAnnotationMarkup annot = (PDAnnotationMarkup) o;
String title = annot.getTitlePopup();
String subject = annot.getSubject();
String contents = annot.getContents();
// TODO: maybe also annot.getRichContents()?
if (title != null || subject != null || contents != null) {
handler.startElement("div", "class", "annotation");
if (title != null) {
handler.startElement("div", "class", "annotationTitle");
handler.characters(title);
handler.endElement("div");
}
if (subject != null) {
handler.startElement("div", "class", "annotationSubject");
handler.characters(subject);
handler.endElement("div");
}
if (contents != null) {
handler.startElement("div", "class", "annotationContents");
handler.characters(contents);
handler.endElement("div");
}
handler.endElement("div");
}
}
}
}
handler.endElement("div");
} catch (SAXException e) {
throw new IOExceptionWithCause("Unable to end a page", e);
}
}