當前位置: 首頁>>代碼示例>>C#>>正文


C# pdf.PdfAction類代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfAction的典型用法代碼示例。如果您正苦於以下問題:C# PdfAction類的具體用法?C# PdfAction怎麽用?C# PdfAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PdfAction類屬於iTextSharp.text.pdf命名空間,在下文中一共展示了PdfAction類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetAction

 public override void SetAction(PdfAction action, float llx, float lly, float urx, float ury)
 {
     ((PdfStamperImp)writer).AddAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, action), ps.pageN);
 }
開發者ID:bmictech,項目名稱:iTextSharp,代碼行數:4,代碼來源:StampContent.cs

示例2: SetAdditionalAction

 /** Additional-actions defining the actions to be taken in
 * response to various trigger events affecting the document
 * as a whole. The actions types allowed are: <CODE>DOCUMENT_CLOSE</CODE>,
 * <CODE>WILL_SAVE</CODE>, <CODE>DID_SAVE</CODE>, <CODE>WILL_PRINT</CODE>
 * and <CODE>DID_PRINT</CODE>.
 *
 * @param actionType the action type
 * @param action the action to execute in response to the trigger
 * @throws PdfException on invalid action type
 */
 public override void SetAdditionalAction(PdfName actionType, PdfAction action) {
     if (!(actionType.Equals(DOCUMENT_CLOSE) ||
     actionType.Equals(WILL_SAVE) ||
     actionType.Equals(DID_SAVE) ||
     actionType.Equals(WILL_PRINT) ||
     actionType.Equals(DID_PRINT))) {
         throw new PdfException(MessageLocalization.GetComposedMessage("invalid.additional.action.type.1", actionType.ToString()));
     }
     PdfDictionary aa = reader.Catalog.GetAsDict(PdfName.AA);
     if (aa == null) {
         if (action == null)
             return;
         aa = new PdfDictionary();
         reader.Catalog.Put(PdfName.AA, aa);
     }
     MarkUsed(aa);
     if (action == null)
         aa.Remove(actionType);
     else
         aa.Put(actionType, action);
 }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:31,代碼來源:PdfStamperImp.cs

示例3: SetPageAction

 internal void SetPageAction(PdfName actionType, PdfAction action) {
     if (pageAA == null) {
         pageAA = new PdfDictionary();
     }
     pageAA.Put(actionType, action);
 }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:6,代碼來源:PdfDocument.cs

示例4: SetPageAction

 /** Always throws an <code>UnsupportedOperationException</code>.
 * @param actionType ignore
 * @param action ignore
 * @throws PdfException ignore
 * @see PdfStamper#setPageAction(PdfName, PdfAction, int)
 */    
 public override void SetPageAction(PdfName actionType, PdfAction action) {
     throw new InvalidOperationException(MessageLocalization.GetComposedMessage("use.setpageaction.pdfname.actiontype.pdfaction.action.int.page"));
 }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:9,代碼來源:PdfStamperImp.cs

示例5: PdfOutline

 /**
  * Constructs a <CODE>PdfOutline</CODE>.
  * <P>
  * This is the constructor for an <CODE>outline entry</CODE>.
  *
  * @param parent the parent of this outline item
  * @param action the <CODE>PdfAction</CODE> for this outline item
  * @param title the title of this outline item
  * @param open <CODE>true</CODE> if the children are visible
  */
 public PdfOutline(PdfOutline parent, PdfAction action, string title, bool open)
     : base()
 {
     this.action = action;
     InitOutline(parent, title, open);
 }
開發者ID:medvedttn,項目名稱:itextsharp_mod-src,代碼行數:16,代碼來源:PdfOutline.cs

示例6: SetAdditionalAction

 /** Additional-actions defining the actions to be taken in
 * response to various trigger events affecting the document
 * as a whole. The actions types allowed are: <CODE>DOCUMENT_CLOSE</CODE>,
 * <CODE>WILL_SAVE</CODE>, <CODE>DID_SAVE</CODE>, <CODE>WILL_PRINT</CODE>
 * and <CODE>DID_PRINT</CODE>.
 *
 * @param actionType the action type
 * @param action the action to execute in response to the trigger
 * @throws PdfException on invalid action type
 */
 public override void SetAdditionalAction(PdfName actionType, PdfAction action)
 {
     if (!(actionType.Equals(DOCUMENT_CLOSE) ||
     actionType.Equals(WILL_SAVE) ||
     actionType.Equals(DID_SAVE) ||
     actionType.Equals(WILL_PRINT) ||
     actionType.Equals(DID_PRINT))) {
         throw new PdfException("Invalid additional action type: " + actionType.ToString());
     }
     PdfDictionary aa = (PdfDictionary)PdfReader.GetPdfObject(reader.Catalog.Get(PdfName.AA));
     if (aa == null) {
         if (action == null)
             return;
         aa = new PdfDictionary();
         reader.Catalog.Put(PdfName.AA, aa);
     }
     MarkUsed(aa);
     if (action == null)
         aa.Remove(actionType);
     else
         aa.Put(actionType, action);
 }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:32,代碼來源:PdfStamperImp.cs

示例7: SetPageAction

 /** Always throws an <code>UnsupportedOperationException</code>.
 * @param actionType ignore
 * @param action ignore
 * @throws PdfException ignore
 * @see PdfStamper#setPageAction(PdfName, PdfAction, int)
 */
 public override void SetPageAction(PdfName actionType, PdfAction action)
 {
     throw new InvalidOperationException("Use SetPageAction(PdfName actionType, PdfAction action, int page)");
 }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:10,代碼來源:PdfStamperImp.cs

示例8: SetOpenAction

 internal void SetOpenAction(PdfAction action) {
     openActionAction = action;
     openActionName = null;
 }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:4,代碼來源:PdfDocument.cs

示例9: AddAdditionalAction

 internal void AddAdditionalAction(PdfName actionType, PdfAction action)  {
     if (additionalActions == null)  {
         additionalActions = new PdfDictionary();
     }
     if (action == null)
         additionalActions.Remove(actionType);
     else
         additionalActions.Put(actionType, action);
     if (additionalActions.Size == 0)
         additionalActions = null;
 }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:11,代碼來源:PdfDocument.cs

示例10: Add

        /**
        * Signals that an <CODE>Element</CODE> was added to the <CODE>Document</CODE>.
        *
        * @param element the element to add
        * @return <CODE>true</CODE> if the element was added, <CODE>false</CODE> if not.
        * @throws DocumentException when a document isn't open yet, or has been closed
        */
        public override bool Add(IElement element) {
            if (writer != null && writer.IsPaused()) {
                return false;
            }
            if (element.Type != Element.DIV) {
                FlushFloatingElements();
            }
            switch (element.Type) {
                
                // Information (headers)
                case Element.HEADER:
                    info.Addkey(((Meta)element).Name, ((Meta)element).Content);
                    break;
                case Element.TITLE:
                    info.AddTitle(((Meta)element).Content);
                    break;
                case Element.SUBJECT:
                    info.AddSubject(((Meta)element).Content);
                    break;
                case Element.KEYWORDS:
                    info.AddKeywords(((Meta)element).Content);
                    break;
                case Element.AUTHOR:
                    info.AddAuthor(((Meta)element).Content);
                    break;
                case Element.CREATOR:
                    info.AddCreator(((Meta)element).Content);
                    break;
                case Element.LANGUAGE:
                    SetLanguage(((Meta)element).Content);
                    break;
                case Element.PRODUCER:
                    // you can not change the name of the producer
                    info.AddProducer();
                    break;
                case Element.CREATIONDATE:
                    // you can not set the creation date, only reset it
                    info.AddCreationDate();
                    break;
                    
                    // content (text)
                case Element.CHUNK: {
                    // if there isn't a current line available, we make one
                    if (line == null) {
                        CarriageReturn();
                    }
                    
                    // we cast the element to a chunk
                    PdfChunk chunk = new PdfChunk((Chunk) element, anchorAction, tabSettings);
                    // we try to add the chunk to the line, until we succeed
                    {
                        PdfChunk overflow;
                        while ((overflow = line.Add(chunk)) != null) {
                            CarriageReturn();
                            bool newlineSplit = chunk.IsNewlineSplit();
                            chunk = overflow;
                            if (!newlineSplit)
                                chunk.TrimFirstSpace();
                        }
                    }
                    pageEmpty = false;
                    if (chunk.IsAttribute(Chunk.NEWPAGE)) {
                        NewPage();
                    }
                    break;
                }
                case Element.ANCHOR: {
                    Anchor anchor = (Anchor) element;
                    String url = anchor.Reference;
                    leading = anchor.Leading;
                    PushLeading();
                    if (url != null) {
                        anchorAction = new PdfAction(url);
                    }
                    
                    // we process the element
                    element.Process(this);
                    anchorAction = null;
                    PopLeading();
                    break;
                }
                case Element.ANNOTATION: {
                    if (line == null) {
                        CarriageReturn();
                    }
                    Annotation annot = (Annotation) element;
                    Rectangle rect = new Rectangle(0, 0);
                    if (line != null)
                        rect = new Rectangle(annot.GetLlx(IndentRight - line.WidthLeft), annot.GetUry(IndentTop - currentHeight - 20), annot.GetUrx(IndentRight - line.WidthLeft + 20), annot.GetLly(IndentTop - currentHeight));
                    PdfAnnotation an = PdfAnnotationsImp.ConvertAnnotation(writer, annot, rect);
                    annotationsImp.AddPlainAnnotation(an);
                    pageEmpty = false;
                    break;
//.........這裏部分代碼省略.........
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:101,代碼來源:PdfDocument.cs

示例11: SetOpenAction

 /**
 * @see com.lowagie.text.pdf.PdfWriter#setOpenAction(com.lowagie.text.pdf.PdfAction)
 */
 public override void SetOpenAction(PdfAction action) {
     openAction = action;
 }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:6,代碼來源:PdfStamperImp.cs

示例12: SetAction

 /** Implements an action in an area.
 * @param action the <CODE>PdfAction</CODE>
 * @param llx the lower left x corner of the activation area
 * @param lly the lower left y corner of the activation area
 * @param urx the upper right x corner of the activation area
 * @param ury the upper right y corner of the activation area
 */
 internal void SetAction(PdfAction action, float llx, float lly, float urx, float ury) {
     AddAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, action));
 }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:10,代碼來源:PdfDocument.cs

示例13: GetLocalGotoAction

 internal PdfAction GetLocalGotoAction(String name) {
     PdfAction action;
     Destination dest;
     if (localDestinations.ContainsKey(name))
         dest = localDestinations[name];
     else
         dest = new Destination();
     if (dest.action == null) {
         if (dest.reference == null) {
             dest.reference = writer.PdfIndirectReference;
         }
         action = new PdfAction(dest.reference);
         dest.action = action;
         localDestinations[name] = dest;
     }
     else {
         action = dest.action;
     }
     return action;
 }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:20,代碼來源:PdfDocument.cs

示例14: AddJavaScript

 internal void AddJavaScript(String name, PdfAction js) {
     if (js.Get(PdfName.JS) == null)
         throw new ArgumentException(MessageLocalization.GetComposedMessage("only.javascript.actions.are.allowed"));
     documentLevelJS[name] = writer.AddToBody(js).IndirectReference;
 }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:5,代碼來源:PdfDocument.cs

示例15: SetAction

 /** Implements an action in an area.
  * @param action the <CODE>PdfAction</CODE>
  * @param llx the lower left x corner of the activation area
  * @param lly the lower left y corner of the activation area
  * @param urx the upper right x corner of the activation area
  * @param ury the upper right y corner of the activation area
  */
 public virtual void SetAction(PdfAction action, float llx, float lly, float urx, float ury)
 {
     pdf.SetAction(action, llx, lly, urx, ury);
 }
開發者ID:HardcoreSoftware,項目名稱:iSecretary,代碼行數:11,代碼來源:PdfContentByte.cs


注:本文中的iTextSharp.text.pdf.PdfAction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。