Problem with ObjectAttributeStr

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
calvin
Posts: 9
Joined: Fri Apr 02 2004

Problem with ObjectAttributeStr

Post by calvin »

I am using VFP and am having a problem setting the values of fields in a PDF file. I know there is a field named "Amount" in the open PDF. When I run
Create PdfViewer Object
Set License
Open PDF file and then attempt to set a value using
pdfviewer.ObjectAttributeStr("Amount","Value","56")
I get an OLE unspecified error.

I would appreciate any help you can give.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please call:

pdfviewer.ObjectAttribute("Amount","Value","56")

I am not sure which application you are using but in genearl you need to assign the value 56 to the Field object so you need to call something similar to:

pdfviewer.ObjectAttribute("Amount","Value") = 56

Hope this helps, if not please send us an e-mail to support@amyuni.com

Thanks.
calvin
Posts: 9
Joined: Fri Apr 02 2004

Post by calvin »

I found out that the problem was that I was not setting the page number now was I setting the form status. I wish there were more code samples around.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Calvin,

Please give more details about how you solved this issue and what was really the problem.

so others who maybe facing the same problem and reading this thread will know what to do.

We are currently preparing more samples for the PDF Creator.

Thanks.
calvin
Posts: 9
Joined: Fri Apr 02 2004

Details on Solution

Post by calvin »

The problem was solved when Jose sent me code samples. That code is:
#DEFINE acCommandToolRunDocument 53776
#DEFINE acReportStateRun 0
#DEFINE acReportStateDesign 1
#DEFINE acReportStateLoading 2


PDFviewer = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
PDFviewer.setlicenseKey ("Suite Evaluation
Version","07EFCDAB010001001DB5BDE6C025C760E6DFC8F69516B8E88246C496DA67FA90D447CE
8B1BEFC7EDF6DC0B7029903DEA9970304D24B61D2AA3A72E0302C0C90EB051EE3FDBAC800A3B74A2
AE0D84D10A52")
PDFviewer.Open("c:\temp\g7m_fi.pdf","")

&& Move to current page - not clear in manual
PDFviewer.currentpage = 1

&&change report state - not clear in manual
PDFviewer.reportstate = acReportStateDesign

&& Change the value of the sample object. This object must exist
&& I am using VFP , others would use the comand ObjectAttribute
PDFviewer.ObjectAttributeStr("Amount", "Text", "56")

&& compile changes - not clear in manual
PDFviewer.DoCommandTool(acCommandToolRunDocument)

&& otherwise document will print off page in all likelihood
PDFviewer.ScaleToPrinter = 3

&& Prompt for printer name
PDFviewer.Print("", 1)
PDFviewer= .NULL.
Post Reply