Hello,
I'm trying to use this method SaveDocumentToByteArray(), to get a byte[] and return to a client, so that this client can then create a pdf file using this byte[] object. For some weird reason, the pdf file created doesn't open because of an error when creating the file.
Do i have to do anything else?
Server:
documentPDF = stiReport.SaveDocumentToByteArray();
return documentPDF;
Client:
byte[] document = target.GetPDFDocumentPreview(doc, true, "Report.mrt");
//Save byte[] in a pdf file
system.IO.File.WriteAllBytes(@"C:\Temp\filetosave.pdf", document);
Thank you for your help.
Best Regards
Bruno Fernandes
Using SaveDocumentToByteArray()
Re: Using SaveDocumentToByteArray()
Hello,
SaveDocument method save the rendered document in our format - .mdc file, not in PDF. You can use the Export method for save the document as pdf.
Please try to use the following code on client:
Thank you.
SaveDocument method save the rendered document in our format - .mdc file, not in PDF. You can use the Export method for save the document as pdf.
Please try to use the following code on client:
Code: Select all
byte[] document = target.GetPDFDocumentPreview(doc, true, "Report.mrt");
...
report.LoadDocument(document);
report.ExportDocument(StiExportFormat.Pdf, @"C:\Temp\filetosave.pdf");
Re: Using SaveDocumentToByteArray()
Thank you for your help.
I just thought that the method SaveDocumentToByteArray(), would save the document to a Byte[], and then i could pick this byte[] and save it to a pdf file.
I just thought that the method SaveDocumentToByteArray(), would save the document to a Byte[], and then i could pick this byte[] and save it to a pdf file.
Re: Using SaveDocumentToByteArray()
Hello,
Let us know if you need any additional help.
Let us know if you need any additional help.