Hi. I cant seem to find a working example on how to stream a generated pdf to the browser. When I save the pdf to the file system, it works.
Can you guide me to an example where I can see how to send the stream to the browser? I dont want the client to download the pdf as file, but rather just view the pdf directly in the browser.
Thanks in advance
Current code that can save to file:
'Instantiate Pdf instance by calling its empty constructor
Dim pdf1 As Aspose.Pdf.Generator.Pdf = New Aspose.Pdf.Generator.Pdf()
'Add a section into the pdf document
Dim sec As Aspose.Pdf.Generator.Section = pdf1.Sections.Add()
Dim data = GetFile(4273)
’ Create a MemoryStream object from image Byte array
Dim ms As MemoryStream = New MemoryStream(data)
'Create an image object in the section
Dim imageht As Aspose.Pdf.Generator.Image = New Aspose.Pdf.Generator.Image(sec)
'Set the type of image using ImageFileType enumeration
imageht.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Tiff
’ Specify the image source as MemoryStream
imageht.ImageInfo.ImageStream = ms
'Add image object into the Paragraphs collection of the section
sec.Paragraphs.Add(imageht)
'Save the Pdf
pdf1.Save(“c:\temp\tifftest\tiff1.pdf”)
’ Close the MemoryStream Object
ms.Close()