I am happy with Gflax 2.40 and I am managing a online library with thousands of documents. I use Gflax to generate thumbnail on the fly of all images including PDF (only Office document can not be displayed...).
I try to improve the speed to create a thumbnail on the fly for big PDF's.
It seems that even with .page=1 parameter GFlax loads the whole PDF and generate all the thumbnails to display just one at the end.
Another question: Is there also a way to add buttons on the web page like Next Page/Previous Page to navigate in the document?
Thanks for your help!
I have this code to create a thumbnail on the fly:
Code: Select all
On Error Resume Next
Response.Clear
Response.Buffer = True
Dim File, Px, newWidth, newHeight
File = request.QueryString("Path")
Px = Request.QueryString("px")
if Px = "" then
Px = 300
end if
Set ThumbNail = server.createobject("GflAx.GflAx")
const AX_JPEG = 3
const AX_To16Colors = 16
With ThumbNail
.EpsDpi = 72
.EpsWidth = Px
.EnableLzw = True
.Page = 1
.LoadBitmap File
.SaveJPEGQuality = 10 'Quality of 70%
.Saveformat = AX_JPEG
if Thumbnail.Width > Thumbnail.Height then
newWidth = Px 'Get the height according to the width (keep the ratio)
newHeight = (newWidth * .Height) / .Width
else
newHeight = Px
newWidth = (newHeight * .Width) / .Height
end if
.Resize newWidth, newHeight 'Resize the picture
response.contenttype = "image/jpeg"
response.binarywrite .SendBinary
end with
set ThumbNail=nothing
%>
David