Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows10 print to pdf automation
Message
From
21/03/2016 08:00:50
 
 
To
21/03/2016 07:07:03
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01633396
Message ID:
01633416
Views:
357
Hi Dragan and thank you for reply.

Unfortunatly i unistalled all bureautic things as word, excel,...there is a while and cannot test your
code.i found in my archives an old code to save current file open in office2007
#define wdFormatPDF 17
oWord=createObject('word.application')
lodoc=oWord.documents.open(getfile('doc'))
loDoc.saveas("f:\mypdf",wdFormatPDF)  &&pdf
loDoc.close()
oword.quit
if i remember it works with some addon must be installed at this time.

its the same modfied code for excel.
*excel to pdf
#define xlTypePDF 0
*&&save Excel to pdf ( office2007 + addon)
oExcel=createObject('Excel.application')
lodoc=oExcel.workBooks.open(getfile('xls'))
*ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF FileName:=“sales.pdf” Quality:=xlQualityStandard DisplayFileAfterPublish:=True
loDoc.ExportAsFixedFormat(xlTypePDF,"f:\mypdf")  &&pdf
loDoc.close()
oExcel.quit
i know there is many command line to print to pdf (or convert any printable file).
Foxypreviewer gives a beautiful solution but only for VFP reports as this snippet:
DO locfile('foxypreviewer.app')  &&stable version
report form (getfile("frx") ;
          object type 10 ; && regular pdf
          to file ("f:\asupprimer.pdf") ; && destination file
          preview    && open the default pdf viewer
i think the microsoft pdf print to PDF is yet a hidden app and MS forces the user to get it from menu and dialog box
no solution to automate it to convert silently any printable file to pdf.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform