Cannot create Objects

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
shaun
Posts: 16
Joined: Mon Jul 17 2006
Contact:

Cannot create Objects

Post by shaun »

Hi,

I'm using the latest PDF Creator tool and the development environment is VB 6.0. I have the licensed version of the PDF creator tool. When i try to create objects i get the following error.

"Object doesn't Support this action"

the error number is "445"

This is the code i'm using. The License to and license key are CORRECT.

Dim iCtrPage As Integer
Dim iCtrObj As Integer
iCtrPage = 1 'start at page 1

PDF1.SetLicenseKey "xxxxxxxx", "xxxxxxxxxx"

With PDF1
For iCtrPage = 1 To 7

For iCtrObj = 1 To 7
.CreateObject acObjectTypeText, "Unlicensed " & iCtrObj <<<< When this line of code is excuted i get the error as mentioned above.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I suggest that you look at our Access or C# technical notes http://www.amyuni.com/en/support/technotes.html , they both contains samples using the PDF Creator and the code in Access is VBA which is very close to VB.

I am sure this will give you the needed information.
shaun
Posts: 16
Joined: Mon Jul 17 2006
Contact:

Post by shaun »

Hi Joan,

I downloaded the Technotes from the link you had mentioned. I went through the Access Technotes, since i'm developing the application in VB 6.0. I uninstalled PDF creator and re-installed in the default Folder. check 'install.ini' file created.

Copying file: C:\DOCUME~1\vipinpc\LOCALS~1\Temp\license.txt
------------------------------------------------------------------------------------
Copying of PDF Converter start:
------------------------------------------------------------------------------------
Copying file: acfpdf.drv
------------------------------------------------------------------------------------
Copying file: acfpdf.txt
------------------------------------------------------------------------------------
Copying file: acfpdf.dll
------------------------------------------------------------------------------------
Copying file: acfpdfu.dll
------------------------------------------------------------------------------------
Copying file: acfpdfui.dll
------------------------------------------------------------------------------------
Copying file: acfpdfnt.dll
------------------------------------------------------------------------------------
Copying file: cdintf.dll
------------------------------------------------------------------------------------
Copying file: Install.exe
------------------------------------------------------------------------------------
Copying file: Amyuni PDF Converter.pdf
------------------------------------------------------------------------------------
Copying file: Common Driver Interface 250.pdf
------------------------------------------------------------------------------------
Copying of PDF Converter finish
------------------------------------------------------------------------------------
Copying file: Versions.txt
------------------------------------------------------------------------------------
Copying file: license.pdf
------------------------------------------------------------------------------------
Copying of PDF Creator files start:
------------------------------------------------------------------------------------
Copying file: PDFCreactiveDoc.exe
------------------------------------------------------------------------------------
Copying file: pdfcreactivex.dll
------------------------------------------------------------------------------------
Copying file: acpdfcrext.dll
------------------------------------------------------------------------------------
Copying file: acpdfcrdb.dll
------------------------------------------------------------------------------------
Copying of PDF Creator files finish
------------------------------------------------------------------------------------
Windows 2000/XP/2003 Install
------------------------------------------------------------------------------------
Checking for existing PDF printer
------------------------------------------------------------------------------------
Installing Amyuni PDF printer driver
------------------------------------------------------------------------------------
Installing Amyuni PDF printer
------------------------------------------------------------------------------------
Printer setup succeeded

All the files are installed properly. After this was done. i created a sample application like the one which is given in the technical notes. I have the licensed version of PDF creator and the license key i used in the sample application is correct(I verified it again). I checked the Components registered in VB. ie Projects>Components. I could see all the components and the Dlls.

Then in the code i declared 'Dim CreatorRef As New ACPDFCREACTIVEX.PDFCreactiveX'

But when i use the following code

with CreatorRef
.CreateObject acObjectTypeText, "text1"'

i still get the same error. "Object doesn't Support this action". ie error number '445'. To my surprise when i try to add the first parameter(ObjectType as ObjectTypeConstant) in the .createobject method using 'Control+SpaceBar' keys (in VB) , i couldn't find 'acObjectTypeText'. I see only the following ObjectTypeConstants

acEmbedfontOptions, acExcelExportOptions, acHTMLExportOptions, acPageNumbersPositions.

The have given references(using Project>References and Project>Components) to the following dlls and OCXs:

pdfCreativeX.dll
acpdfcrext.dll

In the Technotes you have mentioned about acpdfcrex.dll. is it same as acpdfcrext.dll?.I couldn't locate acpdfcrex.dll in my system.

What could be the possible reason for this error. Is the error happening because i have not registered the dlls properly?. Please let me know.
shaun
Posts: 16
Joined: Mon Jul 17 2006
Contact:

Post by shaun »

Hi Joan,

I have tried with evaluation version of both “Amyuni PDF Suite Demo” and “Amyuni PDF Creator Developer Demo”. I am getting runtime error, when I try to set Text object attribute.

Runtime error (-2147467259 Method ‘ObjectAttribute’ of object ‘IPDFCreativeX’ failed).

OS : Windows XP /2000
Tool: VB 6.0


Here is given code

Evaluation License code set is same as given in Install.ini file.

PDFCreactiveX1.SetLicenseKey LicenseTo, ActivationCode


With PDFCreactiveX1
.Open App.Path & "\Multi page.pdf", "" ' open a sample PDF document
.ReportState = acReportStateDesign ' switch the control to design mode

.CreateObject acObjectTypeText, " Text 1"

********* "Runtime error while I execute following code ********
.ObjectAttribute("Text 1", "Text") = "Hello_here"

.ObjectAttribute("Text 1", "Left") = 200 ‘Error occurred

.ObjectAttribute("Text 1", "Top") = 200
.ObjectAttribute("Text 1", "Right") = 600
.ObjectAttribute("Text 1", "Bottom") = 400
'set background color to yellow
.ObjectAttribute("Text 1", "BackColor") = "7FFFFF"

.Save App.Path & "\Multi page_3.pdf", 1

End With


Even I am not getting ObjectTypeConstants through VB intelligense feature (press Ctrl + Spacebar).
shaun
Posts: 16
Joined: Mon Jul 17 2006
Contact:

Post by shaun »

I have found out the cause of the error. Its not a tool related one but its a coding error.

see the following code i use to create the text object

.CreateObject acObjectTypeText, " Text 1" <<<< there is a space before "Text 1" and see the following code which i use to assign attribute to the same text object.
.ObjectAttribute("Text 1", "Text") = "Hello_here" <<<< here, with the text object name the space is missing.

I corrected this and its working properly.

Thanks and Regards
Shaun
Post Reply