Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Jan 31, 2022 11:33 am

Hi,
As per your guidance, I was able to generate the PDF file using ASP.Net Core 5.0

Can you guide me how to download the pdf file in the browser?

Thanks

sajalntoo
 
Posts: 14
Joined: Thu Jan 27, 2022 7:07 am

Tue Feb 01, 2022 9:02 am

Hello,

Thank you for your inquiry.
Download the generated PDF file from the browser, save the file as a stream, and then write the stream to the file. Please refer to the code below:
Code: Select all
//save as stream
pdfDocument.SaveToStream(stream, FileFormat.PDF);
//write to file
File.WriteAllBytes(resultFilePath, stream.ToArray());

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron