OLE Adobe PDF - FDFThis is a featured page

In order to get this to work, you must have Adobe Professional installed on the machine that will be running this code. Adobe Pro will install the necessary files to get the OLE working.

1) Create or edit a pdf file by adding text controls in the necessary places.
2) Paste the below code into OI.
3) Basic Utilization -

CLB_PDF('CREATE','\\Ns1\test.pdf')
CLB_PDF(
'SET','DealershipName','TEST')
CLB_PDF(
'SET','MailingAddress','123 1st St')
CLB_PDF(
'SET','CityStZip','Ny, NY 21236')
CLB_PDF(
'SET','DealerNumber','')
CLB_PDF(
'SET','DateFromThrough',fdate:'-':tdate)
CLB_PDF(
'SET','DealerContactPerson','MikeVince')
CLB_PDF(
'SET','DealerContact','713-555-1212')
CLB_PDF('SET','PageNumber',PNo)
CLB_PDF(
'SET','OfPageNumber',TPages)

CLB_PDF('SET','PageTotal',OConv(AmtTotal,'MD2,$'))
CLB_PDF(
'SET','TotalNumberOfAgreements',@Reccount)
CLB_PDF(
'CLOSE','','','Register.fdf')

CLB_PDF('OPEN','','',nfilename)


_________________________________________________________________________________

Subroutine FDF_PDF(Type, Param2, Param3, FileName)
************************************************************************************************
*
*
* Name: FDF_PDF
*
* Original Programmer: Clay Borne
*
* Description: The FDF_PDF procedure fills in form fields in an Adobe PDF
*
* Parameters:
* Type [in] -- CREATE, SET, CLOSE, OPEN
*
* Param2 [in] -- If CREATE - FileName with path
* If SET - Control Name
* If CLOSE - BLANK
* If OPEN - BLANK
*
* Param3 [in] -- If CREATE - BLANK
* If SET - Value to Set Control to
* If CLOSE or OPEN - BLANK
*
* Returns:
* Nothing
*
* History (Date, Initials, Notes)
* 07/24/07 CWB Original Programmer
*
************************************************************************************************
COMMON /%%FDF_PDF%%/ FileName@,FDFName@,FdfAcX@,myFdf@
DECLARE FUNCTION OleCreateInstance,OleCallMethod

BEGIN CASE
CASE TYPE = 'CREATE'
FdfAcX = OleCreateInstance("FdfApp.FdfApp" )
FdfAcX@ = FdfAcX
myFdf = OleCallMethod(FdfAcX,'FDFCreate')
myFdf@ = myFdf
FileName@ = Param2

CASE TYPE = 'SET'
ret = OleCallMethod(myFdf@,'fdfsetvalue',Param2,Param3, 0)

CASE TYPE = 'CLOSE'
ret = OleCallMethod(myFdf@,'FDFSetFile',FileName@)
ret = OleCallMethod(myFdf@, 'FDFSaveToFile',{PATH}:FileName )
ret = OleCallMethod(myFdf@,'fdfclose')

CASE TYPE = 'OPEN'
program= {PATH}:Filename
mode=3
rv=Utility("RUNWIN",program,mode)

END CASE


return



No user avatar
bornecw
Latest page update: made by bornecw , Apr 28 2008, 11:15 PM EDT (about this update About This Update bornecw Edited by bornecw


view changes

- complete history)
Keyword tags: adobe OLE pdf
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)