Hi Thomas ,
A very good morning to you
I am facing a problem with opening the pdf file.
My code is :
Document document = invoiceForm.CreateDocument();
// Create a renderer for PDF that uses Unicode font encoding
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(true);
// Set the MigraDoc document
pdfRenderer.Document = document;
// Create the PDF document
pdfRenderer.RenderDocument();
// Save the PDF document...
string filename = "Invoice.pdf";
MemoryStream stream = new MemoryStream();
stream.Seek(0, SeekOrigin.Begin);
pdfRenderer.PdfDocument.Save(stream, false);
byte[] data = new byte[stream.Length];
stream.Read(data, 0, data.Length);
stream.Close();
InsertBlob("testblob", data, "application/pdf", "invoicedoc");
byte[] result = GetBlob("testblob", "invoicedoc");
Now when i convert the byte array to pdf file and try to open it then i am getting this error :
"The document does not start with %PDF-"
Please help me out...I tried to open the pdf both using the blob URL as well as by a file stream but it didn't work.
Thanks !
Regards
Rashid Ali