bb.donnay-software.com

Donnay Software Web Forums
It is currently Sun Jun 07, 2020 1:28 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: word2pdf
PostPosted: Wed Aug 13, 2014 12:18 am 
Offline

Joined: Thu Jan 28, 2010 9:24 am
Posts: 147
Location: Nitra, Slovakia
Hi,

because of difficulties displaying word document in the Xbase++ dialog I made a small function to convert and display as a pdf version of the original file.

Have fun.

Regards
Zdeno





"Zdenko Bielik" napísal v správe news:4225f2b8$1268160d$3003c@news.alaska-software.com...

Hi all,

thanks for tips, infos and experiencies.

I also did some little search on internet and I made some "workaround" :-)

In attached example I first open MS Word document and then
- it is printed with any PDF Printer or (slowly and must be installed any
virtual pdf-driver)
- saved it as PDF or (saved file has bigger size)
- Exported to PDF (this is my current choice - fast and small)
and then showed.

Hope this maybe helps someone and finds this usefull.

TIA & Regards
Zdeno


Attachments:
ActiveX-Doc2Pdf-Exp.zip [265.15 KiB]
Downloaded 653 times
Top
 Profile  
 
 Post subject: Re: word2pdf
PostPosted: Wed Aug 13, 2014 7:50 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4128
Location: Boise, Idaho USA
This is interesting and may be useful, but I don't see it as something to put into eXpress++, other than as a sample program.

I use the universal web browser when I want to display a .DOC or DOCX file.

I use DCHTMLVIEWER .. NAVIGATE <cFileName>

Have you tried this?

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
 Post subject: Re: word2pdf
PostPosted: Wed Aug 13, 2014 8:10 am 
Offline

Joined: Thu Jan 28, 2010 9:24 am
Posts: 147
Location: Nitra, Slovakia
Hi Roger,

yes, I used that function some time ago, but with newer versions of IE(I have IE 11 on Win 8.1) are two problems now:

- message with choices Run/Save/Cancel is displayed when you want show any DOC(-X) file with this class
- and NEW window with MS Word app is ALWAYS OPENED

and I/user want it have into ONE Xbase++/eXpress++ dialog

just try run your sample WebBrow.prg from \exp19\samples\activex and open any DOC file

Regards
Zdeno


Top
 Profile  
 
 Post subject: Re: word2pdf
PostPosted: Wed Aug 13, 2014 3:44 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1185
Zdeno Bielik wrote:
because of difficulties displaying word document in the Xbase++ dialog ...
did your try DSOframer OCX ?

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
 Post subject: Re: word2pdf
PostPosted: Wed Aug 13, 2014 10:39 pm 
Offline

Joined: Wed Jan 27, 2010 10:25 pm
Posts: 354
Location: Berlin Germany
Hello Zdeno,
thank you for sharing this.
It would be better, to open the doc as writeprotected so that the conversation can be done without a question of Word if its in use.
Code:
oWord:documents:open(( _cPath + _cFile ), .F., .T.)

_________________
_______________________
Best Regards
Wolfgang


Top
 Profile  
 
 Post subject: Re: word2pdf
PostPosted: Wed Aug 13, 2014 11:56 pm 
Offline

Joined: Wed Jan 27, 2010 10:25 pm
Posts: 354
Location: Berlin Germany
And here the same for Excel-files to PDF (in short):
Code:
#define xlTypePDF   0

  oExcel := CreateObject( 'Excel.Application' )
   if !empty(oExcel)
      oExcel:visible := .F.
      oExcel:Application:DisplayAlerts:=.F.
      oWorkBook:=oExcel:workbooks:open(file,,.T.)
      oWorkBook:ExportAsFixedFormat(xlTypePDF,cSaveFile)
      oExcel:Quit()
      oExcel:Destroy()

_________________
_______________________
Best Regards
Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group