Hi,
this sample code demonstrates the way I get the 'jso' object.
Main Topics
Browse All TopicsI have to enlarge a button in a pdf file but I'm not able to set the 'rect' property of it. Its possible to read the coordinates but not to write them even though the property has read/write access.
The strange thing is that it works in VB6.
The code below raises an EOleSysError with message 'wrong parameter'.
I need to do this programmatically because there is a big amount of pdf files stored in a database and all of them have to be updatet.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
first of all thanks for your help.
It is not possible to set mField.rect[X] directly, it ends up in the same error.
I wrote a VB6 sample with the same code and it works. But even in VB6 it is not possible to set mField.rect[X] directly.
The problem seems to be the data type I use for the variable rect. I tried to find out which type I have to use with the functionality below.
mField.rect is from type varVariant and mField.rect[0] is from type varDouble. But even if I create an array like this:
rect2 := VarArrayCreate([0,3], varVariant); //VarArrayCreate([0,3], varDouble); doesn't work too
rect2[0] := rect[0];//or rect2[0] := 1.2;
........
it doesn't work.
I can't use VB6 because I need much more functionality which is all written in delphi.
well what if you put the functionality of vb6 in a dll and use it from delphi?
ok, not the nicier way but could work.
Another possibility would to request the right var declaration:
var
mField: OleVariant;
rect: varVariant;
dTmp: varDouble;
begin
...
mField := jso.getField('thebutton');
rect := mField.rect;
dTmp := rect[0];//this works
rect[0] := ...//some value of type double
rect[1] := ...//some value of type double
rect[2] := ...//some value of type double
rect[3] := ...//some value of type double
You could also try to delete this field and add a new one:
http://www.experts-exchang
dTmp: varDouble; doesn't work. Its not possible to declare a variable as type varDouble, you can declare it as type Variant and than make it varDouble (like below).
I had built an array of varDouble and set mField.rect to it but the result was the same.
Add a new field to the pdf ends up in the same problem because of the rect parameter.
I hoped to avoid it but it looks like I have to put the functionality into a VB6 dll as you said.
Thanks for your help.
Business Accounts
Answer for Membership
by: _iskywalker_Posted on 2008-05-20 at 02:21:29ID: 21604504
Hi!
I dont even know how do yoiu got the function getfield.
How did you did it?
MAybe i can help you, but i should at least reproduce it...