Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The information in this topic applies to scenarios where you want to use Aspose.PDF for .NET via COM Interop in any of the following programming languages:
Aspose.PDF for .NET executes under the control of the .NET Framework and this is called managed code. Code written in all of the above languages runs outside the .NET Framework and it is called unmanaged code. Interaction between unmanaged code and Aspose.PDF occurs via the .NET facility called COM Interop.
Aspose.PDF objects are .NET objects, but when used via COM Interop, they appear as COM objects in your programming language. Therefore, it is best to make sure you know how to create and use COM objects in your programming language, before you start using Aspose.PDF for .NET.
Here are the topics that you will eventually need to master:
Using COM objects in your programming language. See your programming language documentation and the language-specific topics further in this documentation.
Working with COM objects exposed by .NET COM Interop. See Interoperating With Unmanaged Code and Exposing .NET Framework Components to COM in MSDN.
Aspose.PDF document object model. See Aspose.PDF Programmer’s Guide and API Reference.
You need to install Aspose.PDF for .NET and make sure it is registered with COM Interop (ensuring that it can be called from unmanaged code).
To register Aspose.PDF for .NET for COM Interop manually:
Pay attention that /codebase is necessary only if Aspose.PDF.dll is not in GAC, using this option makes regasm put path for assembly in registry.
ProgID stands for “programmatic identifier”. It is the name of a COM class that used to create an object. ProgIDs consist of the library name “Aspose.PDF” and the class name.
If your programming language (for example Visual Basic or Delphi) allows you to reference a COM type library, then add a reference to Aspose.PDF.tlb and to see all Aspose.PDF for .NET classes, methods, properties and enumerations in your Object Browser.
To generate a TLB file:
The creation of a COM object is similar to creation of a normal .NET object:
'Instantiate Pdf instance by calling its empty constructor
Dim document
Set document = CreateObject("Aspose.Pdf.Document")
Once created, you are able to access the object’s methods and properties, as if it was a COM object:
'Add page to the document
document.Pages.Add()
Some methods have overloads and they will be exposed by COM Interop with a numeric suffix added to them, except for the very first method that stays unchanged. For example, the Document.Save method overloads become Document.Save, Document.Save_2, and so on.
For more information, see the language-specific articles further in this documentation.
If you need to use many of Aspose.PDF for .NET classes, methods and properties, consider creating a wrapper assembly (using C# or any other .NET programming language). Wrapper assemblies help help to avoid using Aspose.PDF for .NET directly from unmanaged code.
A good approach is to develop a .NET assembly that references Aspose.PDF for .NET and does all the work with it, and only exposes a minimal set of classes and methods to unmanaged code. Your application then should work just with your wrapper library.
Reducing the number of classes and methods that you need to invoke via COM Interop simplifies the project. Using .NET classes via COM Interop often requires advanced skills.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.