We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Pdf in ASP.NET C#

Hi,


I want to use Aspose for web site which is created in ASP.NET.
I found HTML5 example but it is too complicated. Bootstrap, Jquery, Javascript and so on…
Is not there any way to use directly API in ASP.NET C#?

I mean, I should load pdf file to webpage for viewing with many lines of code.
Is there any way for that purpose?

Thanks.

Hi Mehmet,


Thanks for your inquriy. If you want to send PDF to browser then please check following code snippet. It will help you to accomplish the task.

// load PDF file<o:p></o:p>

Document doc = new Document("input.pdf");

MemoryStream stream = new MemoryStream();

// Save PDF file to Stream

doc.Save(stream);

Response.Clear();

//Specify the document type.

Response.ContentType = "application/pdf";

Response.AddHeader("content-disposition", "inline; filename=input.pdf");

byte[] bytes = stream.GetBuffer();

Response.BinaryWrite(bytes);

//System.IO.File.Delete(SaveLocation);

Response.Flush();

Response.Close();

Response.End();

Please feel free to contact us for any further assistance.


Best Regards,