Modificar objeto de windows Impresora PDF

Modificar objeto de windows Impresora PDF

Postby diegopolverelli » Wed Aug 31, 2011 2:54 pm

Hola. Tengo un script en VBScript que hace esto:

Set oBullZipPDF = CreateObject("Bullzip.PDFPrinterSettings")

oBullZipPDF.SetValue "Output", sArchivo
oBullZipPDF.SetValue "ConfirmOverwrite", "no"
oBullZipPDF.SetValue "ShowSaveAS", "never"
oBullZipPDF.SetValue "ShowSettings", "never"
oBullZipPDF.SetValue "ShowPDF", "never"
oBullZipPDF.SetValue "RememberLastFileName", "no"
oBullZipPDF.SetValue "RememberLastFolderName", "no"
oBullZipPDF.WriteSettings False

o sea, crea un objeto de tipo impresora bullzip (que es una impresora PDF shareware muy copada), y le cambia parametros. Esto en VBSCRIPT funciona perfectamente.

Mi duda, ¿se puede hacer lo mismo con FWH?
¿como tengo que hacer? me interesa ahora esto del pdf, pero si alguien tiene la info y un cachito de tiempo, tambien quisiera saber si puedo manejar de alguna forma cualquier objeto de windows. Probé con el formato que se usa para los oExcel, pero no funcionó.

Espero puedan ayudarme. Gracias.
diegopolverelli
 
Posts: 149
Joined: Thu Jun 21, 2007 3:26 pm

Re: Modificar objeto de windows Impresora PDF

Postby Daniel Garcia-Gil » Wed Aug 31, 2011 5:06 pm

Hola

teoricamete deberia funcionar, este es un ejemplo usado publicado en la misma paguina de bullpdf, a mi me genera un error de timeout, pero pasa por todos los setting sin problemas, puede que veas algo que no he visto yo para hacerte el ejemplo

el rtf que use es el mismo que esta en la cartepa samples de fivewin

Code: Select all  Expand view

#include "fivewin.ch"

function main()

   local util     := CreateObject("Bullzip.PdfUtil")
   local settings := CreateObject("Bullzip.PDFPrinterSettings")
   local output   := "example.pdf"
   local statusfile := "status.ini"
   local documentfile := "testrtf.rtf"

   printername := util:DefaultPrinterName()
   

   settings:SetPrinterName( printername )
   settings:SetValue( "Output", output )
   settings:SetValue( "WatermarkText", DToC( Date() ) )
   settings:SetValue( "WatermarkColor", "#FF9900" )
   settings:SetValue( "ShowSettings", "never" )
   settings:SetValue( "ShowPDF", "no" )
   settings:SetValue( "ShowProgress", "no" )
   settings:SetValue( "ShowProgressFinished", "no" )
   settings:SetValue( "ConfirmOverwrite", "no" )
   settings:SetValue( "StatusFile", statusfile )
   settings:SetValue( "StatusFileEncoding", "unicode" )

   //Write settings to the runonce.ini.
   settings:WriteSettings( .T. )

   // Remove old output and status files
   if File( output )
      FErase( output )
   endif
   if File( statusfile )
      FErase( statusfile )
   endif

   //Print the file
   util:PrintFile( documentfile, printername )
 
   // Wait for the status file.
   // The printing has finished when the status file is written.
   if util:WaitForFile(statusfile, 10000)
        ? "Print job finished."
   else
        ? "Print job timed out."
   end if
 
return nil
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests