Silverfrost Forums

Welcome to our forums

FTN95 and Ideal Software's Visual Print Engine (VPE) Library

27 Jul 2011 8:48 #8637

Has anyone experience of using VPE with FTN95?

I can envisage doing it by writing a custom interface of C/C++ routines to match each of the VPE library routines but there must be a simpler way!

The general form taken by VPE routines is:

// Type of VPE Handles typedef void * VpeHandle;

// Open new document VpeHandle hdoc = VpeOpenDoc( NULL, 'Test', 0 );

// Write text line to document VpeWriteLine( hdoc, ix, iy, 'Some message at specified page coords' );

So the question is: can the VpeHandle hdoc pointer be captured by an initial C_EXTERNAL call from within a FTN95 subroutine in the form

C_EXTERNAL VPEOPEN 'VpeOpenDoc' (REF, OUTSTRING, VAL)

and then text line written with

C_EXTERNAL VPEWRITE 'VpeWriteLine' (REF, VAL, VAL, OUTSTRING)

and, if so, would the REF be a Fortran long integer variable?

29 Jul 2011 1:46 #8644

After a day's trial and error, the following worked:

PROGRAM		VPETEST

STDCALL VPEOPENDOC  'VpeOpenDoc'  (VAL,INSTRING,VAL) : INTEGER*4
STDCALL VPEWRITEBOX 'VpeWriteBox' (VAL,VAL,VAL,VAL,VAL,INSTRING)
STDCALL VPELINE     'VpeLine'     (VAL,VAL,VAL,VAL,VAL)
STDCALL VPEWRITEDOC 'VpeWriteDoc' (VAL,INSTRING)

! INTEGER4 HDOC REAL8 X1,X2,X3,X4,Y1,Y2,Y3,Y4 DATA X1/1.0D0/,Y1/1.0D0/,X2/5.0D0/,Y2/1.5D0/ DATA X3/1.5D0/,Y3/3.0D0/,X4/5.0D0/,Y4/6.5D0/ ! HDOC = VPEOPENDOC(0,'TEST',0) CALL VPEWRITEBOX(HDOC,X1,Y1,X2,Y2,'Hello Aldavhu221!') CALL VPELINE(HDOC,X3,Y3,X4,Y4) CALL VPEWRITEDOC(HDOC,'Hello_221.pdf') ! STOP END

I would be pleased to discuss successes and issues with anyone else combining FTN95 and the Ideal Software Virtual Print Engine which is truly an awesome DLL commercial library, enabling reports to be produced in RTF and PDF formats in the most intrincate detail.

Please login to reply.