Formatting is messed up after being added to a list

I am generating pdfs using narratives that are passed into a function so that each narrative is put into it’s own pdf. Once each pdf is generated it is added to a List<Aspose.Pdf> and the whole list is returned at the end of the function. When the pdf is first generated it is formatted correctly (See the attachment beginning with “Generated”) but as soon as I add it to the list, the formatting gets messed up (see the attachment beginning with Added). This is the code I am using to add and save the pdfs:


pdf.Title = DateTime.Now.ToString(“MMddhhmmssffff”) + " - " + title + “.pdf”;
pdfs.Add(pdf);
pdf.Save(@“D:\temp” + "Generated " + pdf.Title);
pdfs.Last().Save(@“D:\temp” + "Added " + pdf.Title);

executing the above code resulted in the attached pdfs. Any guidance is appreciated.

Thanks,
Jess

Hi Jess,


Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for .NET 10.9.0 using following code snippet and I am unable to notice any issue. Can you please try using the latest release and in case the issue still persists, please share the sample project so that we can again test the scenario in our environment. We are sorry for your inconvenience.

[C#]

Document document = new
Document(“c:/pdftest/Generated+10080947217016±+NARRATIVE%23+1.pdf”);<o:p></o:p>

document.Info.Title = DateTime.Now.ToString("MMddhhmmssffff") + " - " + "Generated+10080947217016+-+NARRATIVE%23+1" + ".pdf";

document.Save(@“c:/pdftest/Generated+10080947217016±+NARRATIVE%23+1_updated.pdf”);

Hi Jess,


Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for .NET 10.9.0 using following code snippet and I am unable to notice any issue. Can you please try using the latest release and in case the issue still persists, please share the sample project so that we can again test the scenario in our environment. We are sorry for your inconvenience.

[C#]

Document document = new
Document(“c:/pdftest/Generated+10080947217016±+NARRATIVE%23+1.pdf”);<o:p></o:p>

document.Info.Title = DateTime.Now.ToString("MMddhhmmssffff") + " - " + "Generated+10080947217016+-+NARRATIVE%23+1" + ".pdf";

document.Save(@“c:/pdftest/Generated+10080947217016±+NARRATIVE%23+1_updated.pdf”);