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.
Can't position fields using Creator
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?
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?