[Perl-unix-users] Streaming a PDF to the browser

[Perl-unix-users] Streaming a PDF to the browser

am 17.01.2007 18:00:35 von Ben Eagle

This is a multi-part message in MIME format.

--===============0736366211==
Content-Class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C73A57.05445FA2"


------_=_NextPart_001_01C73A57.05445FA2
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Using PDF::API2, I am trying to build a pdf straight to the browser
without having to save it to the server.

=20

I am using:

=20

print $q->header( "application/pdf" );

=20

print $pdf->stringify;

$pdf->end;

=20

=20

but its not working all I get is garble its not opening the pdf just
spitting the encoded text to the screen

=20

can anyone give me any Ideas on how to fix this???


------_=_NextPart_001_01C73A57.05445FA2
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable




charset=3Dus-ascii">












style=3D'font-size:10.0pt;
font-family:Arial'>Using PDF::API2, I am trying to build a pdf straight =
to the
browser without having to save it to the server.



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>I am using:



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>print $q->header( "application/pdf" =
);



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>print $pdf->stringify;



style=3D'font-size:10.0pt;
font-family:Arial'>$pdf->end;



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>but its not working all I get is garble its not =
opening the pdf
just spitting the encoded text to the screen



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>can anyone give me any Ideas on how to fix =
this???









------_=_NextPart_001_01C73A57.05445FA2--

--===============0736366211==
Content-Type: text/plain;
charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0736366211==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0736366211==--

RE: [Perl-unix-users] Streaming a PDF to the browser

am 17.01.2007 18:34:12 von Mike Crowl

This is a multi-part message in MIME format.

--===============1768150324==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C73A5D.A33B69DB"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C73A5D.A33B69DB
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Sounds like the browser is not recognizing the mime-type you are sending
it, probably not a pdf problem but might be a problem with this:

=20

print $q->header( "application/pdf" );

=20

Usually when the browser can't figure out what type it is getting it
will fall back on text-dump mode and you'll get the file dumped as text
to the screen. Is the PDF plugin set up right? (I hate to ask that but
it seems the browser doesn't have something to handle the mime-type it
is getting.)

=20

This sounds almost like it should be an application/octet-stream because
you are not actually feeding the browser a filename.pdf, you are feeding
it a binary stream.

=20

Hit google with: pdf stream mime type

=20

A lot to sift through, but hopefully some helpful breadcrumbs out there.

=20

-Mike

=20

________________________________

From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Ben
Eagle
Sent: Wednesday, January 17, 2007 10:01 AM
To: Joe@activestate.com
Cc: activeperl@listserv.ActiveState.com
Subject: [Perl-unix-users] Streaming a PDF to the browser

=20

Using PDF::API2, I am trying to build a pdf straight to the browser
without having to save it to the server.

=20

I am using:

=20

print $q->header( "application/pdf" );

=20

print $pdf->stringify;

$pdf->end;

=20

=20

but its not working all I get is garble its not opening the pdf just
spitting the encoded text to the screen

=20

can anyone give me any Ideas on how to fix this???


------_=_NextPart_001_01C73A5D.A33B69DB
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">


charset=3Dus-ascii">










style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Sounds like the browser is not =
recognizing
the mime-type you are sending it, probably not a pdf problem but might =
be a
problem with this:



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:10.0pt;
font-family:Arial'>print $q->header( "application/pdf" =
);



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Usually when the browser =
can’t
figure out what type it is getting it will fall back on text-dump mode =
and you’ll
get the file dumped as text to the screen.  Is the PDF plugin set =
up
right?  (I hate to ask that but it seems the browser doesn’t =
have
something to handle the mime-type it is =
getting.)



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>This sounds almost like it should =
be an
application/octet-stream because you are not actually feeding the =
browser a
filename.pdf, you are feeding it a binary =
stream.



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Hit google with:  pdf stream =
mime
type



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>A lot to sift through, but =
hopefully some
helpful breadcrumbs out there.



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> -Mike
=



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 





size=3D3
face=3D"Times New Roman">






style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:
size=3D2
face=3DTahoma>
activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] style=3D'font-weight:
bold'>On Behalf Of
Ben Eagle

Sent: Wednesday, January =
17, 2007
10:01 AM

To: =
Joe@activestate.com

Cc:
activeperl@listserv.ActiveState.com

Subject: =
[Perl-unix-users]
Streaming a PDF to the browser





style=3D'font-size:
12.0pt'> 



style=3D'font-size:10.0pt;
font-family:Arial'>Using PDF::API2, I am trying to build a pdf straight =
to the
browser without having to save it to the =
server.



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>I am using:



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>print $q->header( "application/pdf" =
);



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>print =
$pdf->stringify;



style=3D'font-size:10.0pt;
font-family:Arial'>$pdf->end;



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>but its not working all I get is garble its not =
opening the
pdf just spitting the encoded text to the =
screen



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>can anyone give me any Ideas on how to fix =
this???









------_=_NextPart_001_01C73A5D.A33B69DB--

--===============1768150324==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1768150324==--

RE: [Perl-unix-users] Streaming a PDF to the browser

am 17.01.2007 21:13:53 von Ben Eagle

This is a multi-part message in MIME format.

--===============1408352664==
Content-Class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C73A74.0231C242"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C73A74.0231C242
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I found it, the problem was I was sending 2 headers the first one was
text/plain, once I deleted that header it worked fine, thanks for all
the help

=20

-----Original Message-----
From: Mike Crowl [mailto:mcrowl@affinitygroup.com]=20
Sent: Wednesday, January 17, 2007 12:34 PM
To: Ben Eagle; Joe@activestate.com
Cc: activeperl@listserv.ActiveState.com
Subject: RE: [Perl-unix-users] Streaming a PDF to the browser

=20

Sounds like the browser is not recognizing the mime-type you are sending
it, probably not a pdf problem but might be a problem with this:

=20

print $q->header( "application/pdf" );

=20

Usually when the browser can't figure out what type it is getting it
will fall back on text-dump mode and you'll get the file dumped as text
to the screen. Is the PDF plugin set up right? (I hate to ask that but
it seems the browser doesn't have something to handle the mime-type it
is getting.)

=20

This sounds almost like it should be an application/octet-stream because
you are not actually feeding the browser a filename.pdf, you are feeding
it a binary stream.

=20

Hit google with: pdf stream mime type

=20

A lot to sift through, but hopefully some helpful breadcrumbs out there.

=20

-Mike

=20

_____ =20

From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Ben
Eagle
Sent: Wednesday, January 17, 2007 10:01 AM
To: Joe@activestate.com
Cc: activeperl@listserv.ActiveState.com
Subject: [Perl-unix-users] Streaming a PDF to the browser

=20

Using PDF::API2, I am trying to build a pdf straight to the browser
without having to save it to the server.

=20

I am using:

=20

print $q->header( "application/pdf" );

=20

print $pdf->stringify;

$pdf->end;

=20

=20

but its not working all I get is garble its not opening the pdf just
spitting the encoded text to the screen

=20

can anyone give me any Ideas on how to fix this???


------_=_NextPart_001_01C73A74.0231C242
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable




charset=3Dus-ascii">












style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>I found it, the problem was I was =
sending
2 headers the first one was text/plain, once I deleted that header it =
worked
fine, thanks for all the help



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----

From: Mike Crowl
[mailto:mcrowl@affinitygroup.com]

Sent:
size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>Wednesday,
January 17, 2007
style=3D'font-size:
10.0pt;font-family:Tahoma'>
face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>12:34 =
PM
size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>

To: Ben Eagle; =
Joe@activestate.com

Cc:
activeperl@listserv.ActiveState.com

Subject: RE: =
[Perl-unix-users]
Streaming a PDF to the browser



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Soun ds like the =
browser
is not recognizing the mime-type you are sending it, probably not a pdf =
problem
but might be a problem with this:



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>print $q->header(
"application/pdf" );



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Usua lly when the =
browser
can’t figure out what type it is getting it will fall back on =
text-dump
mode and you’ll get the file dumped as text to the screen.  =
Is the
PDF plugin set up right?  (I hate to ask that but it seems the =
browser
doesn’t have something to handle the mime-type it is =
getting.)



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>This sounds =
almost like
it should be an application/octet-stream because you are not actually =
feeding
the browser a filename.pdf, you are feeding it a binary =
stream.



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Hit google =
with: 
pdf stream mime type



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>A lot to sift =
through,
but hopefully some helpful breadcrumbs out there.



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'> -Mike >



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>  nt>





style=3D'margin-left:.5in;text-align:center'> size=3D3 face=3D"Times New Roman">






face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From: n> size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>
activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] style=3D'font-weight:
bold'>On Behalf Of
Ben Eagle

Sent:
size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>Wednesday,
January 17, 2007
style=3D'font-size:
10.0pt;font-family:Tahoma'>
face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>10:01 =
AM
size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>

To: =
Joe@activestate.com

Cc:
activeperl@listserv.ActiveState.com

Subject: =
[Perl-unix-users]
Streaming a PDF to the browser





face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>Using PDF::API2, I am =
trying to
build a pdf straight to the browser without having to save it to the =
server.



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>I am =
using:



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>print $q->header(
"application/pdf" );



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>print =
$pdf->stringify;



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>$pdf->end;<=
/p>

face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>but its not working all I =
get is
garble its not opening the pdf just spitting the encoded text to the =
screen



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> 



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>can anyone give me any =
Ideas on how
to fix this???









------_=_NextPart_001_01C73A74.0231C242--

--===============1408352664==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1408352664==--