本文整理匯總了C#中iTextSharp.text.pdf.PdfDictionary.ToPdf方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfDictionary.ToPdf方法的具體用法?C# PdfDictionary.ToPdf怎麽用?C# PdfDictionary.ToPdf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfDictionary
的用法示例。
在下文中一共展示了PdfDictionary.ToPdf方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: WriteTo
internal void WriteTo() {
PdfDictionary dic = new PdfDictionary();
dic.Put(PdfName.FIELDS, Calculate(fdf.fields));
if (fdf.file != null)
dic.Put(PdfName.F, new PdfString(fdf.file, PdfObject.TEXT_UNICODE));
PdfDictionary fd = new PdfDictionary();
fd.Put(PdfName.FDF, dic);
PdfIndirectReference refi = AddToBody(fd).IndirectReference;
byte[] b = GetISOBytes("trailer\n");
os.Write(b, 0, b.Length);
PdfDictionary trailer = new PdfDictionary();
trailer.Put(PdfName.ROOT, refi);
trailer.ToPdf(null, os);
b = GetISOBytes("\n%%EOF\n");
os.Write(b, 0, b.Length);
os.Close();
}
示例2: BeginMarkedContentSequence
/**
* Begins a marked content sequence. If property is <CODE>null</CODE> the mark will be of the type
* <CODE>BMC</CODE> otherwise it will be <CODE>BDC</CODE>.
* @param tag the tag
* @param property the property
* @param inline <CODE>true</CODE> to include the property in the content or <CODE>false</CODE>
* to include the property in the resource dictionary with the possibility of reusing
*/
public void BeginMarkedContentSequence(PdfName tag, PdfDictionary property, bool inline)
{
if (property == null) {
content.Append(tag.GetBytes()).Append(" BMC").Append_i(separator);
SetMcDepth(GetMcDepth() + 1);
return;
}
content.Append(tag.GetBytes()).Append(' ');
if (inline)
property.ToPdf(writer, content);
else {
PdfObject[] objs;
if (writer.PropertyExists(property))
objs = writer.AddSimpleProperty(property, null);
else
objs = writer.AddSimpleProperty(property, writer.PdfIndirectReference);
PdfName name = (PdfName)objs[0];
PageResources prs = PageResources;
name = prs.AddProperty(name, (PdfIndirectReference)objs[1]);
content.Append(name.GetBytes());
}
content.Append(" BDC").Append_i(separator);
SetMcDepth(GetMcDepth() + 1);
}
示例3: Write
internal void Write() {
foreach (PdfReaderInstance element in readerInstances.Values) {
currentPdfReaderInstance = element;
currentPdfReaderInstance.WriteAllPages();
}
PdfDictionary dic = new PdfDictionary();
dic.Put(PdfName.FIELDS, Calculate(fdf.fields));
if (fdf.file != null)
dic.Put(PdfName.F, new PdfString(fdf.file, PdfObject.TEXT_UNICODE));
if (!string.IsNullOrEmpty(fdf.statusMessage))
dic.Put(PdfName.STATUS, new PdfString(fdf.statusMessage));
PdfDictionary fd = new PdfDictionary();
fd.Put(PdfName.FDF, dic);
PdfIndirectReference refi = AddToBody(fd).IndirectReference;
byte[] b = GetISOBytes("trailer\n");
os.Write(b, 0, b.Length);
PdfDictionary trailer = new PdfDictionary();
trailer.Put(PdfName.ROOT, refi);
trailer.ToPdf(null, os);
b = GetISOBytes("\n%%EOF\n");
os.Write(b, 0, b.Length);
os.Close();
}