Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Html - pdf
Message
 
To
12/05/2014 11:36:15
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01599358
Message ID:
01599889
Views:
67
Actually Word will open most HTML documents and use them as is. If you're doing HTML to PDF it actually works pretty well for that as long as you stay with relatively straight forward HTML that fits Words base styles. FWIW, I do this with Help Builder and it works pretty well.

+++ Rick ---

>Have you ever look at the HTML that Word creates? Using Word to create HTML is not a good idea.
>
>>If you are creating the html file in MSWord, i would think that you could use MSWord's "save as PDF" feature (which i believe was added in Word2010, there are downloads for earlier versions).
>>
>>
>>#define wdDoNotSaveChanges  0
>>#define wdExportFormatPDF 17
>>#Define wdAlertsNone    0
>>
>>llAttachPDF = .t.
>>TRY
>>	WordObj = CREATEOBJECT("Word.Application")
>>	WordObj.Application.DisplayAlerts = wdAlertsNone
>>	WordObj.documents.open("&lcPassedInDoc")
>>	WordObj.visible = .f.
>>	
>>	*--- lOpenPDF: is set to true or false.  Controls whether PDF is displayed.
>>	*---
>>	WordObj.ActiveDocument.ExportAsFixedFormat("&lcPDFname", 17, lOpenPDF)
>>
>>
>>
>>>i vae a prg which creates an html document which I need as a pdf so I can email it to someone with all the photos in place
>>>I use cutepdf but that propmts for a file name
>>>
>>>is there a programatic way to do this? this is what I do at the bottom of the prg and it requires manual printing, adding afilename and then opening the pdf and emailing...
>>>I would like to do this fully automated
>>>possible??? How???
>>>
>>>
>>>
>>>lcWordFname = FULLPATH([TownDossier_]+lcTownName+[_]+CHRTRAN(TRANSFORM(DATETIME()),[\/: ],[])+[.htm]) 
>>>STRTOFILE(lcHTML , lcWordFname )
>>>
>>>
>>>Local oWord as word.application
>>>oWord=Createobject("word.application")	&& Create word object
>>>oWOrd.Visible = .t.
>>>With oWord
>>>  .documents.open(lcWordFname)  && New file or open a template
>>>	
>>>ENDWITH 
>>>oWord.ActiveDocument.SaveAs(lcWordFname)
>>>oWord.Activate()
>>>
>>>
>>>
>>>thanks
>>>
>>>
>>>Peter
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform