form fields example

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
nirnir
User
Posts: 30
Joined: Wed Aug 25, 2010 10:22 am

form fields example

Post by nirnir »

Hi
Do you have a code example in Delphi of
iterating form fields and filling/extracting data from them .

Thanks
Nir
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17941
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: form fields example

Post by Tracker Supp-Stefan »

Hello Nir,

You will need to implement this kind of iteration via JS, so please have a look at the
JS API for Acrobat Reference and I believe there would be samples inside, and pretty much all of the functions listed there are implemented and supported in our Viewer.

Best,
Stefan
nirnir
User
Posts: 30
Joined: Wed Aug 25, 2010 10:22 am

Re: form fields example

Post by nirnir »

Hi.

I can't access it directly via the activeX ?

Nir
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17941
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: form fields example

Post by Tracker Supp-Stefan »

Hello Nir,

You can call the

Code: Select all

HRESULT RunJavaScript(
    BSTR Script,
    BSTR* Result,
    LONG ID,
    LONG Flags
);
method, and pass the needed JS code inside.

Best,
Stefan
nirnir
User
Posts: 30
Joined: Wed Aug 25, 2010 10:22 am

Re: form fields example

Post by nirnir »

Thanks,


I want to create the activex by my self (not to put it in a form )in order to perform some fields modification
I couldn't create the activex
I tried
CoPDFXCview2:= CreateComObject(StringToGUID('{FE36F0F3-F082-41B7-9EED-772505A7C054}'));
and
CoPDFXCview2:= TCoPDFXCview.Create(application);


this is what I'm trying to do

CoPDFXCview2:= CreateComObject(StringToGUID('{FE36F0F3-F082-41B7-9EED-772505A7C054}'));
CoPDFXCview2.OpenDocument('c:\form.pdf','',iActiveDocID,0);
st:='var f = getField("Text2");f.value = "Hello world";';
CoPDFXCview2.RunJavaScript(st,bsResult, 0, 0);
CoPDFXCview2.SaveDocument(0,'c:\form.pdf',0,0);
CoPDFXCview2.CloseDocument(0,0);
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: form fields example

Post by Corwin - Tracker Sup »

Hello nirnir,

Viewer ActiveX should have parent window, so you need to set some form as parent:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  id:integer;
begin
  CoPDFXCview2:= TCoPDFXCview.Create(self);
  CoPDFXCview2.Parent:=self;
  CoPDFXCview2.Visible:=false;
  CoPDFXCview2.OpenDocument('c:\form.pdf', '', id, 0);
  ...
end;
HTH.
Post Reply