[erledigt] HTML als PDF oder XLS
Moderator: Moderatoren
-
- 1000 working lines a day
- Beiträge: 525
- Registriert: Mi, 01. Feb 2006 16:22
- Wohnort: 06618 Naumburg
[erledigt] HTML als PDF oder XLS
Hallo,
gibt es einfache Möglichkeit meine HTML-Ausgabe in ein PDF zu konvertieren?
Die HTML-Seite erstelle ich im Programm selber zeilenweise mit set printer to xyz.html.
gibt es einfache Möglichkeit meine HTML-Ausgabe in ein PDF zu konvertieren?
Die HTML-Seite erstelle ich im Programm selber zeilenweise mit set printer to xyz.html.
Zuletzt geändert von peternmb am Fr, 13. Jan 2017 12:44, insgesamt 1-mal geändert.
- Wolfgang Ciriack
- Der Entwickler von "Deep Thought"
- Beiträge: 2941
- Registriert: Sa, 24. Sep 2005 9:37
- Wohnort: Berlin
- Hat sich bedankt: 13 Mal
- Danksagung erhalten: 34 Mal
- Kontaktdaten:
Re: HTML als PDF
Wenn du Word benutzen willst:
Code: Alles auswählen
oWord := CreateObject( 'Word.Application' )
if !empty(oWord)
oWord:visible := .F.
oWord:documents:open(datei,.F.,.T.)
oDoc:=oWord:ActiveDocument
oDoc:saveas( cSaveFile, wdFormatPDF )
oDoc:close()
oWord:Quit()
oWord:destroy()
oDoc:=nil
oWord:=nil
retw:=cSavefile
endif
Viele Grüße
Wolfgang
Wolfgang
-
- 1000 working lines a day
- Beiträge: 525
- Registriert: Mi, 01. Feb 2006 16:22
- Wohnort: 06618 Naumburg
Re: HTML als PDF
Hallo,
auch mit word wäre das OK, ich erhalte aber leider die Fehlermeldung "unknows Variable wdFormatPDF"
auch mit word wäre das OK, ich erhalte aber leider die Fehlermeldung "unknows Variable wdFormatPDF"
- HaPe
- 1000 working lines a day
- Beiträge: 996
- Registriert: So, 15. Nov 2015 17:44
- Wohnort: 71665 Vaihingen-Enz
- Hat sich bedankt: 17 Mal
- Danksagung erhalten: 15 Mal
Re: HTML als PDF
Hallo
Setze dafür den Wert auf 17 und es sollte laufen.
Da fehlt dir das passende DEFINE in einer ch-Datei.wdFormatPDF
Setze dafür den Wert auf 17 und es sollte laufen.
--
Hans-Peter
Hans-Peter
- Wolfgang Ciriack
- Der Entwickler von "Deep Thought"
- Beiträge: 2941
- Registriert: Sa, 24. Sep 2005 9:37
- Wohnort: Berlin
- Hat sich bedankt: 13 Mal
- Danksagung erhalten: 34 Mal
- Kontaktdaten:
Re: HTML als PDF
Sorry, hier sind die defines:
Code: Alles auswählen
// Enumeration WdSaveFormat
#DEFINE wdFormatDocument 0 && Microsoft Office Word format.
#DEFINE wdFormatDocument97 0 && Microsoft Word 97 document format.
#DEFINE wdFormatTemplate 1 && Word template format.
#DEFINE wdFormatTemplate97 1 && Word 97 template format.
#DEFINE wdFormatText 2 && Microsoft Windows text format.
#DEFINE wdFormatTextLineBreaks 3 && Windows text format with line breaks preserved.
#DEFINE wdFormatDOSText 4 && Microsoft DOS text format.
#DEFINE wdFormatDOSTextLineBreaks 5 && Microsoft DOS text with line breaks preserved.
#DEFINE wdFormatRTF 6 && Rich text format (RTF).
#DEFINE wdFormatEncodedText 7 && Encoded text format.
#DEFINE wdFormatUnicodeText 7 && Unicode text format.
#DEFINE wdFormatHTML 8 && Standard HTML format.
#DEFINE wdFormatWebArchive 9 && Web archive format.
#DEFINE wdFormatFilteredHTML 10 && Filtered HTML format.
#DEFINE wdFormatXML 11 && Extensible Markup Language (XML) format.
#DEFINE wdFormatXMLDocument 12 && XML document format.
#DEFINE wdFormatXMLDocumentMacroEnabled 13 && XML document format with macros enabled.
#DEFINE wdFormatXMLTemplate 14 && XML template format.
#DEFINE wdFormatXMLTemplateMacroEnabled 15 && XML template format with macros enabled.
#DEFINE wdFormatDocumentDefault 16 && Word default document file format. For Microsoft Office Word 2007, this is the DOCX format.
#DEFINE wdFormatPDF 17 && PDF format.
#DEFINE wdFormatXPS 18 && XPS format.
// Enumeration WdExportFormat
#DEFINE wdExportFormatPDF 17 && Export document into PDF format.
#DEFINE wdExportFormatXPS 18 && Export document into XML Paper Specification (XPS) format.
Viele Grüße
Wolfgang
Wolfgang
- brandelh
- Foren-Moderator
- Beiträge: 15703
- Registriert: Mo, 23. Jan 2006 20:54
- Wohnort: Germersheim
- Hat sich bedankt: 70 Mal
- Danksagung erhalten: 34 Mal
- Kontaktdaten:
Re: HTML als PDF
es gibt bei den ActiveX Beispielen eine word.ch, die alle Definitionen der 2003 enthält.
Mit einem Tool von Xbase++ kann man auch eigene machen und die muss man einbinden.
#include "word.ch"
Mit einem Tool von Xbase++ kann man auch eigene machen und die muss man einbinden.
#include "word.ch"
Gruß
Hubert
Hubert
- AUGE_OHR
- Marvin
- Beiträge: 12912
- Registriert: Do, 16. Mär 2006 7:55
- Wohnort: Hamburg
- Hat sich bedankt: 19 Mal
- Danksagung erhalten: 46 Mal
Re: HTML als PDF
peternmb hat geschrieben:ich erhalte aber leider die Fehlermeldung "unknows Variable wdFormatPDF"
Code: Alles auswählen
..\XPPW32\BIN\Tlb2Ch.exe "Word.Application" >> MyWord.CH
gruss by OHR
Jimmy
Jimmy
-
- 1000 working lines a day
- Beiträge: 525
- Registriert: Mi, 01. Feb 2006 16:22
- Wohnort: 06618 Naumburg
Re: HTML als PDF
Super, funktioniert einwandfrei - Danke.
habe ich nicht gefunden, bei mir gibt es die Datei nicht, weder in den Beispielen noch im Verzeichnis \include wo ich so etwas immer hinpacke.es gibt bei den ActiveX Beispielen eine word.ch, die alle Definitionen der 2003 enthält.
Mit einem Tool von Xbase++ kann man auch eigene machen und die muss man einbinden.
vielen Dank für den Hinweisdamit kannst man solche Konstanten aus COM Objecten aufgelistet welche man mit ">>" in eine Datei umleiten kann. (im DOS Fenster)
-
- 1000 working lines a day
- Beiträge: 525
- Registriert: Mi, 01. Feb 2006 16:22
- Wohnort: 06618 Naumburg
Re: HTML als PDF
Hallo,
ist es genauso einfach dIe HTML-Seite nach Excel zu konvertieren?
PS.: ich weiß, dass ich die HTML-Tabelle direkt mit Excel öffnen kann.
ist es genauso einfach dIe HTML-Seite nach Excel zu konvertieren?
PS.: ich weiß, dass ich die HTML-Tabelle direkt mit Excel öffnen kann.
- Wolfgang Ciriack
- Der Entwickler von "Deep Thought"
- Beiträge: 2941
- Registriert: Sa, 24. Sep 2005 9:37
- Wohnort: Berlin
- Hat sich bedankt: 13 Mal
- Danksagung erhalten: 34 Mal
- Kontaktdaten:
Re: HTML als PDF
Ja
Code: Alles auswählen
#define xlTypePDF 0
oExcel := CreateObject( 'Excel.Application' )
if !empty(oExcel)
oExcel:visible := .F.
oExcel:Application:DisplayAlerts:=.F.
oWorkBook:=oExcel:workbooks:open(datei,,.T.)
oWorkBook:ExportAsFixedFormat(xlTypePDF,cSaveFile)
oExcel:Quit()
oExcel:Destroy()
oExcel:=nil
retw:=cSavefile
endif
Viele Grüße
Wolfgang
Wolfgang
- Wolfgang Ciriack
- Der Entwickler von "Deep Thought"
- Beiträge: 2941
- Registriert: Sa, 24. Sep 2005 9:37
- Wohnort: Berlin
- Hat sich bedankt: 13 Mal
- Danksagung erhalten: 34 Mal
- Kontaktdaten:
- HaPe
- 1000 working lines a day
- Beiträge: 996
- Registriert: So, 15. Nov 2015 17:44
- Wohnort: 71665 Vaihingen-Enz
- Hat sich bedankt: 17 Mal
- Danksagung erhalten: 15 Mal
Re: HTML als PDF
Wolfgang war ja fast dran:
#DEFINE xlWorkbookDefault 51
oWorkBook:SaveAs(cSaveFile, xlWorkbookDefault)
#DEFINE xlWorkbookDefault 51
oWorkBook:SaveAs(cSaveFile, xlWorkbookDefault)
--
Hans-Peter
Hans-Peter