How to delete my avatar?
Multiple PDF image rendering in the same window in Classic ASP
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > Multiple PDF image rendering in the same window in Classic ASP 8 July 2006 15:19:07

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Multiple PDF image rendering in the same window in Classic ASP

Guest 8 July 2006 15:19:07
 In SQL 2000 I have an Image table that has an "image" column. In this
table these "images" are stored in a PDF format. I'm trying to render
several of these PDF images in one browser by looping through the
recordset and doing a Reponse.WriteBinary­ for each image. However,
when I do this it only seems to open the first PDF image in the browser

and not the rest. The ASP code looks something like this:

Response.ContentTyp­e = "application/pdf"


Set cn = Server.CreateObject­("ADODB.Connection")­


strSQL = "usp_selectimages " ----- the SPROC is hardcoded to
return 10
records with images


Set rs = cn.Execute (strSql)


Do While Not rs.EOF
Response.BinaryWrit­e rs("image")
rs.MoveNext
Loop


rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing


Is there anyone out there that has tried performing something like
this? Is there a way to intercept the image stream so I can tell the
PDF engine when it should start and end with a set of images?

Add comment
Mike Brind 6 July 2006 22:55:29 permanent link ]
 
mikepmyers@hotmail.­com wrote:> In SQL 2000 I have an Image table that has an "image" column. In this> table these "images" are stored in a PDF format. I'm trying to render> several of these PDF images in one browser by looping through the> recordset and doing a Reponse.WriteBinary­ for each image. However,> when I do this it only seems to open the first PDF image in the browser>
and not the rest. The ASP code looks something like this:>
Response.ContentTyp­e = "application/pdf">
Set cn = Server.CreateObject­("ADODB.Connection")­>
strSQL = "usp_selectimages " ----- the SPROC is hardcoded to> return 10> records with images>
Set rs = cn.Execute (strSql)>
Do While Not rs.EOF> Response.BinaryWrit­e rs("image")> rs.MoveNext> Loop>
rs.Close> Set rs = Nothing> cn.Close> Set cn = Nothing>
Is there anyone out there that has tried performing something like> this? Is there a way to intercept the image stream so I can tell the> PDF engine when it should start and end with a set of images?

As far as the browser is concerned, it is being sent a pdf document
(not an image). AFAIK it can only display one at a time. There are
two options that might be worth a try. You could either try to display
each pdf doc in it's own iframe (don't know whether it will work, but
don't see why not....) or you could download AspPDF from Persits and
use it to combine multiple pdf docs into one document.

HTH

--
Mike Brind

Add comment
Guest 8 July 2006 03:17:18 permanent link ]
 Thanks, Mike. I downloaded a similiar tool (activePDF) but I can't
seem to merge the DB blobs (i.e. PDF documents) into one file. Have
you every used AspPDF to do something similiar?


Mike Brind wrote:> mikepmyers@hotmail.­com wrote:> > In SQL 2000 I have an Image table that has an "image" column. In this> > table these "images" are stored in a PDF format. I'm trying to render> > several of these PDF images in one browser by looping through the> > recordset and doing a Reponse.WriteBinary­ for each image. However,> > when I do this it only seems to open the first PDF image in the browser> >
and not the rest. The ASP code looks something like this:> >
Response.ContentTyp­e = "application/pdf"> >
Set cn = Server.CreateObject­("ADODB.Connection")­> >
strSQL = "usp_selectimages " ----- the SPROC is hardcoded to> > return 10> > records with images> >
Set rs = cn.Execute (strSql)> >
Do While Not rs.EOF> > Response.BinaryWrit­e rs("image")> > rs.MoveNext> > Loop> >
rs.Close> > Set rs = Nothing> > cn.Close> > Set cn = Nothing> >
Is there anyone out there that has tried performing something like> > this? Is there a way to intercept the image stream so I can tell the> > PDF engine when it should start and end with a set of images?>
As far as the browser is concerned, it is being sent a pdf document> (not an image). AFAIK it can only display one at a time. There are> two options that might be worth a try. You could either try to display> each pdf doc in it's own iframe (don't know whether it will work, but> don't see why not....) or you could download AspPDF from Persits and> use it to combine multiple pdf docs into one document.>
--> Mike Brind

Add comment
Mike Brind 8 July 2006 15:19:07 permanent link ]
 Yes.

--
Mike Brind

mikepmyers@hotmail.­com wrote:> Thanks, Mike. I downloaded a similiar tool (activePDF) but I can't> seem to merge the DB blobs (i.e. PDF documents) into one file. Have> you every used AspPDF to do something similiar?>
Mike Brind wrote:> > mikepmyers@hotmail.­com wrote:> > > In SQL 2000 I have an Image table that has an "image" column. In this> > > table these "images" are stored in a PDF format. I'm trying to render> > > several of these PDF images in one browser by looping through the> > > recordset and doing a Reponse.WriteBinary­ for each image. However,> > > when I do this it only seems to open the first PDF image in the browser> > >
and not the rest. The ASP code looks something like this:> > >
Response.ContentTyp­e = "application/pdf"> > >
Set cn = Server.CreateObject­("ADODB.Connection")­> > >
strSQL = "usp_selectimages " ----- the SPROC is hardcoded to> > > return 10> > > records with images> > >
Set rs = cn.Execute (strSql)> > >
Do While Not rs.EOF> > > Response.BinaryWrit­e rs("image")> > > rs.MoveNext> > > Loop> > >
rs.Close> > > Set rs = Nothing> > > cn.Close> > > Set cn = Nothing> > >
Is there anyone out there that has tried performing something like> > > this? Is there a way to intercept the image stream so I can tell the> > > PDF engine when it should start and end with a set of images?> >
As far as the browser is concerned, it is being sent a pdf document> > (not an image). AFAIK it can only display one at a time. There are> > two options that might be worth a try. You could either try to display> > each pdf doc in it's own iframe (don't know whether it will work, but> > don't see why not....) or you could download AspPDF from Persits and> > use it to combine multiple pdf docs into one document.> >
--> > Mike Brind

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > Multiple PDF image rendering in the same window in Classic ASP 8 July 2006 15:19:07

see also:
The Better Motherboard..
Quieter PS/Case fan ?
Gigabyte GA-K8NXP-9 updates
пройди тесты:
see also:
MY SISTER DREAMT SO MUCH ABOUT ME THOSE…
MY SISTER AND ME, WOULD LAUGH TOGETHER…
MY SISTER GOT A LITTLE ANGRY WITH ME…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .