Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert html to image

Status
Not open for further replies.

ExtraD

Programmer
Jul 6, 2005
41
NL
Hi,

I created a html viewer using the activeX control and shell.explorer. now I was wondering is there a possibility to export the html page to an image (gif, jpeg)?
Or do you know another way to convert html pages to an image.

Many thanx!
 
How about saving it as a MHTML (Web document), which is a single document containing HTML code and images? This requires CDO to be installed.

Code:
Local lcFileName,lcStr && Variables locales
Declare Integer ShellExecute In "Shell32.dll" ;
INTEGER HWnd, ;
STRING lpVerb, ;
STRING lpFile, ;
STRING lpParameters, ;
STRING lpDirectory, ;
LONG nShowCmd
lcFileName = Sys(2015)+'.mht' 
oMSG = Createobject("CDO.Message") 
oMSG.CreateMHTMLBody("[URL unfurl="true"]http://www.microsoft.com")[/URL]
lcStr = oMSG.getstream 
lcStr.SaveToFile(lcFileName,1)
ShellExecute(0,"Open",lcFileName,"","",0)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Hi,

I think I didn’t give you the complete background info, here it is. I’m sending self created html emails. But some customers don’t support html/text they have it set to plain text. Therefore my emails are converted an all style sheet/html settings are gone. Which doesn’t have a great affect as you can imagine ?
That’s why I was thinking about converting to an image or pdf but I prefer an image.

Thanx
 

I can only think of using MHTML. Wouldn't this type of document work for you? It is almost like an image. Or you could use a PDF printer driver (like PDFWriter) to save you document as a PDF, but that would only go as an attachment.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Hi,

creating attachment is an option. i tryed the following 2 solutions but both couldn't be implemented because of the software requerments.

Local lcFileName,lcStr && Variables locales
Declare Integer ShellExecute In "Shell32.dll" ;
INTEGER HWnd, ;
STRING lpVerb, ;
STRING lpFile, ;
STRING lpParameters, ;
STRING lpDirectory, ;
LONG nShowCmd
lcFileName = Sys(2015)+'.mht'
oMSG = Createobject("CDO.Message")
oMSG.To = gEmTo
oMSG.From = gEmFrom
oMSG.Bcc = gEmBcc
oMSG.Subject = gEmSubject

oMSG.AddAttachment(DRVPath + HtmlFax + '\' + gType2 + '\print\' + gName)

oMSG.TextBody = "Please see attachement for the details."

oMSG.Send()

- This needs a SMTP cleint on each machine (IIS).


objSession = CreateObject('Mapi.Session')
objSession.Logon ()
objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = 'Please contact IT'
objMessage.Text = 'This is a test contact JIM'
objRecipient = objMessage.Recipients.Add
objRecipient.Name = '[FAX:0433088921]'
objRecipient.Type = 1
objRecipient.Resolve ()
1,'C:\test.txt' )
objMessage.Attachments.Add('0106001.htm',0, 1,'F:\order06.dbf\faxen\caller\0106001.htm' )
objMessage.Send ()
objSession.Logoff

- You get every time a message from outlook 2003 that an unkown users wants to send an email.


do you maybe have have another solution?

thanx!
 

>>- This needs a SMTP cleint on each machine (IIS).

Not correct, this needs an SMTP SERVICE on a server, not on every client. You can also use an SMTP server from your ISP (which most clients would have since most clients have e-mail). Since most mail transport engine need an SMTP "door" to get out, it really does not matter which solution you use, they all need it.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Hi Mike,

"this needs an SMTP SERVICE on a server, not on every client"

how can i then call the SMTP service from a server in the client app?

could you please change this in my example!?

thanx
 
ExtraD

Perhaps it is best if you start a new thread on this question. Your question no longer pertains to the subject of this post and post it in forum1251

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top