FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PDF From Preview
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 12:28 PM

Does exists any version de PREVIEW than can save in PDF format?

Regards

George

Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
PDF From Preview
Posted: Mon Aug 21, 2006 12:56 PM

George,

i think you'll need a pdf printer installed for this.

Regards,
Detlef

Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 01:58 PM

Detlef

I know that I can do that using PDFCreator.

I would like to save PDF from FiveWin PREVIEW. Do you know any class that I can use to create PDF report?

George

Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
PDF From Preview
Posted: Mon Aug 21, 2006 02:16 PM

Geaorge,

sorry i don't know a class like that which can be activated from inside of a preview.

Regards,
Detlef

Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
PDF From Preview
Posted: Mon Aug 21, 2006 03:39 PM
George wrote:
I would like to save PDF from FiveWin PREVIEW. Do you know any class that I can use to create PDF report?



George,

I have changed rpreview.prg class, for let us to select a printer from window's preview.- If you have installed a pdf printer, you can select that printer and "voilé".
Un saludo



Manuel
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 04:24 PM

>Manuel write:
>I have changed rpreview.prg class, for let us to select a printer from >window's preview.- If you have installed a pdf printer, you can select >that printer and "voilé".

Manuel

That is a good start. Can I get the modification that you did to rpreview.prg?

George

Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
PDF From Preview
Posted: Mon Aug 21, 2006 05:54 PM
George wrote:
Can I get the modification that you did to rpreview.prg?


George,

You can download from:

http://hyperupload.com/download/02caf68 ... w.prg.html

All lines with "mcn" has been changed for me.

Regards
Un saludo



Manuel
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 08:05 PM

Manuel,

Thanks for your RPREVIEW.PRG modified.

When I try to compiler I get the following errors:

Syntax error: "parse error at "IMAGELIST"
Syntax error: "parse error at "TOOLBAR"
Syntax error: "parse error at "TBBUTTON"
Syntax error: "parse error at "TBSEPARATOR"

Also I get FixSay() and IsWin64() undefined function

Maybe the errors are because I am using FWH 2.5

Regards

George

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
PDF From Preview
Posted: Mon Aug 21, 2006 08:54 PM

George,

> Maybe the errors are because I am using FWH 2.5

Yes, those classes and functions are in FWH 2.7. You may upgrade from www.fivetechsoft.com

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
PDF From Preview
Posted: Mon Aug 21, 2006 08:56 PM
George wrote:Maybe the errors are because I am using FWH 2.5


George,

May be.- Perhaps you have in FWH\SOURCE\CLASSES an old rpreview.prg version 2.5.- You can compare it with my version, and modifing/adding in your version only "mcn-lines".
Un saludo



Manuel
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
PDF From Preview
Posted: Mon Aug 21, 2006 09:27 PM
Manuel Valdenebro wrote:http://hyperupload.com/download/02caf68c16/rpreview.prg.html


If I'm not missing something obvious you have a resource leak here:

func f_CamImpre (oDevice, cCbx )
local cPrinter

    cPrinter := GetProfString( "windows", "device" , "" )
    WriteProfString( "windows", "device", cCbx )
    SysRefresh()
    PrinterInit()
    oDevice:hDC := GetPrintDefault( GetActiveWindow() )
    SysRefresh()
    WriteProfString( "windows", "device", cPrinter  )

RETURN nil


You should release oDevice:hDC before replacing it:

DeleteDC( oDevice:hDC )
oDevice:hDC := GetPrintDefault( GetActiveWindow() )


EMG
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 09:42 PM

Manuel

Thanks. Work perfect!

I'll have to upgrade to FWH2.7 and xHarbour Professional ASAP

George

Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 10:25 PM

Manuel

The only PROBLEM that we have is when select a different printer in preview screen, the output does not fit in the new printer. Please try selecting differents printer (e.g. Winfax)

George

Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
PDF From Preview
Posted: Mon Aug 21, 2006 11:43 PM

Manuel

Here your function with a minor modification

//------------------------------------------------------------------------
// función para cambiar la impresora desde previo (mcn)
//------------------------------------------------------------------------
func f_CamImpre (oDevice, cCbx )
local cPrinter

cPrinter := GetProfString( "windows", "device" , "" )
WriteProfString( "windows", "device", cCbx )
SysRefresh()
PrinterInit()
DeleteDC( oDevice:hDC )   // Sugestion by Enrico M. Giordano
oDevice:hDC := GetPrintDefault( GetActiveWindow() )
oWnd:End()  // To close current preview
// Insert here the function to create the report
SysRefresh()
WriteProfString( "windows", "device", cPrinter  )

RETURN nil

Regards

George

Posts: 12
Joined: Sat Aug 26, 2006 12:27 AM
Re: PDF From Preview
Posted: Sun Aug 27, 2006 01:41 AM
I resolved this problem a year ago.
For to give at my customers professional printed documents, i cannot use arrangiament. The invoice, the look and feel and easy to use, have not price.
I have studyed for some time crystal report, after have tested many report generator free and not free.
I tested crw 8 and 8.5 for to create report directly wrapping dll.
But the result was not stable.
After tested crw 9 and 10 and 11 i make a simple program in visual basic, for resolve runtime problem of crw.
After i have coded a fivewin program for printer control and control of visual basic program, for mail the invoice and other documents in many file formats. The user see only the fivewin dialog, the Vb program are not visible.
Now i have a professional program in fivewin, who control:
1) the select type of file of document as xls, doc, rtf, pdf, or printer.
2) select the printer prior of print a document, and his status.
3) a professional preview.
4) Mail the document at customers across outlook express, or smtp server of fivewin (i modify the class).
After a long time for debug, i have begun to sell it with my programs and the customers are content.

Laborious is to make by themselves, but at end is big satisfactions.

Eduardo Freni









George wrote:Does exists any version de PREVIEW than can save in PDF format?

Regards


George