I am running Aspose.Pdf 7.9 in .NET, and using it to convert PDF files in PDF format 1.3 into PDF format 1.5. I am calling the Document.Convert(Stream, PdfFormat, ConvertErrorAction) overload with a MemoryStream, PdfFormat.v_1_5, ConvertErrorAction.None. The documentation for this overload of Document.Convert says it will "save errors into the specified stream". I am trying to find out how I can programmatically determine whether the conversion operation encountered an error by examining what got saved into the stream after the method runs, but the documentation does not provide sufficient information to do that. I've determined that the Convert method disposes the Stream parameter, so it limits my options for reading the data back from a memory stream, but MemoryStream.ToArray() as a parameter into Encoding.Default.GetString(byte[]) seems to work as a way to get the data back. I've tried a few different PDF files into the Convert method, and in all of those tests, the data from the Stream has come back as:
1.0Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved.5/28/2015 3:15:47 PM
That looks to me as if the log does not indicate an error, but that's just my assumption. I would like documentation or confirmation. Also, the "file" tag's "Name" attribute is "test.pdf", but that does not reflect the actual name of the file used in that Document's constructor; it's getting "test.pdf" as the "Name" in this log regardless of the file name passed in. If my assumption that this sample log would indicate a successful conversion is correct, what would change about it when conversion did encounter an error? Would it add additional content in the log? If it were to add some new tag to the log for every error, I could potentially test if the string contains that tag to determine if there was an error. Or, since the success log's content length seems like it would be pretty stable since dates only have small variations in the number of characters and the filename seems to always be "test.pdf" regardless of the real filename, I could potentially make a programmatic decision just based on the length of the content. But I also have no idea how to craft a file that would create one of these conversion errors, so I have no way to produce an example log of an error, thus I need documentation or a sample log with an error provided.