Exemplo n.º 1
0
 private void RenderConvictToPdf(Convict convict, Aspose.Pdf.Generator.Pdf pdf)
 {
     var section = pdf.Sections.Add();
     RenderPersonInfoToSection(convict, section);
     foreach (var crime in convict.Crimes)
     {
         RenderCrimeInfoToSection(crime,section);
     }
 }
Exemplo n.º 2
0
 private void RenderPersonInfoToSection(Convict convict, Section section)
 {
     var sb = new StringBuilder();
     sb.Append("\n");
     sb.Append("\n");
     AppendLineBreak(sb);
     sb.Append(string.Format(convictInfoTemplate, convict.FullName,
                                               DateTime.Now.Year - convict.DateOfBirth.Year,
                                               Enum.GetName(typeof(Gender), convict.Gender),
                                               convict.Height,
                                               convict.Weight));
     AppendLineBreak(sb);
     InsertParagraph(sb.ToString(), section);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a pdf representation for a convict and saves it to the output stream
 /// </summary>
 /// <param name="convict">The input data that is to be rendered</param>
 /// <param name="output">An output stream to hold the resulting pdf.This stream's disposal should be managed externaly</param>
 public void CreatePdf(Convict convict, Stream output)
 {
     var pdf = new Aspose.Pdf.Generator.Pdf();
     RenderConvictToPdf(convict,pdf);
     pdf.Save(output);
 }