Faxinng from FWH
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Faxinng from FWH
If it possible to fax a PDF file from within FWH ?
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Re: Faxinng from FWH
Jeff,
I use this code to print a PDF from my application :dNameDoc is my PDF-file I want to print.
You can download SumatraPDF.exe from http://www.sumatrapdfreader.org.
It is the portable version I use.
I use this code to print a PDF from my application :
Code: Select all
WAITRUN("SumatraPDF.exe -Print-to-default -exit-on-print " + dNameDoc,1)
You can download SumatraPDF.exe from http://www.sumatrapdfreader.org.
It is the portable version I use.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Faxinng from FWH
Thanks Michel, but I'm looking for something that will Fax without any user intervention.
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Faxinng from FWH
Try these two samples. Honestly I don't know if they still work in the current Windows versions.
EMG
Code: Select all
FUNCTION MAIN( cTel )
LOCAL oFax := CREATEOBJECT( "FaxComEx.FaxServer" )
LOCAL oDoc := CREATEOBJECT( "FaxComEx.FaxDocument" )
IF EMPTY( cTel ); cTel = "0639728261"; ENDIF
oFax:Connect( "" )
oDoc:Body = CURDRIVE() + ":\" + CURDIR() + "\TEST.DOC"
oDoc:DocumentName = "Fax test"
oDoc:Recipients:Add( cTel )
oDoc:Recipients( 0 ):Name = "Enrico Maria Giordano"
oDoc:ConnectedSubmit( oFax )
oFax:Disconnect()
RETURN NIL
Code: Select all
FUNCTION MAIN()
LOCAL oFax := CREATEOBJECT( "FaxServer.FaxServer" )
LOCAL oDoc
oFax:Connect( "COM1" )
oDoc = oFax:CreateDocument( "E:\XHARBOUR\FAX.TXT" )
oDoc:FaxNumber = "0639728261"
oDoc:FileName = "E:\XHARBOUR\FAX.TXT"
oDoc:Send()
oDoc:Disconnect()
RETURN NIL
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Faxinng from FWH
Sadly no, with either example I get a "member not found" error.
I do have the window fax service enabled. Is there anything else I need to have for this to work?
First example give the error for:
oDoc:Recipients:Add( cTel )
oDoc:Recipients( 0 ):Name = "Enrico Maria Giordano"
Second example gives error for:
oFax:Connect( "COM1" )
I do have the window fax service enabled. Is there anything else I need to have for this to work?
First example give the error for:
oDoc:Recipients:Add( cTel )
oDoc:Recipients( 0 ):Name = "Enrico Maria Giordano"
Second example gives error for:
oFax:Connect( "COM1" )
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Faxinng from FWH
This seems to work:
Please note the difference here:
EMG
Code: Select all
FUNCTION MAIN( cTel )
LOCAL oFax := CREATEOBJECT( "FaxComEx.FaxServer" )
LOCAL oDoc := CREATEOBJECT( "FaxComEx.FaxDocument" )
IF EMPTY( cTel ); cTel = "0639728261"; ENDIF
oFax:Connect( "" )
oDoc:Body = CURDRIVE() + ":\" + CURDIR() + "\TEST.DOC"
oDoc:DocumentName = "Fax test"
oDoc:Recipients:Add( cTel )
oDoc:Recipients[ 1 ]:Name = "Enrico Maria Giordano"
oDoc:ConnectedSubmit( oFax )
oFax:Disconnect()
RETURN NIL
Code: Select all
oDoc:Recipients[ 1 ]:Name = "Enrico Maria Giordano"
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Faxinng from FWH
Thanks Enrico. Looks like it might work ... suffering some modem issues but your code will connect, dial and try to send. I might need a new modem with updated drivers
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Re: Faxinng from FWH
Enrico,
What do you do if your fax is the same as your networkprinter?
What do you do if your fax is the same as your networkprinter?
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Faxinng from FWH
It shoudn't make any difference. What do you get? Any error message?
EMG
EMG
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Faxinng from FWH
I get this error: "The fax can't be sent because of an unexpected error"
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Faxinng from FWH
Try to send the fax manually and check if you get this error either.
EMG
EMG
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Faxinng from FWH
Sending manually gives me the same error
Must be something with the Windows Fax software.
The first fax modem I tried was an external usb type.
Then I tried with an internal fax modem.
Both do the exact same thing.
Must be something with the Windows Fax software.
The first fax modem I tried was an external usb type.
Then I tried with an internal fax modem.
Both do the exact same thing.
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Faxinng from FWH
Problem solved....
I went into Add/Remove Program Features and removed windows fax/scan. Rebooted. Added it back then rebooted again.
Now it works perfectly
I went into Add/Remove Program Features and removed windows fax/scan. Rebooted. Added it back then rebooted again.
Now it works perfectly
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Faxinng from FWH
Great! Thank you for the feedback.
EMG
EMG