/// <summary> /// Write PDF document object summary to byte array /// </summary> /// <returns>Text string</returns> public static string PdfFileSummary ( PdfReader Reader ) { OutputCtrl Ctrl = new OutputCtrl(); Ctrl.AppendMessage(string.Format("PDF file name: {0}", Reader.SafeFileName)); Ctrl.AddEol(); Ctrl.AppendMessage("Trailer Dictionary"); Ctrl.AppendMessage("------------------"); Reader.TrailerDict.ToByteArray(Ctrl); Ctrl.AddEol(); Ctrl.AddEol(); Ctrl.AppendMessage("Indirect Objects"); Ctrl.AppendMessage("----------------"); // output one object at a time foreach (PdfIndirectObject Obj in Reader.ObjectArray) { if (Obj != null) { Obj.ObjectSummary(Ctrl); } } // successful exit return(ByteArrayToString(Ctrl.ToArray())); }
/// <summary> /// Create PDF file's object summary /// </summary> /// <returns>ASCII byte array</returns> public static string ObjectSummary ( PdfIndirectObject ReaderObject ) { OutputCtrl Ctrl = new OutputCtrl(); ReaderObject.ObjectSummary(Ctrl); return(ByteArrayToString(Ctrl.ToArray())); }
/// <summary> /// Page contents to text /// </summary> /// <param name="OpArray">Op array</param> /// <returns>Byte array</returns> public static byte[] ContentsToText ( PdfOp[] OpArray ) { OutputCtrl Ctrl = new OutputCtrl(); // output one operator at a time foreach (PdfOp Op in OpArray) { Op.ToByteArray(Ctrl); } // successful exit return(Ctrl.ToArray()); }