We are currently using the free 30 day trial of Aspose.PDF. I am using a template pdf to fill in some information and then save it to our database. Our goal is to be able to retrieve tis document from the database once it has be prefilled with information. I am not getting errors when creating and filling the form with aspose. I’m also able to save the file the issue comes with retrieving the file from the database. Whenever i try and get the file as a pdf from the database by converting the byte array into a file the pdf opens with an error saying “Failed to load pdf document”
var templateBytes = Documents.Resources.ResourceManager.GetObject(“FILE”) as byte[];
var memoryStream = new MemoryStream(templateBytes);
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(memoryStream);
TextBoxField textBoxField15 = pdfDocument.Form[“undefined”] as TextBoxField;
TextBoxField textBoxField16 = pdfDocument.Form[“undefined_2”] as TextBoxField;
TextBoxField textBoxField17 = pdfDocument.Form[“undefined_3”] as TextBoxField;
textBoxField15.Value = “111111”;
textBoxField16.Value = “222222”;
textBoxField17.Value = “333333”;
pdfDocument.Save(stream, Aspose.Pdf.SaveFormat.Pdf);
This is how I’m saving/filling the file before saving to the database. We then save it by turning the stream into a byte array and saving that array to our database. Am I missing something is the save process?