Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jeff Stone
  
 
 
 Jeff Stone
 Tags
Subject: Programmatically Importing FDF into PDF
Thread ID: 34001 Message ID: 34001 # Views: 3 # Ratings: 0
Version: Visual FoxPro 6 Category: Active X Controls & OLE Automation
Date: Friday, December 05, 2003 11:25:16 PM         
   


We have a bunch of .txt and .fdf files that we need to print alternately. If we use ShellExecute to print the .FDF files and we even add a 5 second Wait after each call, the pages will not come out in the correct order. Even more bizarre is the fact that .FDF file 4 may print out after .FDF files 5 and 6. Anyway, I've decided to try using OLE to create a form within Foxpro, bring up the associated PDF, import the .FDF and print it.

I can create the form and load the PDF with the code below, but I don't know how to import and FDF file into the PDF. For that matter I'm not sure how to automate the printing either. Any and all help would be greatly appreciated.

TIA

Jeff

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN
**********************************************************
DEFINE CLASS form1 AS form

DoCreate = .T.
Caption = "pdfForm"
Name = "Form1"

ADD OBJECT olecontrol1 AS olecontrol WITH ;
OLEClass = "PDF.PdfCtrl.5", ;
Top = 48, ;
Left = 12, ;
Height = 192, ;
Width = 348, ;
Name = "Olecontrol1"

PROCEDURE Init
ThisForm.ReSize()
IF !EMPTY(cFile)
THISFORM.oleControl1.LoadFile([&cFile]) &&cfile is set gloablly prior to the call
****THISFORM.oleControl1.Import([&impfile]) I THOUGHT SOMETHING MIGHT EXIST LIKE THIS TO LOAD THE FDF
****THISFORM.oleControl1.PRINTALL() ?????
ENDIF
ENDPROC

PROCEDURE Resize
ThisForm.Olecontrol1.Height = ThisForm.Height - 60
ThisForm.Olecontrol1.Width = ThisForm.Width - 24
ThisForm.Olecontrol1.Refresh()
ENDPROC

PROCEDURE cmdexit.Click
ThisForm.Release()
ENDPROC

ENDDEFINE


ENTIRE THREAD

Programmatically Importing FDF into PDF Posted by Jeff Stone @ 12/5/2003 11:25:16 PM