how can I validate a previously converted PDF/A 3B file - using a MemoryStream (not saving a XML to disk)?
I tried accessing the MemoryStreams of the Convert() or Validate() methods but always ran into the exception that the MemoryStream is already closed.
Thanks for your quick answer.
The boolean value is not enough. It’s good to know if the convertion was successfull, but that is no indication whether the resulting PDF is a 100% valid PDF/A document (e.g. missing fonts, missing/invalid metadata etc.)
For that I need the validation method after I converted the PDF to PDF/A AND I need the validation result as a MemoryStream.
// Open document
Document pdfDocument = new Document(inputstream);
// Convert to PDF/A compliant document
MemoryStream log = new MemoryStream();
//during conversion process, the validation is also performed
//convert MemoryStream back to byte array
byte data = log.ToArray();
//create a FileStream to save the output PDF file
FileStream output = new FileStream(myDir+"Aufstieg_durch_Bildung_2013_PDFA3b_log.xml", FileMode.Create, FileAccess.Write);
//write byte array contents in the output file stream
output.Write(data, 0, data.Length);
//close output file
Please feel free to contact us for any further assistance.
Thanks for your answer.
Your code is working but the nevertheless - the MemoryStream “log” IS CLOSED.
At this point the solution for my requirement is that I’m going to convert the CLOSED MemoryStream into a byte array and then convert the byte array into a MemoryStream (one that I can work with)…
That’s NOT very efficient…