Using PDF Creator as ActiveX control in a Web Page

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
gmeadows
Posts: 4
Joined: Tue Mar 13 2007

Using PDF Creator as ActiveX control in a Web Page

Post by gmeadows »

Hi folks,

I am evaluating PDF Creator for ActiveX using Visual Studio 2005 with C#.

I am unable to place the control in the ToolBox and I think I will therefore need to add it to a web page using an <object> tag. I have looked for the classid of the object in my Registry, and although I do see objects for AmyUni such as acBookMark, acCategory, etc., I do not see an object speciifically for the pdfcreactivex.dll.

Also, this code creates an exception on the call to SetLicenseKey. If I comment out SetLicenseKey and everything after the call to Open, then the code opens a blank web page. Below is my CodeBehind file:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ACPDFCREACTIVEX.PDFCreactiveXClass pdfActiveX = new ACPDFCREACTIVEX.PDFCreactiveXClass();

pdfActiveX.SetLicenseKey("Evaluation Version", "07EFCDA......2FC75C42}");

pdfActiveX.TemplateMode = 1;

// open a PDF file as the background, or template, document.
pdfActiveX.Open("c:\\fdmgmt\\sample.pdf", "");

// create a text object and set its attributes. This object will be part of the active or foreground document.

pdfActiveX.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeText, "Text1");
pdfActiveX.set_ObjectAttribute("Text1", "Left", 200);
pdfActiveX.set_ObjectAttribute("Text1", "Top", 200);
pdfActiveX.set_ObjectAttribute("Text1", "Right", 600);
pdfActiveX.set_ObjectAttribute("Text1", "Bottom", 400);
pdfActiveX.set_ObjectAttribute("Text1", "Text", "Hello There");

// refresh the control to make the text object appear
pdfActiveX.Refresh();
}
}
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

By adding the PDF Creator reference to your project and adding the PDF Creator Control to your components toolbox you will see the PDF Creator component in your toolbox and you can add it to your form.

Also you can use the PDF Creator. Net from C# .Net instaed of the ActiveX Control if you wish.

SetLicenseKey is not supposed to cause any exception, which version of the PDF Creator are you using?
gmeadows
Posts: 4
Joined: Tue Mar 13 2007

Using PDF Creator as ActiveX control in a Web Page

Post by gmeadows »

Hi Joan,

Both Jose and David are looking at Using PDF Creator as ActiveX control in a Web Page. I spoke with them last week by phone and they have concurred that for some reason placing a PDF Creator control into the ToolBox does not work if the project is a Web App in lieu of a Windows App.

The correct control in the Registry is PDFCreactiveX.PDFCreactiveX and if you use the GUID, you can place the control in the page using the <object> tag.

I am looking forward to hearing back from either Dave of Jose on this issue.

Kind Regards,
Glenn
Post Reply