Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DDE with Arcobat Reader
Message
De
13/10/2009 11:01:49
 
 
À
13/10/2009 10:52:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Divers
Thread ID:
01429114
Message ID:
01429154
Vues:
62
Not sure what I need to download. I dont need to create a PDF file, all I want is to silently print it out to a printer of user's choice.
Which product should I use?

>Could you be a bit more specific and tell where exactly I can find it?
>
>The samples in MegaFox depend upon Amyuni and they are in Chapter 8. If you are interested in free PDF printer drivers, you can download this one:
>
>http://www.bullzip.com/products/pdf/info.php#download.
>
>And here is some code that will generate the PDFs:
>
>
>LPARAMETERS tcFRXname, tcFor
>LOCAL lcDefaultPrinter, lcPrinter, lcDestFileName, loObj, lnLen, lnRetVal
>
>*** Make sure the passed parameter has an extension of frx
>tcFRXname = FORCEEXT( tcFRXname, 'FRX' )

>
>***********************************************************************
>*** Changed By.: Marcia G. Akins on 07 October 2009
>*** Reason.....: Get the windows default printer so we can and set it as 
>*** .....................: the VFP default printer after the PDF is created
>***********************************************************************
>lcDefaultPrinter = SPACE( 254 )
>lnLen = 254
>
>DECLARE INTEGER GetDefaultPrinter IN winspool.drv STRING @lcDefaultPrinter, INTEGER @lnLen
>        
>lnRetVal = GetDefaultPrinter( @lcDefaultPrinter, @lnLen )
>*** a return value of zero means that an error occurred
>IF lnRetVal > 0
>  lcDefaultPrinter = LEFT( lcDefaultPrinter, lnLen )
>ENDIF
>
>lcPrinter = "Bullzip PDF Printer" 
>
>*** Lookup the destination location in the PDFcontrol table
>IF NOT USED( 'PDFcontrol' )
>  USE PDFcontrol IN 0
>ENDIF && NOT USED( 'PDFcontrol' )
>IF SEEK( UPPER( ALLTRIM( tcFRXname ) ), 'PDFcontrol', 'FRXname' )
>  *** construct the pdf name to be the same as the report with the date and time added
>  lcDestFileName = ADDBS(ALLTRIM( PDFcontrol.PDFloc ) ) + JUSTSTEM( tcFRXname ) + TTOC( DATETIME(), 1 ) + '.pdf'
>ELSE
>  RETURN  
>ENDIF && SEEK( UPPER( ALLTRIM( tcFRXname ) ), 'PDFcontrol', 'FRXname' )
>
>IF FILE(lcDestFileName) 
>  DELETE FILE ( lcDestFileName )
>ENDIF 
>*** Create the COM object to control the printer. 
>loObj = CreateObject("BullZIP.PDFPrinterSettings") 
>loObj.SetValue("Output",lcDestFileName) 
>loObj.SetValue("ShowSettings" ,"never") 
>loObj.SetValue("ShowPDF" ,"no") 
>loObj.WriteSettings(.T.) 
>
>SET PRINTER TO NAME ( lcprinter )
>*** Check for a 'For' condition
>IF NOT EMPTY( tcFor )
>  REPORT FORM ( tcFRXname ) FOR &tcFor TO PRINTER NOCONSOLE  
>ELSE && NOT EMPTY( tcFor )
>  REPORT FORM ( tcFRXname ) TO PRINTER NOCONSOLE  
>ENDIF && NOT EMPTY( tcFor )
>SET PRINTER TO NAME ( lcDefaultPrinter ) 
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform