本文整理汇总了C#中PdfDictionary类的典型用法代码示例。如果您正苦于以下问题:C# PdfDictionary类的具体用法?C# PdfDictionary怎么用?C# PdfDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PdfDictionary类属于命名空间,在下文中一共展示了PdfDictionary类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ImageRenderInfo
private ImageRenderInfo(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary)
{
this.gs = gs;
this.refi = null;
this.inlineImageInfo = inlineImageInfo;
this.colorSpaceDictionary = colorSpaceDictionary;
}
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:7,代码来源:ImageRenderInfo.cs
示例2: PdfStream
private PdfStream(PdfDictionary dictionary, PdfData data)
: base(PdfObjectType.Stream)
{
IsContainer = true;
StreamDictionary = dictionary;
Data = data;
//IPdfObject filter = StreamDictionary["Filter"];
//if (filter.Text == "FlateDecode")
//{
// ZInputStream zin = new ZInputStream(new MemoryStream(Data));
// //zin.
// int r;
// IList<char> output = new List<char>(data.Length*10);
// while ((r = zin.Read()) != -1)
// {
// output.Add((char)r);
// }
// char[] decompressed = output.ToArray();
// String test = new String(decompressed);
// zin.Close();
//}
//else if (filter.Text == "DCTDecode")
//{
// // JPEG image
//}
//else
// throw new NotImplementedException("Implement Filter");
}
开发者ID:jdehaan,项目名称:SafeRapidPdf,代码行数:29,代码来源:PdfStream.cs
示例3: SignaturePermissions
/**
* Creates an object that can inform you about the type of signature
* in a signature dictionary as well as some of the permissions
* defined by the signature.
*/
public SignaturePermissions(PdfDictionary sigDict, SignaturePermissions previous)
{
if (previous != null) {
annotationsAllowed &= previous.AnnotationsAllowed;
fillInAllowed &= previous.FillInAllowed;
fieldLocks.AddRange(previous.FieldLocks);
}
PdfArray reference = sigDict.GetAsArray(PdfName.REFERENCE);
if (reference != null) {
for (int i = 0; i < reference.Size; i++) {
PdfDictionary dict = reference.GetAsDict(i);
PdfDictionary parameters = dict.GetAsDict(PdfName.TRANSFORMPARAMS);
if (PdfName.DOCMDP.Equals(dict.GetAsName(PdfName.TRANSFORMMETHOD)))
certification = true;
PdfName action = parameters.GetAsName(PdfName.ACTION);
if (action != null)
fieldLocks.Add(new FieldLock(action, parameters.GetAsArray(PdfName.FIELDS)));
PdfNumber p = parameters.GetAsNumber(PdfName.P);
if (p == null)
continue;
switch (p.IntValue) {
case 1:
fillInAllowed = false;
break;
case 2:
annotationsAllowed = false;
break;
}
}
}
}
开发者ID:mapo80,项目名称:iTextSharp-Monotouch,代码行数:38,代码来源:SignaturePermissions.cs
示例4: PdfStream
public PdfStream(
PdfDictionary header
)
: this(header,
new bytes.Buffer())
{
}
开发者ID:jujubeast,项目名称:PDFEditor,代码行数:7,代码来源:PdfStream.cs
示例5: GetDictionaryDetail
/**
* Shows the detail of a dictionary.
* @param dic the dictionary of which you want the detail
* @param depth the depth of the current dictionary (for nested dictionaries)
* @return a String representation of the dictionary
*/
public static String GetDictionaryDetail(PdfDictionary dic, int depth){
StringBuilder builder = new StringBuilder();
builder.Append('(');
IList<PdfName> subDictionaries = new List<PdfName>();
foreach (PdfName key in dic.Keys) {
PdfObject val = dic.GetDirectObject(key);
if (val.IsDictionary())
subDictionaries.Add(key);
builder.Append(key);
builder.Append('=');
builder.Append(val);
builder.Append(", ");
}
builder.Length = builder.Length-2;
builder.Append(')');
foreach (PdfName pdfSubDictionaryName in subDictionaries) {
builder.Append('\n');
for (int i = 0; i < depth+1; i++){
builder.Append('\t');
}
builder.Append("Subdictionary ");
builder.Append(pdfSubDictionaryName);
builder.Append(" = ");
builder.Append(GetDictionaryDetail(dic.GetAsDict(pdfSubDictionaryName), depth+1));
}
return builder.ToString();
}
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:33,代码来源:PdfContentReaderTool.cs
示例6: LoadEncodingDifferences
/**
<summary>Loads the encoding differences into the given collection.</summary>
<param name="encodingDictionary">Encoding dictionary.</param>
<param name="codes">Encoding to alter applying differences.</param>
*/
protected void LoadEncodingDifferences(
PdfDictionary encodingDictionary,
IDictionary<ByteArray,int> codes
)
{
PdfArray differenceObjects = (PdfArray)encodingDictionary.Resolve(PdfName.Differences);
if(differenceObjects == null)
return;
/*
NOTE: Each code is the first index in a sequence of character codes to be changed.
The first character name after the code becomes the name corresponding to that code.
Subsequent names replace consecutive code indices until the next code appears
in the array or the array ends.
*/
byte[] charCodeData = new byte[1];
foreach(PdfDirectObject differenceObject in differenceObjects)
{
if(differenceObject is PdfInteger)
{charCodeData[0] = (byte)(((int)((PdfInteger)differenceObject).Value) & 0xFF);}
else // NOTE: MUST be PdfName.
{
ByteArray charCode = new ByteArray(charCodeData);
string charName = (string)((PdfName)differenceObject).Value;
if(charName.Equals(".notdef"))
{codes.Remove(charCode);}
else
{
int? code = GlyphMapping.NameToCode(charName);
codes[charCode] = (code ?? charCodeData[0]);
}
charCodeData[0]++;
}
}
}
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:40,代码来源:SimpleFont.cs
示例7: File
public File(
)
{
Initialize();
version = VersionEnum.PDF14.GetVersion();
trailer = PrepareTrailer(new PdfDictionary());
indirectObjects = new IndirectObjects(this, null);
document = new Document(this);
}
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:10,代码来源:File.cs
示例8: StructureObject
/**
* Creates a StructureObject for an OBJR dictionary.
* @param structElem the parent structure element
* @param ref the reference of the parent structure element
* @param dict the object reference dictionary
*/
public StructureObject(PdfDictionary structElem, PdfIndirectReference refa, PdfDictionary dict) {
this.structElem = structElem;
this.refa = refa;
this.obj = dict.GetDirectObject(PdfName.OBJ);
this.objref = dict.GetAsIndirectObject(PdfName.OBJ);
this.structParent = ((PdfDictionary) obj).GetAsNumber(PdfName.STRUCTPARENT).IntValue;
PdfIndirectReference pg = dict.GetAsIndirectObject(PdfName.PG);
if (pg == null)
pg = structElem.GetAsIndirectObject(PdfName.PG);
this.pageref = pg.Number;
}
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:17,代码来源:StructureObject.cs
示例9: Decode
public override byte[] Decode(
byte[] data,
int offset,
int length,
PdfDictionary parameters
)
{
MemoryStream outputStream = new MemoryStream();
MemoryStream inputStream = new MemoryStream(data, offset, length);
DeflateStream inputFilter = new DeflateStream(inputStream, CompressionMode.Decompress);
inputStream.Position = 2; // Skips zlib's 2-byte header [RFC 1950] [FIX:0.0.8:JCT].
Transform(inputFilter,outputStream);
return DecodePredictor(outputStream.ToArray(), parameters);
}
开发者ID:n9,项目名称:pdfclown,代码行数:14,代码来源:FlateFilter.cs
示例10: CheckEmbeddedFile
protected override void CheckEmbeddedFile(PdfDictionary embeddedFile)
{
PdfObject _params = GetDirectObject(embeddedFile.Get(PdfName.PARAMS));
if (_params == null) {
throw new PdfAConformanceException(embeddedFile,
MessageLocalization.GetComposedMessage("embedded.file.shall.contain.valid.params.key"));
} else if (_params.IsDictionary()) {
PdfObject modDate = ((PdfDictionary) _params).Get(PdfName.MODDATE);
if (modDate == null || !(modDate is PdfString)) {
throw new PdfAConformanceException(embeddedFile,
MessageLocalization.GetComposedMessage("embedded.file.shall.contain.params.key.with.valid.moddate.key"));
}
}
}
开发者ID:jagruti23,项目名称:itextsharp,代码行数:14,代码来源:PdfA3Checker.cs
示例11: Encode
public override byte[] Encode(
byte[] data,
int offset,
int length,
PdfDictionary parameters
)
{
MemoryStream inputStream = new MemoryStream(data, offset, length);
MemoryStream outputStream = new MemoryStream();
DeflateStream outputFilter = new DeflateStream(outputStream, CompressionMode.Compress, true);
// Add zlib's 2-byte header [RFC 1950] [FIX:0.0.8:JCT]!
outputStream.WriteByte(0x78); // CMF = {CINFO (bits 7-4) = 7; CM (bits 3-0) = 8} = 0x78.
outputStream.WriteByte(0xDA); // FLG = {FLEVEL (bits 7-6) = 3; FDICT (bit 5) = 0; FCHECK (bits 4-0) = {31 - ((CMF * 256 + FLG - FCHECK) Mod 31)} = 26} = 0xDA.
Transform(inputStream, outputFilter);
return outputStream.ToArray();
}
开发者ID:n9,项目名称:pdfclown,代码行数:16,代码来源:FlateFilter.cs
示例12: GetEncrypt
public PdfDictionary GetEncrypt(PdfObjectId objectId)
{
PdfDictionary encrypt = new PdfDictionary(objectId);
encrypt[PdfName.Names.Filter] = PdfName.Names.Standard;
encrypt[PdfName.Names.V] = new PdfNumeric(1);
encrypt[PdfName.Names.Length] = new PdfNumeric(40);
encrypt[PdfName.Names.R] = new PdfNumeric(2);
PdfString o = new PdfString(ownerEntry);
o.NeverEncrypt = true;
encrypt[PdfName.Names.O] = o;
PdfString u = new PdfString(userEntry);
u.NeverEncrypt = true;
encrypt[PdfName.Names.U] = u;
encrypt[PdfName.Names.P] = new PdfNumeric(permissions);
return encrypt;
}
开发者ID:nholik,项目名称:Fo.Net,代码行数:16,代码来源:SecurityManager.cs
示例13: PdfObjectStream
/// <summary>
/// Initializes a new instance from an existing dictionary. Used for object type transformation.
/// </summary>
internal PdfObjectStream(PdfDictionary dict)
: base(dict)
{
int n = Elements.GetInteger(Keys.N);
int first = Elements.GetInteger(Keys.First);
Stream.TryUnfilter();
Parser parser = new Parser(null, new MemoryStream(Stream.Value));
_header = parser.ReadObjectStreamHeader(n, first);
#if DEBUG && CORE
if (Internal.PdfDiagnostics.TraceObjectStreams)
{
Debug.WriteLine(String.Format("PdfObjectStream(document) created. Header item count: {0}", _header.GetLength(0)));
}
#endif
}
开发者ID:Sl0vi,项目名称:PDFsharp,代码行数:20,代码来源:PdfObjectStream.cs
示例14: PdfCIDFont
public PdfCIDFont(PdfDocument document, PdfFontDescriptor fontDescriptor, byte[] fontData)
: base(document)
{
Elements.SetName(Keys.Type, "/Font");
Elements.SetName(Keys.Subtype, "/CIDFontType2");
PdfDictionary cid = new PdfDictionary();
cid.Elements.SetString("/Ordering", "Identity");
cid.Elements.SetString("/Registry", "Adobe");
cid.Elements.SetInteger("/Supplement", 0);
Elements.SetValue(Keys.CIDSystemInfo, cid);
FontDescriptor = fontDescriptor;
// ReSharper disable once DoNotCallOverridableMethodsInConstructor
Owner._irefTable.Add(fontDescriptor);
Elements[Keys.FontDescriptor] = fontDescriptor.Reference;
FontEncoding = PdfFontEncoding.Unicode;
}
开发者ID:Core2D,项目名称:PDFsharp,代码行数:18,代码来源:PdfCIDFont.cs
示例15: Parse
public static PdfStream Parse(PdfDictionary dictionary, Lexical.ILexer lexer)
{
lexer.Expects("stream");
char eol = lexer.ReadChar();
if (eol == '\r')
eol = lexer.ReadChar();
if (eol != '\n')
throw new Exception(@"Parser error: stream needs to be followed by either \r\n or \n alone");
if (dictionary == null)
throw new Exception("Parser error: stream needs a dictionary");
IPdfObject lengthObject = dictionary["Length"];
if (lengthObject == null)
throw new Exception("Parser error: stream dictionary requires a Length entry");
int length = 0;
if (lengthObject is PdfIndirectReference)
{
PdfIndirectReference reference = lengthObject as PdfIndirectReference;
PdfIndirectObject lenobj = lexer.IndirectReferenceResolver
.GetObject(reference.ObjectNumber, reference.GenerationNumber);
PdfNumeric len = lenobj.Object as PdfNumeric;
length = int.Parse(len.ToString());
}
else
{
length = int.Parse(lengthObject.ToString());
}
PdfData data = PdfData.Parse(lexer, length);
lexer.Expects("endstream");
return new PdfStream(dictionary, data);
}
开发者ID:jdehaan,项目名称:SafeRapidPdf,代码行数:37,代码来源:PdfStream.cs
示例16: PdfAcroForm
internal PdfAcroForm(PdfDictionary dictionary)
: base(dictionary)
{ }
开发者ID:Core2D,项目名称:PDFsharp,代码行数:3,代码来源:PdfAcroForm.cs
示例17: PdfButtonField
/// <summary>
/// Initializes a new instance of the <see cref="PdfButtonField"/> class.
/// </summary>
protected PdfButtonField(PdfDictionary dict)
: base(dict)
{ }
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:6,代码来源:PdfButtonField.cs
示例18: OutputDss
private void OutputDss(PdfDictionary dss, PdfDictionary vrim, PdfArray ocsps, PdfArray crls, PdfArray certs) {
writer.AddDeveloperExtension(PdfDeveloperExtension.ESIC_1_7_EXTENSIONLEVEL5);
PdfDictionary catalog = reader.Catalog;
stp.MarkUsed(catalog);
foreach (PdfName vkey in validated.Keys) {
PdfArray ocsp = new PdfArray();
PdfArray crl = new PdfArray();
PdfArray cert = new PdfArray();
PdfDictionary vri = new PdfDictionary();
foreach (byte[] b in validated[vkey].crls) {
PdfStream ps = new PdfStream(b);
ps.FlateCompress();
PdfIndirectReference iref = writer.AddToBody(ps, false).IndirectReference;
crl.Add(iref);
crls.Add(iref);
}
foreach (byte[] b in validated[vkey].ocsps) {
PdfStream ps = new PdfStream(b);
ps.FlateCompress();
PdfIndirectReference iref = writer.AddToBody(ps, false).IndirectReference;
ocsp.Add(iref);
ocsps.Add(iref);
}
foreach (byte[] b in validated[vkey].certs) {
PdfStream ps = new PdfStream(b);
ps.FlateCompress();
PdfIndirectReference iref = writer.AddToBody(ps, false).IndirectReference;
cert.Add(iref);
certs.Add(iref);
}
if (ocsp.Size > 0)
vri.Put(PdfName.OCSP, writer.AddToBody(ocsp, false).IndirectReference);
if (crl.Size > 0)
vri.Put(PdfName.CRL, writer.AddToBody(crl, false).IndirectReference);
if (cert.Size > 0)
vri.Put(PdfName.CERT, writer.AddToBody(cert, false).IndirectReference);
vrim.Put(vkey, writer.AddToBody(vri, false).IndirectReference);
}
dss.Put(PdfName.VRI, writer.AddToBody(vrim, false).IndirectReference);
if (ocsps.Size > 0)
dss.Put(PdfName.OCSPS, writer.AddToBody(ocsps, false).IndirectReference);
if (crls.Size > 0)
dss.Put(PdfName.CRLS, writer.AddToBody(crls, false).IndirectReference);
if (certs.Size > 0)
dss.Put(PdfName.CERTS, writer.AddToBody(certs, false).IndirectReference);
catalog.Put(PdfName.DSS, writer.AddToBody(dss, false).IndirectReference);
}
开发者ID:jagruti23,项目名称:itextsharp,代码行数:47,代码来源:LtvVerification.cs
示例19: Decode
public byte[] Decode(byte[] b, PdfName filterName, PdfObject decodeParams, PdfDictionary streamDictionary) {
lastFilterName = filterName;
return b;
}
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:4,代码来源:PdfImageObject.cs
示例20: PdfImageObject
/**
* Creates a PdfImage object.
* @param stream a PRStream
* @param colorSpaceDic a color space dictionary
* @throws IOException
*/
public PdfImageObject(PRStream stream, PdfDictionary colorSpaceDic) : this(stream, PdfReader.GetStreamBytesRaw(stream), colorSpaceDic) {
}
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:8,代码来源:PdfImageObject.cs
注:本文中的PdfDictionary类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论