Page 1 of 1

Using PdfCreator

Posted: Fri Apr 14, 2006 10:17 am
by chiaiese
Has anybody used the com interface of pdfcreator ?
I would use it to create a pdf and email directly from within Fwh, without the dialogbox of pdfcreator prompting for email address

The documentation found in pdfcreator directory is not very clear to me
I would really appreciate any working sample
something like:

oPdf := createobject("Pdfcreator.Application")
how to print ?
oPdf:cSendMail( OutputFilename , Recipients )

best regards
Roberto Chiaiese

Posted: Sat Apr 15, 2006 10:04 am
by Antonio Linares
Roberto,

> The documentation found in pdfcreator directory

Where have you located such documentation ? Just installing the pdfcreator software ?

PDF creator

Posted: Tue Apr 18, 2006 12:46 pm
by chiaiese
Antonio,
Yes, take a look to: PDFCreator_english.chm, it is located in the PDFCreator 9.0 install directory

regards
Roberto

Posted: Sun Apr 23, 2006 11:03 am
by Verhoven
Por fin he dado con la mejor solución para generar archivos pdf desde mi programa de forma automática.

Bajar pdfcreator que es gratuito de http://sourceforge.net/projects/pdfcreator/
Instalarlo.

Modificar el registro de windows de la aplicación:
HKEY_CURRENT_USER
Software
pdfcreator
program


Los valores de las variables que se deben cambiar para que guarde los ficheros pdf que se van mandando, con el mismo título que le damos al objeto PRINT de nuestro programa (con lo que de esta forma elegimos nosotros el nombre del fichero) son:

Autosavedirectory C:\KK ( o el que más nos guste )
Autosavefilename cambiar el que trae <DateTime> por <Title>
Autosaveformat pdf
.
.
.
useautosave 1


Es muy bueno este programa.

Posted: Thu Mar 22, 2007 12:13 pm
by Ari
Eu gostaria de usar o PDFCreator e autoconfigurar:

usando: TOleAuto():New("PDFCreator.Aplication")

mas gera erro.

Instalei a versao 9 de PdfCreator

alguem tem um exemplo completo ?

Ari

PDF maintanence

Posted: Sun Apr 15, 2007 1:47 am
by Boris
I am using IsedQuickPDf
I load PDF and write the needed text all over the PDF (nom mater how many pages PDF has)
Then I can save the new PDF name, and then I can use this file whatever way I want (also to send as the mail attachement)
Using xharbour/FWH

Posted: Sun Apr 15, 2007 9:03 am
by chiaiese
You can try this little function with PdfCreator version 0.9.3

Code: Select all

function printPdf()

local oPdfApp := CreateObject("PDFCreator.clsPDFCreator")
local cASD := oPdfApp:cOption("AutoSaveDirectory" )
local cASF := oPdfApp:cOption("AutoSaveFileName" )

oPdfApp:cOption("UseAutoSave", 1 )
oPdfApp:cOption("UseAutoSaveDirectory", 1 )
oPdfApp:cOption("AutoSaveStartStandardProgram", 1 )
oPdfApp:cOption("AutoSaveDirectory", "c:\temp" )
oPdfApp:cOption("AutoSaveFileName" , "Mypdf" )
oPdfApp:cSaveOptions()

// print something
oPdfApp:cPrintPDFCreatorTestpage()

oPdfApp:cOption("AutoSaveDirectory", cASD )
oPdfApp:cOption("AutoSaveFileName" , cASF )
oPdfApp:cSaveOptions()

oPdfApp = nil
return (nil)
for other functionality look at the help file
regards

Roberto Chiaiese

Posted: Tue Apr 17, 2007 7:56 am
by Patrick Mast
chiaiese wrote:You can try this little function with PdfCreator version 0.9.3
We can not get the pdfCreator to work in Vista. Is there anyone who runs it in Vista? :roll:

Patrick

Posted: Fri Apr 20, 2007 4:45 pm
by AngelSalom
No consigo que esta función haga nada, simplemente se ejecuta y no realiza nada. Tengo instalado pdfcreator 0.92



function Main()

local oPdfApp := CreateObject ("PDFCreator.clsPDFCreator")
local cASD := oPdfApp:cOption("AutoSaveDirectory" )
local cASF := oPdfApp:cOption("AutoSaveFileName" )

oPdfApp:cOption("UseAutoSave", 1 )
oPdfApp:cOption("UseAutoSaveDirectory", 1 )
oPdfApp:cOption("AutoSaveStartStandardProgram", 1 )
oPdfApp:cOption("AutoSaveDirectory", "c:\temp" )
oPdfApp:cOption("AutoSaveFileName" , "Mypdf" )
oPdfApp:cSaveOptions()

// print something
oPdfApp:cPrintPDFCreatorTestpage()

oPdfApp:cOption("AutoSaveDirectory", cASD )
oPdfApp:cOption("AutoSaveFileName" , cASF )
oPdfApp:cSaveOptions()

oPdfApp = nil
return (nil)
Gracias

Posted: Fri Apr 20, 2007 10:33 pm
by Ari
Eu tentei tambem e não fazia nada, só dava erro. e consegui sucesso com as funcoes abaixo

Code: Select all

* =========================================================================
Function CheckPDF()
* =========================================================================
  local oPDF := TOleAuto():New("PDFCreator.clsPDFCreator") 

  IF Ole2TxtError() != "S_OK" 
     MsgAlert("PDFCreator não está disponivel", "Esta opção requer o  PDFCreator") 
     oPDF:End()
     return .f.
  Endif
  oPDF:End()

return .t.

* =========================================================================
Function ConfigPDF()
* =========================================================================
  local nKey := 2147483649  
  local oReg := TReg32():New( nKey, "SoftWare\PDFCreator\Program" )

  oReg:Set("AutosaveDirectory", DirTmp()  )
  oReg:Set("AutosaveFilename" , "<Title>" )
  oReg:Set("AutosaveFormat"   , "pdf"     )
  oReg:Set("UseAutosave"      , 1         )
  oReg:Set("SendEmailAfterAutoSaving" , 0 )
  oReg:Close()

return nil
Ari

Posted: Sat Apr 21, 2007 6:34 pm
by AngelSalom
Oka, con esto modificas las claves del registro y consigues modificar sus variables. Gracias!! con esto ya me apaño para lo que necesito.

Un saludo.

Como enviar el PDF por E-Mail despuese.

Posted: Fri Aug 17, 2007 2:30 pm
by PAUL SIMM
Este opción abre el Outlook con el PDF como adjunto pero no tiene ni E-Mail de destio ni Asunto:

oReg:Set("SendEmailAfterAutoSaving" , 1 )

Alquien sabe como añadir estos datos para el envio automatico de facturas.

Posted: Fri Aug 17, 2007 3:21 pm
by Kleyber
Hi all,

It seems to be very interesting... and how could I put this to generate PDFs from my preview (RPreview)?

TIA,

Posted: Fri Aug 17, 2007 5:28 pm
by don lowenstein
I use Image2PDF to convert .emf files (created by FWH previewer) into .pdf files - works well. Just a couple of changes in tpreview.prg to "capture" the .emf files while they are still alive.

This works great for printing via FWH on internet apps as the cgi-program can invoke the report object - which in turn creates the .emf files for viewing - which I grab and convert that "Image2PDF" on the fly - then the app simply delivers the pdf file over the web.

Also, support from Image2PDF is excellent. Furthermore, you can purchase a license which enables you to give unlimited, royality free distribution.