-
July 12th, 2015, 10:53 AM
#1
Save an array as pdf to disk
Hi,
I have a function which retruns a pdf as a byte[]
private static CreatePDF()
{
byte[] pdf;
//Do some work & create pdf
return pdf;
}
If I call this function this way:
byte[] MyPdf = CreatePDF()
How can I save MyPdf to disk as a pdf file (c:\path\Filename.pdf) ?
I'm using .NET 2
Thanks
-
July 12th, 2015, 07:04 PM
#2
Re: Save an array as pdf to disk
Look at the StreamWriter class in msdn.
P.S. why use .Net 2.0 ?
-
July 20th, 2015, 06:18 PM
#3
Re: Save an array as pdf to disk
As far as I know there are no native .Net methods that can save to PDF. You can use PdfSharp or other PDF libraries to achieve this.
-
July 20th, 2015, 06:20 PM
#4
Re: Save an array as pdf to disk
Sorry...if you DO have a method that actually returns the PDF as an Array you can use
File.WriteAllBytes("yourfile.ext", yourBytes) and pass your array variable.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|