本文整理汇总了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;未经允许,请勿转载。 |
请发表评论