Can't position fields using Creator

If you are a Delphi developer and have any questions about using our products from Delphi here is the place to post them.
Post Reply
JasonR
Posts: 8
Joined: Mon Jun 09 2003

Can't position fields using Creator

Post by JasonR » Mon Jun 09 2003

The following code places a field called "myField" at 0,0,0,0 with blank text. I can't seem to place a field where I want and fill it with text..

procedure TForm1.Button1Click(Sender: TObject);
begin
with pdf1 do
begin
Open('C:\test.pdf','');
reportstate:=acreportstatedesign;
createobject(acObjectTypeField,'myField');
objectattribute['myField','Left'] := 200;
objectattribute['myField','Top'] := 200;
objectattribute['myField','Right'] := 600;
objectattribute['myField','Bottom'] := 400;
objectattribute['myField','Text'] := 'Test Text Here';
end;
end;



Also, I have an exisitng field which I want to programmatically change the text.. I open the pdf, set design state and call:

objectattribute['acField280','Text'] := 'Test Text Here';

if I immediately call showmessage(objectattribute['acField280','Text']) it is blank.

JasonR
Posts: 8
Joined: Mon Jun 09 2003

Post by JasonR » Mon Jun 09 2003

After looking at the TLB in delphi:

procedure TPDFCreactiveX.Set_ObjectAttribute(const Object_: WideString;
const Attribute: WideString; pVal: OleVariant);
begin
Exit;
end;

works when changed to

procedure TPDFCreactiveX.Set_ObjectAttribute(const Object_: WideString;
const Attribute: WideString; pVal: OleVariant);
begin
defaultinterface.ObjectAttribute[object_,attribute]:= pVal;
end;


Is this a problem in the type library? Or am I just doing something wrong?

Post Reply