Write image back to browser

Want to send an image from php to browser?  You can use code like this

< ?php
header('Content-type: image/jpg');
readfile('your.jpg');
?>

 

For using with htmlsnapshot, the code is like this

 < ?php

$snap = new COM("HTMLSNAP2.HtmlSnap.1");
header('Content-type: image/jpg');

$snap->SnapUrl(www.google.com, “*”)
print $snap->GetImageBytes(“*.jpg”)
?>

Scale image when converting tiff to pdf

TIFF is a raster image. It has a DPI property to tell how long in inch the width or height of the image is.

When converting tiff to pdf, the default pdf DPI is 72, which means 72 pixels per inch.

So if you want to keep the pdf page size as large as the orignal TIFF image in inch, you can do it with the new method of the tiff to pdf component.

SetImageScaleRatio(LONG xScalePercent, LONG yScalePercent)
xScalePercent: the percent of PDF DPI ration (72) against the orignal image x DPI

yScalePercent: the percent of PDF DPI ration (72) against the orignal image y DPI 

For example, if you TIFF has DPI 200, the scale ration is 100*72/200. What you need to do is to call this method before converting.

After doing this, the pdf page can be in same inch to the tiff image. And the image quality doesn’t degrade as well. 

 

 

 

 

Generate html thumbnail directly

You can generate thumbnail for a web page with html snapshot in several ways.

You can do in an easy way:

snap.SnapUrl(“www.google.com“, “1.jpg”)

snap.GetThumbnailImage(…)

 

A little complexer but more flexible way in case that you don’t need the big image

snap.SnapUrl “http://www.google.com“, “*”
 
‘Get the compressed image bytes out
‘it uses the extenstion to determine the file format
‘Get the thumbnail image bytes and save to file.
out = snap.GetThumbImageBytes(“*.jpg”, 100, 100, 1)
Set adoStream = CreateObject(“ADODB.Stream”)
adoStream.Type = 1
adoStream.Open
adoStream.Write out
adoStream.SaveToFile “1s.jpg”

Convert local html file to image

Some people want to convert html file at local disk to image. This can be done with html snapshot easily

Suppose your local html file is c:1.htm, you can call html snapshot like this to convert it into jpg file:

snap.SnapUrl(“file://c:1.htm”, “c:1.jpg”)

If you have a html string, you can do it in two ways.

1. save your html string to a local html file like c:1.htm. Then call SnapUrl in your program like above

2. you can call SnapHtmlString to achieve this.

 

 

 

 

Customer comments on html snapshot

Customer satifaction is one of our goal and motivation to start software business. We always work hard to ensure our customers are satisfied with our products or services. And we would like to collect customer’s feedback and comments on our products as well. :)

Here are some of the comments we got:

The HTML snapshot is a great tool. It saved me many hours of development time and allowed me to concentrate on my application.

Thanks for your support and hand-holding.

–Mr. Wigdor

Write a folder in ASP.Net

When using our components like  pdf split and merge in your ASP.Net application, you need to first set the working folder access to ensure the folder can be written in ASP.Net

 1. Using Windows Explorer, navigate to the working Folder (for example C:Inetpubwwwroot).

2. Right-click on the folder and choose Properties.

3. Select the Security tab. If you do not see the Security tab with Windows XP, you must disable “Simple File Sharing.” From the Windows Explorer menu choose Tools, Folder Options, View tab, and uncheck the Use simple file sharing (Recommended) option. This will enable the Security tab on file and folder property dialogs.

4. Look in the Group or user names list for aspnet_wp account (machine_nameASPNET) where machine_name is the name of your computer. If it is not present, click the Add… button and type ASPNET in the box and click the OK button.
Select the aspnet_wp account (machine_nameASPNET) user. Make sure the Allow check boxes are checked for the Modify and Write permissions. Click the OK button.