Hi,
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
Document doc = new Document("input.pdf");
using (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");
// Write the PDF content to the response
byte[] bytes = stream.ToArray(); // Use ToArray() instead of GetBuffer() to avoid extra padding
Response.BinaryWrite(bytes);
// Flush and close the response
Response.Flush();
Response.Close();
Response.End();
}
Please feel free to contact us for any further assistance.
Best Regards,