當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。