Multiple PDF image rendering in the same window in Classic ASP
Multiple PDF image rendering in the same window in Classic ASP
am 05.07.2006 22:24:59 von mikepmyers
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.ContentType = "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.BinaryWrite 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?
Re: Multiple PDF image rendering in the same window in Classic ASP
am 06.07.2006 20:55:29 von Mike Brind
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.ContentType = "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.BinaryWrite 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
Re: Multiple PDF image rendering in the same window in Classic ASP
am 08.07.2006 01:17:18 von mikepmyers
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.ContentType = "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.BinaryWrite 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
Re: Multiple PDF image rendering in the same window in Classic ASP
am 08.07.2006 13:19:07 von Mike Brind
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.ContentType = "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.BinaryWrite 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