Free Support Forum - aspose.com

Newbie problem with protyping "hello world" example

Based on the help page: http://www.aspose.com/documentation/file-format-components/aspose.pdf-for-.net-and-java/create-a-hello-world-pdf-document-through-api.html

I am trying to do this in vb.net with VS 2005 on an XP machine. My code is as follows, but all of the references to pdf and subsequent statements (section, etc.) have an "undefined" error. The pdf method or property does not show up in the intellisense list for Aspose.pdf.kit - so I'm wondering if there is a different .dll that I should be adding to my project?

Thanks.

Imports Microsoft.VisualBasic

Imports System

Imports Aspose.Pdf.Kit

Imports System.Xml

Imports System.IO

Imports System.Web

Imports System.Data

Imports System.Web.HttpContext

Imports System.Security

Partial Class _Default

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim Hold As String

'Create pdf document

Dim pdf1 As pdf = New Pdf()

'Add a section into the pdf document

Dim sec1 As Section = pdf1.Sections.Add()

'Add a text paragraph into the section

sec1.Paragraphs.Add(New Text("Hello World"))

'Save the document

pdf1.Save("HelloWorld.pdf")

End Sub

End Class

Hi,

Aspose.Pdf and Aspose.Pdf.Kit are seperate components. For this code to work you need to install Aspose.Pdf and import Aspose.Pdf instead of Aspose.Pdf.Kit.

Thanks.