I downloaded the msi for aspose.pdf and ran install. I have VS 2017 Community. I would like to learn and review Aspose.PDF. How do I do that? Step by Step. Please include menu selections on VS. This is for a dummy. Thank you for any help help.
In case you have installed Aspose.PDF for .NET via MSI installer, you may find DLLs over path like ‘C:\Program Files (x86)\Aspose’ and include reference in your Visual Studio project. Furthermore, please note that you can also install Aspose.PDF for .NET via NuGet Package Manager. By following the instructions given over shared documentation article, you can easily install and use API in your environment.
In case you are asking about registering assembly in Global Assembly Cache (GAC), we would like to share with you that MSI Installer does not do that. You can register assembly manually in case you want to by following the instructions over How to install the assembly into GAC article. In case of any further assistance, please feel free to let us know.
You may please download example project of Aspose.PDF for .NET from GitHub which includes every example showcased in API documentation. For further information, please visit ‘How to Run Examples’ article(s) in API documentation. In case you need further assistance, please feel free to let us know.
I used the MSI and will be using classic ASP. So I installed Aspose.PDF with the .msi. Then I registered the following for COM Interop via a Command Prompt.
regasm “C:\Program Files (x86)\Aspose\Aspose.PDF for .NET\bin\net2.0\Aspose.PDF.dll” /codebase
regasm “C:\Program Files (x86)\Aspose\Aspose.PDF for .NET\bin\net2.0\Aspose.PDF.dll” /tlb: “C:\Program Files (x86)\Aspose\Aspose.PDF for .NET\bin\net2.0\Aspose.PDF.tlb” /codebase
I inserted the following line in my classic ASP page (ran locally via IIS):
Dim pdf
Set pdf = CreateObject(“Aspose.PDF.Generator.Pdf”)
When I launch the page, I get the following error:
In case you are using Aspose.PDF in Classic ASP and need to use many of the Aspose.Pdf Classes, you may create a COM Wrapper. For further information in this regard, you may please visit following article:
Do you have an example of a Aspose.PDF ComWrapper Assembly? My needs are simple. Read a one page PDF, place a picture and text inside the PDF. Dave the PDF. All in classic asp.
Thanks,
I really do not understand the ‘Use Aspose.PDF via COM Interop’ … I learn faster by example.
I am able to regasm Aspose.PDF but can not make a TLB. I am using Classic ASP. Can you recommend my next steps. How to I make a COM Wrapper for Aspose.PDF?
Please note that not all classes of the API can be exported to TLB as they are generic. After running the command, you will also be able to see the list of classes which are not exported.TLB_Errors.png (14.2 KB)
In order to create a COM Wrapper, you may please:
Create a Class Library Project in Visual Studio
Add reference to latest version of Aspose.PDF for .NET
Create methods in your Class which you want to use in ASP Application
Asad this is excellent. (Is this your first name?) I am setting up my work environment now. A few questions.
Am I using the correct regasm? I am developing on my local windows 10, NET 2.0. It looks like Aspose is located in Program Files (x86) on my machine. I was thinking of using this command:
You can use any location for registering the assembly where DLL is placed. Looking at your sample location, it seemed that you have added the assembly in GAC (Global Assembly Cache). In case you want to use it from cache location, you can register it from there as well. In case you face any issue, please feel free to let us know.
The Aspose.PDF for .NET supports both 32-bit and 64-bit architectures. However the MSI Installer places the assembly in Program Files (x86) folder and assemblies present there can be used for both architectures. Furthermore, we will be changing the installer logic soon and it will be installing the DLLs in Program Files in near future.
You can create PDF file using XML template and XML template should be based on XML Schema support by the API. You may please find examples given in API documentation over following link:
With your help I am making some progress. My Asp Code recognizes the Object.
Set doc = Server.CreateObject("Aspose.Pdf.Document")
So I built the ComWrapper IN VS, signed it, and copied to the folder. but got an error about the type unavailable when I tried to register the Com Wrapper. Here is what I did?
dim doc
Set doc = Server.CreateObject("Aspose.Pdf.Document")
dim lic
Set lic = CreateObject("Aspose.PDF.License")
Dim pdfHelper
Set pdfHelper = CreateObject("AsposePdfComWrapper")
Would you please make sure that you have signed the assemblies of your COM Wrapper project using public/private key. Also, please make sure to add complete assembly information by going to Project->Properties->Application Tab->Assembly Information (Button).
Furthermore, please remove the unused namespaces from COM Wrapper Class and build your project again. Please note that, after rebuilding the project, you need to register COM Wrapper assemblies again using regasm command. In case of any issue, please feel free to let us know.
I hope all is well. I have registered Aspose.PDF and have the following in the C:\Program Files (x86)\Aspose\Aspose.PDF for .NET\bin\net2.0\ folder:
Aspose.PDF.dll
Aspose.PDF.pdb
ComComponent.tlb
Just a reminder that I am using WIndows 10, developing in Classic ASP, and on my local machine. I ran the following code and everything seems to work fine.
dim doc
Set doc = Server.CreateObject("Aspose.Pdf.Document")
dim lic
Set lic = CreateObject("Aspose.PDF.License")
response.write ( doc.Pages.Count )
I am curios though, what else can do in classic ASP. I mean, can I read a pdf file and insert a paragraph of text into the PDF. Overall, my needs are simple: (1) read a single page PDF document, (2) insert a paragragh,(3) insert a photo, (4) and save the document.
I noticed there is no Aspose.PDF.tlb. Does ComComponent functionally replace Aspose.PDF.tlb? Please explain.
I also had some errors in the regasm… is this expected? I will attach the output errors.
All Aspose.PDF exportable classes are exported into ComComponent except those which are generic. Which was why, you noticed some errors after running the command.
You may try adding/writing methods in your COM Wrapper project and use them in your Class ASP project. For example, if you need to create a PDF and save it to a location, you can create a method like following:
namespace SampleWrapperAspose
{
public class Test
{
public Test()
{
}
public void SavePDF(string outputPath)
{
Document doc = new Document();
doc.Pages.Add();
doc.Save(outputPath);
}
}
}
And use it in Classic ASP as:
<%
Dim pdfHelper Set pdfHelper = CreateObject("SampleWrapperAspose.Test")
pdfHelper.SavePDF "C:\temp\test.pdf"
%>
For information regarding other functionalities, please visit following useful articles in API Documentation:
I have this working with classic ASP and a COM Wrapper. Can you help me with some basic programming using classic ASP and a COM Wrapper. I am not quite sure how to proceed. Here is what I want to do.
1. Open a PDF document via a path ( **this is a one page PDF** )
2. Overlay some text (centered at row x, between column y1 and y2) on the opened PDF .
I want to pass the coordinates and the text from classic ASP to the COM Wrapper.
3. Overlay a picture in (centered at top x, between column y1 and y2)
4. Save the PDF to a output file
=============================================
Here is my attempt at the Classic ASP Code
<%
Dim pdfHelper
Set pdfHelper = CreateObject("SampleWrapperAspose.Test")
pdfHelper.readDocument( "c:\path\to\the_input_file.pdf" )
pdfHelper.placeCenteredText( 10, 100, 300, "Lorem Ipsom Text" )
pdfHelper.placeCenteredPicture( 14, 100, 400, "c:\path\to\the_input_photo.jpg" )
pdfHelper.SaveDocument( "c:\path\to\the_output_file.pdf" )
SET pdfHelper = Nothing
%>
=============================================
Here is my COM WRAPPER template.
How do I open a pdf and keep it open while changing it within classic asp?
Not sure how to pass numbers for the coordinates?
using Aspose.Pdf;
namespace SampleWrapperAspose
{
public class Test
{
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.