PDFCreator 2.2

Post Reply
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

PDFCreator 2.2

Post by Romeo »

Hi to all,

i used your sample program (below) to adjust my program do get pdf file
This is ok til version 1.7xx of PDFCreator

Now with the PDFCreator 2.2 samething has changed and the below program does not works !

Seems it uses other keys of windows

Any help ?

Tks

Romeo/Zingoni
*****
FUNCTION SETTAREG( cDir , cFile , cAutoSave )
LOCAL oReg

oReg:=TReg32():New( HKEY_CURRENT_USER , "SOFTWARE\PDFCreator\Program" )
oReg:Set( "UseAutosave" , cAutoSave )
oReg:Set( "UseAutosaveDirectory" , cAutoSave )
oReg:Set( "AutosaveDirectory" , UPPER( cDir ) )
oReg:Set( "AutosaveFilename" , UPPER( cFile ) )

oReg:Close()

RETURN .T.
******
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: PDFCreator 2.2

Post by karinha »

Maybe,

Code: Select all

IF EMPTY( oPC := WIN_OLECreateObject( "PDFCreator.clsPDFCreator" ) )
      MsgStop("Pdf Creator não esta instalado neste computador.",;
                "Prodedimento abortado")
        
      RETURN .F.
   ENDIF
    
   oPC:__hSink := __AxRegisterHandler( oPC:__hObj, {|X| nEvent := X} )

   oPC:cStart( "/NoProcessingAtStartup" )
   oPC:_cOption( "UseAutosave", 1 )
   oPC:_cOption( "UseAutosaveDirectory", 1 )
   oPC:_cOption( "AutosaveDirectory", "C:\TESTE\" )
   oPC:_cOption( "AutosaveFilename", "MyPdf.pdf" )
   oPC:_cOption( "AutosaveFormat", 0 )

   oPC:cDefaultPrinter := "PDFCreator"
   oPC:cClearCache()
   oPC:cPrinterStop := .F.

    PRINTER oPrnPdf NAME "Gerando pdf" ;
            to "PDFCreator"  //modal

        DEFINE FONT oFnt1 NAME "Arial" SIZE 0,-20 OF oPrnPdf 

        oPrnPdf:SetPortrait()
        nRcol := oPrnPdf:nlogpixelx()/2.54
        nRlin := oPrnPdf:nlogpixely()/2.54

        PAGE 
          oPrnPdf:say(05*nRlin,05*nRcol,;
                     "TESTE COM PDFCREATOR",;
                     oFnt1,,,,0)
        ENDPAGE
        
    ENDPRINTER

   nTime := hb_milliseconds()
   DO WHILE nEvent == 0 .AND. (hb_milliseconds() - nTime) < 10000
      hb_idleSleep( 0.5 )
      /* The following dummy line is required to allow COM server to send event [Mindaugas] */
      oPC:cOption("UseAutosave") 
   ENDDO
    
   hb_idleSleep( 0.7 )
   oPC:cClose()
João Santos - São Paulo - Brasil
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: PDFCreator 2.2

Post by Romeo »

Tks, but i got error:

HB_FUN_WIN_OLECreateObject...unresolved external
..........__AXREGISTRERHANDLER "" ""

may by i have un old version of FWH8.10 (!)

Tks any
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: PDFCreator 2.2

Post by karinha »

João Santos - São Paulo - Brasil
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: PDFCreator 2.2

Post by MarcoBoschi »

Backs to version 1.2.0
Marco Boschi
info@marcoboschi.it
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: PDFCreator 2.2

Post by Romeo »

the example does not works for pdfcreator 2.*
works well only with previous version 1.7 or less

tks any

Post Reply