Free Support Forum -


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)
Dim text1 As Text = New Text(section)
text1.Margin.Top = 30
Dim segment1 As Segment = New Segment(text1)
segment1.Content = “this is text content”

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()

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

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.