Using PdfCreator

Post Reply
chiaiese
Posts: 56
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Using PdfCreator

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Roberto,

> The documentation found in pdfcreator directory

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

Antonio Linares
www.fivetechsoft.com
chiaiese
Posts: 56
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

PDF creator

Post by chiaiese »

Antonio,
Yes, take a look to: PDFCreator_english.chm, it is located in the PDFCreator 9.0 install directory

regards
Roberto
Verhoven
Posts: 435
Joined: Sun Oct 09, 2005 7:23 pm

Post 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.
User avatar
Ari
Posts: 128
Joined: Fri Feb 03, 2006 4:21 pm
Location: Brazil
Contact:

Post 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
User avatar
Boris
Posts: 16
Joined: Sun Nov 27, 2005 1:57 am

PDF maintanence

Post 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
chiaiese
Posts: 56
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia
Contact:

Post 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
User avatar
Patrick Mast
Posts: 244
Joined: Sat Mar 03, 2007 8:42 pm

Post 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
User avatar
AngelSalom
Posts: 664
Joined: Fri Oct 07, 2005 7:38 am
Location: Vinaros (Castellón ) - España
Contact:

Post 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
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
User avatar
Ari
Posts: 128
Joined: Fri Feb 03, 2006 4:21 pm
Location: Brazil
Contact:

Post 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
User avatar
AngelSalom
Posts: 664
Joined: Fri Oct 07, 2005 7:38 am
Location: Vinaros (Castellón ) - España
Contact:

Post 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.
Angel Salom
http://www.visionwin.com
---------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.0
User avatar
PAUL SIMM
Posts: 63
Joined: Fri Oct 07, 2005 7:59 am
Location: Madrid, Spain
Contact:

Como enviar el PDF por E-Mail despuese.

Post 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.
Regards/Saludos
Paul

paul@pes-systems.net
User avatar
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Post by Kleyber »

Hi all,

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

TIA,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

Post 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.
Don Lowenstein
www.laapc.com
Post Reply