本文整理匯總了C#中iTextSharp.text.pdf.PdfObject.ToPdf方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfObject.ToPdf方法的具體用法?C# PdfObject.ToPdf怎麽用?C# PdfObject.ToPdf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfObject
的用法示例。
在下文中一共展示了PdfObject.ToPdf方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ToPdf
/**
* Overriding standard PdfObject.ToPdf because we need sorted PdfDictionaries.
*/
private static void ToPdf(PdfObject @object, PdfWriter writer, ByteBuffer os) {
if (@object is PdfDictionary) {
os.Append('<');
os.Append('<');
List<PdfName> keys = new List<PdfName>(((PdfDictionary) @object).Keys);
keys.Sort();
foreach (PdfName key in keys) {
ToPdf(key, writer, os);
PdfObject value = ((PdfDictionary) @object).Get(key);
int type = value.Type;
if (type != PdfObject.ARRAY && type != PdfObject.DICTIONARY && type != PdfObject.NAME &&
type != PdfObject.STRING) {
os.Append(' ');
}
ToPdf(value, writer, os);
}
os.Append('>');
os.Append('>');
} else {
@object.ToPdf(writer, os);
}
}
示例2: AddToObjStm
protected PdfWriter.PdfBody.PdfCrossReference AddToObjStm(PdfObject obj, int nObj) {
if (numObj >= OBJSINSTREAM)
FlushObjStm();
if (index == null) {
index = new ByteBuffer();
streamObjects = new ByteBuffer();
currentObjNum = IndirectReferenceNumber;
numObj = 0;
}
int p = streamObjects.Size;
int idx = numObj++;
PdfEncryption enc = writer.crypto;
writer.crypto = null;
obj.ToPdf(writer, streamObjects);
writer.crypto = enc;
streamObjects.Append(' ');
index.Append(nObj).Append(' ').Append(p).Append(' ');
return new PdfWriter.PdfBody.PdfCrossReference(2, nObj, currentObjNum, idx);
}
示例3: PrintLn
/// <summary>
/// Writes a PDF object to the OutputStream, followed by a newline character. </summary>
/// <param name="o"> </param>
/// <exception cref="IOException"> </exception>
protected internal virtual void PrintLn(PdfObject o) {
o.ToPdf(null, baos);
baos.WriteByte((byte) '\n');
}