If it possible to fax a PDF file from within FWH ?
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
If it possible to fax a PDF file from within FWH ?
WAITRUN("SumatraPDF.exe -Print-to-default -exit-on-print " + dNameDoc,1)Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Thanks Michel, but I'm looking for something that will Fax without any user intervention.
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 NILFUNCTION 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 NILSadly 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" )
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 NILoDoc:Recipients[ 1 ]:Name = "Enrico Maria Giordano"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 ![]()
Enrico,
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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
It shoudn't make any difference. What do you get? Any error message?
EMG
I get this error: "The fax can't be sent because of an unexpected error"
Try to send the fax manually and check if you get this error either.
EMG
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.
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 ![]()
Great! Thank you for the feedback.
EMG