本文整理匯總了C#中iTextSharp.text.pdf.PdfName.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfName.ToString方法的具體用法?C# PdfName.ToString怎麽用?C# PdfName.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfName
的用法示例。
在下文中一共展示了PdfName.ToString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetPageAction
/**
* Sets the open and close page additional action.
* @param actionType the action type. It can be <CODE>PdfWriter.PAGE_OPEN</CODE>
* or <CODE>PdfWriter.PAGE_CLOSE</CODE>
* @param action the action to perform
* @param page the page where the action will be applied. The first page is 1
* @throws PdfException if the action type is invalid
*/
internal void SetPageAction(PdfName actionType, PdfAction action, int page) {
if (!actionType.Equals(PAGE_OPEN) && !actionType.Equals(PAGE_CLOSE))
throw new PdfException(MessageLocalization.GetComposedMessage("invalid.page.additional.action.type.1", actionType.ToString()));
PdfDictionary pg = reader.GetPageN(page);
PdfDictionary aa = (PdfDictionary)PdfReader.GetPdfObject(pg.Get(PdfName.AA), pg);
if (aa == null) {
aa = new PdfDictionary();
pg.Put(PdfName.AA, aa);
MarkUsed(pg);
}
aa.Put(actionType, action);
MarkUsed(aa);
}
示例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);
}
示例3: SetPageAction
/**
* Sets the open and close page additional action.
* @param actionType the action type. It can be <CODE>PdfWriter.PAGE_OPEN</CODE>
* or <CODE>PdfWriter.PAGE_CLOSE</CODE>
* @param action the action to perform
* @param page the page where the action will be applied. The first page is 1
* @throws PdfException if the action type is invalid
*/
internal void SetPageAction(PdfName actionType, PdfAction action, int page)
{
if (!actionType.Equals(PAGE_OPEN) && !actionType.Equals(PAGE_CLOSE))
throw new PdfException("Invalid page additional action type: " + actionType.ToString());
PdfDictionary pg = reader.GetPageN(page);
PdfDictionary aa = (PdfDictionary)PdfReader.GetPdfObject(pg.Get(PdfName.AA), pg);
if (aa == null) {
aa = new PdfDictionary();
pg.Put(PdfName.AA, aa);
MarkUsed(pg);
}
aa.Put(actionType, action);
MarkUsed(aa);
}
示例4: 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);
}
示例5: SetPageAction
/** Sets the open and close page additional action.
* @param actionType the action type. It can be <CODE>PdfWriter.PAGE_OPEN</CODE>
* or <CODE>PdfWriter.PAGE_CLOSE</CODE>
* @param action the action to perform
* @throws PdfException if the action type is invalid
*/
public virtual void SetPageAction(PdfName actionType, PdfAction action)
{
if (!actionType.Equals(PAGE_OPEN) && !actionType.Equals(PAGE_CLOSE))
throw new PdfException("Invalid page additional action type: " + actionType.ToString());
pdf.SetPageAction(actionType, action);
}
示例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 virtual 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());
}
pdf.AddAdditionalAction(actionType, action);
}
示例7: GetXObjNum
private int GetXObjNum(PdfName xobjName) {
String decodedPdfName = PdfName.DecodeName(xobjName.ToString());
if (decodedPdfName.LastIndexOf(XOBJ_NAME_PREFIX) == -1) {
return 0;
}
String numStr = decodedPdfName.Substring( decodedPdfName.LastIndexOf(XOBJ_NAME_PREFIX) + XOBJ_NAME_PREFIX.Length );
return Int32.Parse(numStr);
}