void ListViewThumbnailDisplay(object sender, System.EventArgs e) { MessageBox.Show("Display thumbnail - mouse event handler"); BrightIdeasSoftware.ObjectListView listView = (BrightIdeasSoftware.ObjectListView)sender; vs = (VStream)listView.GetSelectedObject(); // listView.MouseCaptureChanged += new EventHandler(ListViewThumbnailDisplay);//Melek //vs = (VStream)listView.Click+=new System.EventHandler(ListViewSelectedClipInfo); if (vs != null) { MessageBox.Show("clip selected"); int i = listView.SelectedIndex; // string name=listView.Items[i].; StopClip(); openDetails(vs); //Initialize Picture Box InitializePictureBox(); } //Enable User Decision buttons and report buttons Pass_Button.Enabled = true; Fail_Button.Enabled = true; CancelUserDecision_Button.Enabled = true; //GenerateReportButtonReviewView.Enabled = true; //Melek //ClearButtonReviewMenu.Enabled = true; //Melek }
/// <summary> /// open the detailed results of a processed stream in detailed view /// </summary> /// <param name="lvs">clip</param> private void openDetails(VStream lvs) { CloseInterfaces(); // forces video panel to cover internals overlay option // VideoPanel.Width = VideoPlayerPanel.Width; vs = new VStream(); // load vs = lvs; // reset arraylist used to store curves in detailed view vs.rawdata.iMosA = new ArrayList(); vs.rawdata.sMosA = new ArrayList(); vs.rawdata.AvYA = new ArrayList(); vs.rawdata.TxturA = new ArrayList(); vs.sum.BSA = new List<AlertScene>(); vs.sum.AggBSA = new List<AlertScene>(); vs.sum.BWScnA = new List<AlertScene>(); vs.sum.FzScnA = new List<AlertScene>(); vs.sum.FieldScnA = new List<AlertScene>(); vs.sum.TroughsA = new List<AlertScene>(); vs.sum.FieldScnA = new List<AlertScene>(); vs.sum.VideoWarningA = new List<GUIwarning>(); vs.sum.DecoderWarningA = new List<DecoderWarning>(); vs.sum.RFframes = 0; vs.sum.AggRFframes = 0; MainTabs.SelectedIndex = 2; // switch to the (detailed) 'review' view when clicking on a stream in the monitoring view if (vs.sum.qualityProfile.aggregatedBadSceneDetector.Enabled == true) ShowAggBSBox.Enabled = true; else ShowAggBSBox.Enabled = false; vs = qatool.Sum.ReadRes(vs, 1); //1: copy the mos array to the global mos array for display in the detailed view; // decoder warning array is populated from readres so if it is read from summary file, it needs to be reset before vs.sum.DecoderWarningA.Clear(); vs.ReadSum(); if (vs.sum.error != "") { currentfilename.Text = " Problem opening " + vs.StreamFileName; //Melek - path.name => streamfilename } else { // currentfilename.Text = " " + vs.path.Name; // fill label above video window if (vs.sum.qualityProfile.aggregatedBadSceneDetector.Enabled == true) redflaggedPerCent.Text = " " + vs.sum.AggRFpercent + " %"; else redflaggedPerCent.Text = " " + vs.sum.RFpercent + " %"; //AvMosLabel.Text = Math.Round(vs.sum.MOSaverage, 2) + " (" + Math.Round(vs.sum.MOSstandardDeviation, 2) + ")"; string displaypmosvalue = Math.Round(vs.sum.MOSaverage, 2).ToString(); currentfilename.Text = " " + vs.StreamFileName + " Avg. MOS:" + displaypmosvalue; // fill label above video window //Melek - path.name => streamfilename // set the colour elements according to the final decision currentfilename.BackColor = vs.Final_Decision.GetBackColor(); redflaggedPerCent.BackColor = vs.Final_Decision.GetBackColor(); AvMosLabel.BackColor = vs.Final_Decision.GetBackColor(); if (vs.sum.UserDecision.Made == Decision.NOTMADE) { currentfilename.Text += " [ " + vs.sum.ModelDecision.String + " : " + vs.sum.qualityProfile.name + "]"; } else { currentfilename.Text += " [ " + vs.sum.UserDecision.String + " by user: "******" ] (model decision: " + vs.sum.ModelDecision.String + ")"; } ShowAllScenesBox.Enabled = true; // adding ShowAllScenesBox.Checked = true; ShowAllScenesBox_CheckedChanged("", EventArgs.Empty); VideoInfo(); TraceMOSchartDist(); TraceMOSchart();// will use mos array in the global vs stream // Thread.Sleep(1000); //Melek - wait for a sec //VideoTimeBox.Text = ""; VideoTimeBox.Text = "00:00:00"; //Melek UpdateMainTitle(); if (vs.path.StreamIsAvailable) { EnablePlayback(true); } else { MessageBox.Show(vs.path.streamFileName + " is not available under " + vs.path.inputDir); } } }
//internal class AddRemoveVStreamItem //{ // public VStream VStream { get; set; } // public bool IsAdd { get; set; } //} //static List<AddRemoveVStreamItem> VStreamActionList = new List<AddRemoveVStreamItem>(); public static bool UpdateVStream(VStream oldItem, VStream newItem) { lock (padlock) { // Global.log(string.Format("UpdateVStream: {0}", oldItem.StreamFileName)); int index = GUI.SummaryList.IndexOf(oldItem); if (index == 1) return false; SummaryList[index] = newItem; //// Also update the item in the BindingList //index = SummaryBindingList.IndexOf(oldItem); //SummaryBindingList[index] = newItem; return true; } }
/// <summary> /// Single click on a stream in ResultListView //Double not single - Melek /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ListViewDataSetSelectedIndexChanged(object sender, System.EventArgs e) { try { BrightIdeasSoftware.ObjectListView listView = (BrightIdeasSoftware.ObjectListView)sender; vs = (VStream)listView.GetSelectedObject(); if ((vs != null) && (this.vs.Final_Decision.String != "Not made")) //Melek - if decision is not made do not play the clip { StopClip(); openDetails(vs); playbutton_Click("", EventArgs.Empty); //Melek Double click play option //Enable User Decision buttons Pass_Button.Enabled = true; Fail_Button.Enabled = true; CancelUserDecision_Button.Enabled = true; } else { MessageBox.Show("Clip Decision Not Made - This clip format is not compatible with v.Cortex"); } } catch (Exception ex) { } }
// change the profile for the selected stream in monitoring view stream and put it in the summary queue // private void ForceNewProfile(Object o, BrightIdeasSoftware.CellRightClickEventArgs e) // private void ForceNewProfile(Object o, EventArgs e) private void ForceNewProfile(string newprofile, VStream tvs) { //BrightIdeasSoftware.CellRightClickEventArgs re = (BrightIdeasSoftware.CellRightClickEventArgs)e; //VStream tvs = (VStream)re.Model; //string newprofile = o.ToString(); if (tvs.sum.qualityProfile.name != newprofile) { tvs.sum.profile_to_use = newprofile; qatool.ForceSummaryUpdate(tvs); //TODO: This doesn't seem necessary. Do you know why it was here?? //EditSummaryInList(tvs, EventArgs.Empty); } /* VStream tvs; if (ResultListView.SelectedItems.Count > 0) { for (int i = 0; i < ResultListView.SelectedItems.Count; i++) { tvs = (VStream)ResultListView.SelectedItems[i].Tag; tvs.sum.profile_to_use = newprofile; qatool.ForceSummaryUpdate(tvs); } } */ }
public static void RemoveVStream(VStream vStream) { lock (padlock) { // Global.log(string.Format("RemoveVStream: {0}", vStream.StreamFileName)); SummaryList.Remove(vStream); //VStreamActionList.Add(new AddRemoveVStreamItem() { VStream = vStream, IsAdd = false }); summaryListIsDirty = true; } }
void FailedResultsListViewDataSetSelectedIndexChanged(object sender, System.EventArgs e) { try { { BrightIdeasSoftware.ObjectListView listView = (BrightIdeasSoftware.ObjectListView)sender; vs1 = (VStream)listView.GetSelectedObject(); //Enable User Decision buttons if (vs1 != null && (vs1 != vs)) { Pass_Button.Enabled = true; Fail_Button.Enabled = true; CancelUserDecision_Button.Enabled = true; StopClip(); openDetails(vs1); if (this.vs.Final_Decision.String == "Not made")//Melek { playbutton.Enabled = false; VideoPanelLabel.Enabled = false; } } } } catch (Exception ex) { } }
/// <summary> /// delete result files /// </summary> /// <param name="lvs"></param> private void deleteResultsFiles(VStream lvs) { if (lvs != null) { try { if (File.Exists(lvs.path.QVRPath)) File.Delete(lvs.path.QVRPath); if (File.Exists(lvs.path.QPLPath)) File.Delete(lvs.path.QPLPath); if (File.Exists(lvs.path.QARPath)) File.Delete(lvs.path.QARPath); if (File.Exists(lvs.path.ArchivePath)) File.Delete(lvs.path.ArchivePath); } catch (SystemException ex) { Global.log("Error deleting results files for " + lvs.StreamFileName + ".ts.\n" + ex); //Melek - path.name => streamfilename } } }
//Create PDF File-Melek private bool CreateMultiplePDFFile(string rname, VStream rs, Document doc) { try { string reviewmenureportname, pdfFilePath, profiledate, s_profile, s_PMOSscore, s_Trough, s_BadScenes, s_BlankScenes, s_videobitrate, s_comment, s_finaldecision, s_encodingmode, s_resolution, s_processedduration, imageFilePath, logoFilePath, s_overallbitrate, s_path, s_clipname, s_FileSizeinMBString, s_tracks, s_qwarnings, cmt2; ListViewItem lvi = new ListViewItem(); Chunk chnkk = new Chunk("\n"); iTextSharp.text.Image jpg; //if (((GenerateReportResultsViewClicked == true) || (GenerateReportButtonReviewViewClicked==true)) && (reportdatedisplayed == false)) if (GenerateReportButtonReviewViewClicked == true && reportdatedisplayed == false) //Many clips selected many reports generated { reportdatedisplayed = true; reportname = rs.StreamFileName; pdfFilePath = RepDirTextBox.Text + reportname + ".pdf"; PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream(pdfFilePath, FileMode.Create)); doc.Open();//Open Document to write } imageFilePath = AppDomain.CurrentDomain.BaseDirectory + "Images\\" + rs.StreamName + ".jpg"; if (File.Exists(imageFilePath)) { //jpg= global::QA.Properties.Resources.Nothumb; jpg = iTextSharp.text.Image.GetInstance(imageFilePath); } else //this case was added for the files which have< 2 seconds duration but with the latest configuration these files are not supported { jpg = iTextSharp.text.Image.GetInstance(AppDomain.CurrentDomain.BaseDirectory + "Nothumb.jpg"); } if (!docopened) { //string logoFilePath =AppDomain.CurrentDomain.BaseDirectory + "Images\\Path 1 logo.JPG"; logoFilePath = AppDomain.CurrentDomain.BaseDirectory + "Path 1 logo.JPG"; iTextSharp.text.Image logo = iTextSharp.text.Image.GetInstance(logoFilePath); logo.SpacingAfter = 3f;//1f //logo.ScaleToFit(100f, 80f); logo.Alignment = Element.ALIGN_RIGHT; //logo.Url("http://www.path1.com"); logo.SpacingAfter = 30f; doc.Add(logo); //doc.Add(chnkk); //Paragraph vcortextitle = new Paragraph(("v.Cortex Report", FontFactory.GetFont(FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD)); iTextSharp.text.Font font = FontFactory.GetFont(FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD); Paragraph vcortextitle = new Paragraph(" v.Cortex Report", font); vcortextitle.Alignment = Element.ALIGN_CENTER; doc.Add(new Phrase(vcortextitle)); //vcortextitle.Alignment = Element.ALIGN_CENTER; //Chunk ckk = new Chunk(" v.Cortex Report", FontFactory.GetFont(FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD)); //Paragraph paragraph = new Paragraph("v.Cortex Report"); //paragraph.SpacingAfter = 30f; //paragraph.Font = FontFactory.GetFont(FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD); //paragraph.Alignment = Element.ALIGN_CENTER; //doc.Add(paragraph); //doc.Add(new Phrase(ckk)); //Report name entered by user if (GenerateReportResultsViewClicked == true) { reviewmenureportname = ReportNameResultsViewtextBox.Text; // GenerateReportResultsViewClicked = false; } else { reviewmenureportname = ReportNametextBoxReviewMenu.Text; } Chunk r_name = new Chunk(reviewmenureportname, FontFactory.GetFont(FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD)); doc.Add(chnkk); doc.Add(new Phrase(r_name)); docopened = true; GenerateReportResultsViewClicked = false; GenerateReportButtonReviewViewClicked = false; } if (reportdatedisplayed == true) { DateTime rep_tim = DateTime.Now; // doc.Add(new Paragraph("Report Created: ")); profiledate = "Report Generated: " + rep_tim.ToString(); Paragraph parag = new Paragraph(profiledate); doc.Add(parag); reportdatedisplayed = false; } //else //{ //} doc.Add(chnkk); //Give space before image jpg.SpacingBefore = 200f; //Give some space after the image //jpg.SpacingAfter = 100f; jpg.Alignment = Element.ALIGN_LEFT; //Resize image depend upon your need //jpg.ScaleToFit(280f, 260f); //doc.Add(paragraph); // add paragraph to the document doc.Add(jpg); //add an image to the created pdf document //Give some space after the image // jpg.SpacingAfter = 3f; s_clipname = "Clip Name: " + rs.StreamFileName; Chunk ckk2 = new Chunk(s_clipname, FontFactory.GetFont(FontFactory.HELVETICA, 12, iTextSharp.text.Font.NORMAL)); //Color cc = new Color(); //if (rs.Final_Decision.String == "Fail") { cc = Color.Red; } //else cc = Color.Green; //BaseColor colr = new BaseColor(cc); //if (rs.Final_Decision.String == "Fail") { colr = BaseColor.RED; } //else colr = BaseColor.GREEN; // ckk.SetBackground(colr); doc.Add(new Phrase(ckk2)); s_finaldecision = "Final decision: " + rs.Final_Decision.String; doc.Add(new Paragraph(s_finaldecision)); s_PMOSscore = "Average PMOS Score: " + rs.avMOS; doc.Add(new Paragraph(s_PMOSscore)); s_profile = "Applied Profile: " + rs.QualityProfile; doc.Add(new Paragraph(s_profile)); // doc.Add(chnkk); if (rs.Comment == "") s_comment = "N/A"; else s_comment = rs.Comment; cmt2 = "User Decision Comment: " + s_comment; doc.Add(new Paragraph(cmt2)); // doc.Add(chnkk); #region alerts list if (rs != null && ((rs.sum.AggAlertScnA.Count != 0) || (rs.sum.AlertScnA.Count != 0) || (rs.sum.AggBSA.Count != 0))) { doc.Add(chnkk); s_qwarnings = "Qaulity Warnings: "; doc.Add(new Paragraph(s_qwarnings)); for (int i = 0; i < rs.sum.QualityWarningA.Count; i++) { string w = rs.sum.QualityWarningA[i].Detail; doc.Add(new Paragraph(w)); } s_BadScenes = "Bad Percent: " + rs.BadPerc; doc.Add(new Paragraph(s_BadScenes)); if ((rs.TroughWarning == "_") || (rs.TroughWarning == "N/A")) { /*s_Trough = "Trough Warning: N/A";*/ } else { s_Trough = "Trough Warning: " + rs.TroughWarning; doc.Add(new Paragraph(s_Trough)); } if ((rs.BlankWarning == "_") || (rs.BlankWarning == "N/A")) { /*s_BlankScenes = "Blank Scenes Warning: N/A";*/ } else { s_BlankScenes = "Blank Scenes Warning: " + rs.BlankWarning; doc.Add(new Paragraph(s_BlankScenes)); } doc.Add(chnkk); if (rs.sum.AlertScnA.Count != 0) { Paragraph paragraph = new Paragraph("Alerts List"); doc.Add(paragraph); string title = "# Type Start Duration Comment"; doc.Add(new Paragraph(title)); List<AlertScene> tempa = new List<AlertScene>(); AlertScene AlScn; if (rs.sum.qualityProfile.aggregatedBadSceneDetector.Enabled == true) if (ShowAggBSBox.Checked == true) tempa = rs.sum.AggAlertScnA; else tempa = rs.sum.AlertScnA; else tempa = rs.sum.AlertScnA; for (int i = 0; i < tempa.Count; i++) { ListViewItem lviItem = new ListViewItem(); try { AlScn = (AlertScene)tempa[i]; lviItem.Text = Convert.ToString(i); lviItem.Tag = AlScn; lviItem.SubItems.Add(AlScn.Type); lviItem.SubItems.Add(Global.frameToDurationString((int)AlScn.Start, rs.cv.format.frameRate, true)); lviItem.SubItems.Add(Global.frameToDurationString((int)AlScn.DurationInFrames, rs.cv.format.frameRate, true)); if ((AlScn.Type == "Bad Scene") || (AlScn.Type == "bad scene")) { double mosav = Math.Round(AlScn.Value, 2); if (mosav > rs.sum.qualityProfile.badSceneDetector.MosThreshold) mosav = rs.sum.qualityProfile.badSceneDetector.MosThreshold; lviItem.SubItems.Add("mos=" + Convert.ToString(Math.Round(mosav, 2))); string bsinfo = lviItem.Text.ToString() + " " + AlScn.Type + " " + Global.frameToDurationString((int)AlScn.Start, rs.cv.format.frameRate, true) + " " + Global.frameToDurationString((int)AlScn.DurationInFrames, rs.cv.format.frameRate, true) + " MOS: " + Convert.ToString(Math.Round(mosav, 2)); doc.Add(new Paragraph(bsinfo)); } else if (AlScn.Type == "Agg Bad Scene") { double mosav = Math.Round(AlScn.Value, 2); string absinfo = lviItem.Text.ToString() + " " + AlScn.Type + " " + Global.frameToDurationString((int)AlScn.Start, rs.cv.format.frameRate, true) + " " + Global.frameToDurationString((int)AlScn.DurationInFrames, rs.cv.format.frameRate, true) + " MOS: " + Convert.ToString(Math.Round(mosav, 2)); doc.Add(new Paragraph(absinfo)); } else if (AlScn.Type == "Black") { double mosav = Math.Round(AlScn.Value, 2); string absinfo = lviItem.Text.ToString() + " " + AlScn.Type + " " + Global.frameToDurationString((int)AlScn.Start, rs.cv.format.frameRate, true) + " " + Global.frameToDurationString((int)AlScn.DurationInFrames, rs.cv.format.frameRate, true) + " Int: " + Convert.ToString(Math.Round(mosav, 2)); doc.Add(new Paragraph(absinfo)); } else if (AlScn.Type == "White") { double mosav = Math.Round(AlScn.Value, 2); string absinfo = lviItem.Text.ToString() + " " + AlScn.Type + " " + Global.frameToDurationString((int)AlScn.Start, rs.cv.format.frameRate, true) + " " + Global.frameToDurationString((int)AlScn.DurationInFrames, rs.cv.format.frameRate, true) + " Int: " + Convert.ToString(Math.Round(mosav, 2)); doc.Add(new Paragraph(absinfo)); } else if (AlScn.Type == "Frozen") { doc.Add(new Paragraph(lviItem.Text.ToString())); } else if (AlScn.Type == "Trough") { double mosav = Math.Round(AlScn.Value, 2); string absinfo = lviItem.Text.ToString() + " " + AlScn.Type + " " + Global.frameToDurationString((int)AlScn.Start, rs.cv.format.frameRate, true) + " " + Global.frameToDurationString((int)AlScn.DurationInFrames, rs.cv.format.frameRate, true) + " Int: " + Convert.ToString(Math.Round(mosav, 2)); doc.Add(new Paragraph(absinfo)); } else if (AlScn.Type == "Field order") { string commnt = " " + AlScn.Comment; doc.Add(new Paragraph(commnt)); } } catch (Exception ex) { Console.WriteLine("Problem updating the badscene arraylist view\n" + ex); return false; } } } } #endregion end of alerts list s_path = "Clip Path: " + rs.path.StreamPath; s_FileSizeinMBString = "Clip Size : " + rs.format.overall.FileSizeinMBString; s_encodingmode = "Video Specs " + rs.VideoSpecsSummaryString; s_processedduration = "Processed Video Duration (hr:min:sec): " + rs.ProcessedDurationString; s_tracks = "Tracks : " + rs.format.overall.nbVideoStreams + " video, " + rs.format.overall.nbAudioStreams + " audio."; //s_BlankScenes = "Blank Scenes Warning: " + rs.BlankWarning; s_resolution = "Resolution Label: " + rs.ResolutionLabel; s_overallbitrate = "Overall Bit Rate: " + rs.format.OverallBitrateString; s_videobitrate = "Video Bit Rate: " + rs.VideoBitrateReported + " Mbps"; //s_totaldecoderereports = "Decoder: "+rs.TotalDecoderWarnings() + " decoding warnings reported."; //s_demuxerrors ="Container: "+ rs.demuxReport.ErrorPackets + " packet warnings."; //s_packetloss = "Packet loss: Reconstructed frames : " + rs.videoModelCheck.recStats.affectedFrames + " ( " + Math.Round((double)rs.videoModelCheck.recStats.affectedFrames / (double)rs.videoModelCheck.processedDurationInFrames, 2) + "%)."; doc.Add(chnkk); doc.Add(new Paragraph(s_path)); doc.Add(new Paragraph(s_encodingmode)); doc.Add(new Paragraph(s_tracks)); doc.Add(new Paragraph(s_FileSizeinMBString)); doc.Add(new Paragraph(s_overallbitrate)); doc.Add(new Paragraph(s_videobitrate)); //doc.Add(new Paragraph(s_resolution)); doc.Add(new Paragraph(s_processedduration)); doc.Add(chnkk); //Paragraph parend = new Paragraph("------------------------------------------------------------------------------------------------------------------------ "); //doc.Add(parend); //doc.Add(new Paragraph(s_packetloss)); //doc.Add(new Paragraph(s_totaldecoderereports)); //doc.Add(new Paragraph(s_demuxerrors)); //Paragraph par = new Paragraph(" "); //par.SpacingBefore = 10f; ////////////// par.Alignment = Element.ALIGN_CENTER; ////////////Anchor anchor1 = new Anchor("Help", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.NORMAL, new iTextSharp.text.BaseColor(0, 0, 255))); ////////////anchor1.Reference = "http://www.path1.com"; ////////////anchor1.Name = "left"; ////////////par.Add(anchor1); ////////////par.Add("/"); ////////////Anchor anchor2 = new Anchor("Contact", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.NORMAL, new iTextSharp.text.BaseColor(0, 0, 255))); ////////////anchor2.Reference = "http://www.path1.com"; ////////////anchor2.Name = "middle"; ////////////par.Add(anchor2); ////////////par.Add("/"); ////////////Anchor anchor3 = new Anchor("Whatever we want to show", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.NORMAL, new iTextSharp.text.BaseColor(0, 0, 255))); ////////////anchor3.Reference = "http://www.path1.com"; ////////////anchor3.Name = "middle"; ////////////par.Add(anchor3); ////////////par.Alignment = Element.ALIGN_CENTER; ////////////doc.Add(par); ////////////doc.AddAuthor("Path1"); ////////////doc.AddTitle("v.Cortex Report"); ////////////doc.AddSubject("This report is created by v.Cortex"); // par.Add(new Chunk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")); // doc.Add(par); //Anchor anchor2 = new Anchor("please jump to a local destination", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.NORMAL, new iTextSharp.text.BaseColor(0, 0, 255))); //anchor2.Reference = "#top"; //doc.Add(anchor2); //Phrase p1 = new Phrase(); //Chunk ck2 = new Chunk("Stream Info"); //p1.Add(ck2); //Chunk ck3 = new Chunk("Video Info"); //p1.Add(ck3); //Chunk ck4 = new Chunk("Audio Info"); //p1.Add(ck4); //string sFilePath = AppDomain.CurrentDomain.BaseDirectory + "Images\\FiveMinAd.jpg"; //iTextSharp.text.Image sJPG = iTextSharp.text.Image.GetInstance(sFilePath); //sJPG.Alignment = Element.ALIGN_CENTER; //Chunk ck5 = new Chunk(sJPG, 200, 100); //p1.Add(ck); //doc.Add(p1); //ColumnText ct = new ColumnText(wri.DirectContent); //ct.SetSimpleColumn(doc.Left, doc.Bottom, doc.Right, doc.Top); //for (int i = 0; i < 10; i++) //{ // ct.AddElement(new Phrase(i + ". hello")); //} //int status = ct.Go(); //while (ColumnText.HasMoreText(status)) //{ // doc.NewPage(); // //ct.YLine(doc.Top()); // status = ct.Go(); //} // iTextSharp.text.pdf. } catch (DocumentException docEx) { //handle pdf document exception if any MessageBox.Show(docEx.Message); return false; } catch (IOException ioEx) { // handle IO exception MessageBox.Show(ioEx.Message); return false; } catch (Exception ex) { // ahndle other exception if occurs MessageBox.Show(ex.Message); } finally { //Close document and write } return true; }