Free Support Forum - aspose.com

Pdf.save(response)

Hi,

Can anyone explain me what are wrong in the codes? See below
Thanks inadvance.

-Loi -

I have copied direct example codes from Ben Li

Dim pdf As Pdf = New Pdf()
pdf.Security = New Security()
pdf.Security.IsCopyingAllowed = False
pdf.PageSetup.PageHeight = PageSize.A2Height
Dim section As Section = New Section(pdf)
pdf.Sections.Add(section)
Dim text1 As Text = New Text(section)
text1.Margin.Top = 30
section.Paragraphs.Add(text1)
Dim segment1 As Segment = New Segment(text1)
text1.Segments.Add(segment1)
segment1.Content = “this is text content”
pdf.Save(Response)
Response.End()

I run a test on the codes. I found out that I have problem to dim either this code
Dim pdf As Pdf = New Pdf()
or
pdf.Save(Response)

Even though I have already impoterd Aspose.pdf

If I modified the following dim
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf

then I get a problem with
Pdf.save(response)

The error message:
C:\Inetpub\wwwroot\Pdf\WebForm1.aspx.vb(62): Overload resolution failed because no accessible ‘Save’ can be called with these arguments:
‘Public Sub Save(stream As System.IO.Stream)’: Value of type ‘System.Web.HttpResponse’ cannot be converted to ‘System.IO.Stream’.
‘Public Sub Save(pdfFile As String)’: Value of type ‘System.Web.HttpResponse’ cannot be converted to ‘String’.

Dear Loi,

The Save(HttpResponse) method has beed moved. Please use this one.