当前位置: 首页>>代码示例>>Java>>正文


Java PDActionURI类代码示例

本文整理汇总了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;
   }
 
开发者ID:ralfstuckert,项目名称:pdfbox-layout,代码行数:10,代码来源:CompatibilityHelper.java

示例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");
}
 
开发者ID:mkl-public,项目名称:testarea-pdfbox1,代码行数:12,代码来源:RolloverAnnotation.java

示例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");
}
 
开发者ID:mkl-public,项目名称:testarea-pdfbox1,代码行数:16,代码来源:RolloverAnnotation.java

示例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);
  }
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:62,代码来源:PDF2XHTML.java


注:本文中的org.apache.pdfbox.pdmodel.interactive.action.type.PDActionURI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。