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.

Sun May 03, 2020 6:40 am

Hi...
I use Spire.Pdf Library to edit PDF File...
How I can Download Edited file instead of preview it....
Code: Select all
Dim OutPDFfilename As String = Server.MapPath("~\Temp\PDFTools\result.pdf")
 'Save the document
 doc.SaveToFile(OutPDFfilename)
System.Diagnostics.Process.Start(OutPDFfilename)

Thank you.....

hamzasukkar
 
Posts: 16
Joined: Wed Mar 25, 2020 8:47 am

Mon May 04, 2020 5:54 am

Hello,

Thanks for your inquiry.
Do you mean to send the edited file to Client Browser and then download it? If so, please refer to the following code snippet. Feel free to contact us if there is any question.
Code: Select all
doc.SaveToHttpResponse("sample.pdf", HttpContext.Current.Response, HttpReadType.Save)


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 04, 2020 6:54 am

Thank you..
Yes I want to send the edited file to Client Browser and then download it...
I use your code
Code: Select all
doc.SaveToHttpResponse("sample.pdf", HttpContext.Current.Response, HttpReadType.Save)

But I get this error.(I uoload it in attachment)

hamzasukkar
 
Posts: 16
Joined: Wed Mar 25, 2020 8:47 am

Mon May 04, 2020 7:23 am

Hello,

Thanks for your prompt response.
Below is my testing project, please directly run it on your side.
http://www.e-iceblue.com/downloads/demo/21435Demo.zip

If your project is different from mine, please share your project with us, then we will do further investigation. You could sent it to us([email protected]) via email.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 04, 2020 7:39 am

Thank you for your replay...
I use in my project ASP.net(MVC).So I edit PDF in Controller and i want to download it in Client Browser...
Thank you......

hamzasukkar
 
Posts: 16
Joined: Wed Mar 25, 2020 8:47 am

Mon May 04, 2020 9:54 am

Hello,

Thanks for your more information.
Here I made a sample demo for you, please download and test it on your side. Any questions, please feel free to write back.
http://www.e-iceblue.com/downloads/demo ... ewDemo.zip

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 04, 2020 10:33 am

Thank You...
It's work...
but is there a way to download it automatically such as this function who preview file directly...
System.Diagnostics.Process.Start("test.pdf")
Thank you very much....

hamzasukkar
 
Posts: 16
Joined: Wed Mar 25, 2020 8:47 am

Tue May 05, 2020 5:54 am

Hello,

Thanks for your reply.
Please refer to the attached code file. If I misunderstood, please describe your requirement in details.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed May 06, 2020 9:21 am

Thank you....
It's work....
thank you very much....

hamzasukkar
 
Posts: 16
Joined: Wed Mar 25, 2020 8:47 am

Wed May 06, 2020 9:31 am

Hello,

You are welcome.
If you encounter any question related to our product in the future, please feel free to contact us.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF