Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jan 28, 2016 9:41 pm

I just purchased Spire.PDFConverter and have it working in my dev environment. My project is a very simple .Net web site.
I haven't received my license file yet so the pdf I'm producing still shows the watermark.

When I moved my code to a production server, however, I'm getting a compilation error on the first line that references the PDFConverter library. That line (vb.net) just Dims a variable:

Dim Doc as new PdfDocument

The compiler error I'm seeing is:

Type 'PdfDocument' is not defined

Any idea what I'm doing wrong? Is this related to my not yet having embedded my license file?

akrumsee
 
Posts: 3
Joined: Thu Jan 28, 2016 4:06 pm

Fri Jan 29, 2016 2:06 am

Hi,

Thanks for your posting.
PDFConverter just is a simple tool and does not provide API for program to produce PDF files.
Could you please tell us the file format which you want to convert to pdf files? So that we can help you to select our other products to implement your needs.Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Sat Jan 30, 2016 4:40 pm

All I'm doing is taking a single page-size jpeg and inserting it into a new PDF and saving it. The code to do this is working perfectly in my development environment.

But I have 2 questions related to applying the license. This is a very simple one page web site, not a solution or a project, just a web site. So there's no mechanism to "include" a license file.

The relevant code reads like this:

Dim doc As New PdfDocument
Dim section As PdfSection = doc.Sections.Add
Dim page As PdfPageBase = doc.Pages.Add()
'Load a tif image from system
Dim image As PdfImage = PdfImage.FromFile(SitePath & "completedcards\" & filestring & ".jpg")
'Set image display location and size in PDF
Dim widthFitRate As Single = image.PhysicalDimension.Width / page.Canvas.ClientSize.Width
Dim heightFitRate As Single = image.PhysicalDimension.Height / page.Canvas.ClientSize.Height
Dim fitRate As Single = Math.Max(widthFitRate, heightFitRate)
Dim fitWidth As Single = image.PhysicalDimension.Width / fitRate
Dim fitHeight As Single = image.PhysicalDimension.Height / fitRate
page.Canvas.DrawImage(image, 30, 30, fitWidth, fitHeight)
doc.SaveToFile(SitePath & "completedcards\" & filestring & ".pdf")
doc.Close()

I've tried placing this line:

Spire.License.LicenseProvider.SetLicenseKey("xxxxxxxxxxxxx")

at the start of the the aspx.vb page that contains the above code. It still runs ok but the watermark doesn't disappear in my output pdf.

The other problem occurs on my production server. I've copied everything up to the server including the bin folder. Even though my code runs in VS2015, when I place it on the server it throws a compilation error at that "dim doc as pdfdocument" statement.

So I have 3 questions:
1) Do I need to convert site into a new project that compiles?
2) What does the license file actually look like? I received a license key but no sample file that I can include in my project after inserting my key.
3) Is there anything else I need to do to get this to compile and run on my production server.

akrumsee
 
Posts: 3
Joined: Thu Jan 28, 2016 4:06 pm

Mon Feb 01, 2016 2:27 am

Hi akrumsee,

Thanks for your further information.
You are using our Spire.PDF component, but your purchased license is for Spire.PDFConverter. Please contact our sales team([email protected]) to change your license to a license for Spire.PDF component.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF