Page 1 of 1

PDFCreator 2.2

Posted: Wed Nov 11, 2015 3:44 pm
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.
******

Re: PDFCreator 2.2

Posted: Wed Nov 11, 2015 6:04 pm
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()

Re: PDFCreator 2.2

Posted: Wed Nov 11, 2015 6:27 pm
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

Re: PDFCreator 2.2

Posted: Wed Nov 11, 2015 7:21 pm
by karinha

Re: PDFCreator 2.2

Posted: Thu Nov 12, 2015 10:53 am
by MarcoBoschi
Backs to version 1.2.0

Re: PDFCreator 2.2

Posted: Fri Nov 13, 2015 3:21 pm
by Romeo
the example does not works for pdfcreator 2.*
works well only with previous version 1.7 or less

tks any