Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows10 print to pdf automation
Message
De
21/03/2016 08:00:50
 
 
À
21/03/2016 07:07:03
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01633396
Message ID:
01633416
Vues:
374
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform