PREVIEW PROBLEM

PREVIEW PROBLEM

Postby patili » Sun Mar 11, 2007 6:57 pm

Hi
i have a problem with preview: print... preview
sometimes it works and sometimes no :i see a blank page and when i print it i allready have a blank page
If i delete the "preview" it will print very well
Some other days the preview works good.
Can everybody explain me how the preview works?


I' using FW 2.1
Thanks
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby Otto » Mon Mar 12, 2007 6:15 pm

Preview makes a temp-file to windows-temp folder. If you get an error during printing the temp-file is still there and locked. And the new file can't be created because FW uses always the same name. I changed printer class for me.
Otto

METHOD _StartPage() CLASS TPrinter

LOCAL lSetFixed
LOCAL aDirTMP := {}

If ::hDC = 0
Return NIL
endif

lSetFixed := Set(_SET_FIXED,.F.)

if !::lMeta .AND. !::lStarted
::lStarted := .T.
StartDoc( ::hDC, ::cDocument )
endif

::nPage++



if ::lMeta
aDirTMP := directory(::cDir+"\*.wmf", "D")
AAdd(::aMeta,::cDir+"\T"+ALLTRIM(STR(len(aDirTMP)+1))+Padl(::nPage,4,"0")+".wmf")
::hDCOut := CreateMetaFile(Atail(::aMeta))
else
StartPage(::hDC)
endif

Set(_SET_FIXED,lSetFixed )

Return NIL
User avatar
Otto
 
Posts: 5994
Joined: Fri Oct 07, 2005 7:07 pm

Postby patili » Mon Mar 12, 2007 7:19 pm

Thanks
it is very usefull
Patrick
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby Antonio Linares » Mon Mar 12, 2007 8:39 pm

Otto,

You can use:

AAdd( ::aMeta, ::cDir + cTempFile( "\", "wmf" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby patili » Fri Mar 16, 2007 9:58 pm

But how can i include this new function in my library?
Thanks
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby Antonio Linares » Sat Mar 17, 2007 6:34 am

Modify source\classes\printer.prg, recompile it and replace it into Five.lib

Alternatively you may link the resulting OBJ as another OBJ of your application instead of replacing it into the library
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 4 guests