'Pdf' is not defined?


Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type ‘Pdf’ is not defined.

Source Error:
Line 1: <%
Line 2: Dim pdf1 As Pdf = New Pdf()
Line 3:
Line 4: pdf1.PageSetup.PageHeight = PageSize.A2Height

Source File: C:\drive-h!gor\webmall3\tests\pdf.aspx Line: 2

Dim pdf1 As Pdf = New Pdf()

pdf1.PageSetup.PageHeight = PageSize.A2Height

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

Dim text1 As Text = New Text(sec1, “this is text content”)
text1.Margin.Top = 30



Dear stiki,

Thank you for considering Aspose.

Please make sure you have add the Aspose.Pdf.dll into your references and used namespace Aspose.Pdf (Imports Aspose.Pdf).


Don’t laugh, but can you explain the details about adding ‘the Aspose.Pdf.dll into your references’ as it relates to the .NET framework? I’ve added the Imports Aspose.Pdf at the top of my code, but I’m not sure how to enable .NET to “see” the dll.


I got it - added it to the Visual Studio .NET 2003 solution - Project / Add Reference menu


I’m still not sure how to add a reference to the dll file…

I’m using classic asp, is it even possible to user aspose PDF with classic asp?


Imports Aspose.pdf

I’ve added that to the first line of my .aspx file

But I still get the error message:
Type ‘Pdf’ is not defined.

Line that is causing the error:
Dim pdf1 As Pdf = New Pdf()


I have finaly figured out how to register the component… but

I am getting an error message:
aspose.pdf.dll was loaded, but the DllRegisterServer entry point was not found. The file can not be registered.

Where should I place the dll files? In system32 folder, or just leave them in the aspose directory in program files?

I would really apreciate if you can help me get it working…


Dear stiki,

Thank you for considering Aspose.

You said you use classic ASP. Do you mean you use ASP in COM application but not ASP.NET? If so, you should register the component for COM manually:

regasm (AsposePdfPath)\Bin\Aspose.Pdf.dll /codebase


Thank you for your reply… but I was unable to make it work…

Here is the error that I got:

Windows cannot find ‘regasm’. Make sure you typed the name correctly… blah blah blah…

If its any help I am workin on WinXp…


Dear stiki,

Thank you for considering Aspose.

In WinXP, the regasm.exe should be in “C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705”. Please change the disk and version number according to your system and add this path to your system’s “PATH” environment variable.


Thank you for taking your time to help me… this seems to be taking alot longer then it should…

I’ve managed to register the dll using regasm.exe… but its still not working and i’m getting the exact same error message:

Type 'PDF" is not defined…

This is how i ran the command to register the dll:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>regasm C:\Progra~1\Aspose\Aspose.Pd
f\bin\aspose.pdf.dll /codebase
Microsoft ® .NET Framework Assembly Registration Utility 1.1.4322.573
Copyright © Microsoft Corporation 1998-2002. All rights reserved.

Types registered successfully


Dear stiki,

Thank you for considering Aspose.

If you are using classic ASP, you should not write code like Aspose.Pdf examples. The examples in Aspose.Pdf work in ASP.NET. Here is an example for using Aspose.Pdf in ASP:


SUB GeneratePdf

Set pdf1 = server.CreateObject(“Aspose.Pdf.Pdf”)

set sec1 = server.CreateObject(“Aspose.Pdf.Section”)


set t1 = server.CreateObject(“Aspose.Pdf.Text”)

set s1 = server.CreateObject(“Aspose.Pdf.Segment”)

s1.Content = “hello”