using LWP getting a PDF file which comes up blank

using LWP getting a PDF file which comes up blank

am 08.08.2006 15:37:16 von churton

--____IDGSMDTPKCJYGAIDCSAC____
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

I'm trying to link a web application to a clinical portal in a hospital. =
The portal links various web enabled applications so the clinician can see =
things from all sorts of databases all in one view. I am trying to =
display from our Electrocardiography application a PDF file of an ECG =
using LWP for display within this portal. When I get the return of the =
PDF, the adobe acrobat plugin pops up but it comes up blank. For multi =
page ECG's it comes up with multiple blank pages. I have saved this =
blank file and looked at it, it seems like it has the same size as a PDF =
which displays in the inherent web application. Loading this saved file =
into Adobe from the desktop, its still blank. Some characters hex code are =
different though (so I'm not sure this is an encoding issue).

Anyone have any thoughts why the PDF file displays

The code I'm using is:

#!c:\Perl\bin\perl.exe

#################################################
## GEMuse_detail.cgi =
#
## ==================== =====
==================== #
## - displays patients individual EKG result =
#
#################################################

$| =3D 1;

use CGI;
use CGI qw/:standard/;
use LWP::UserAgent;


$dataIn =3D new CGI; =20
$dataIn->header();
$requestType =3D $dataIn->param('requestType');

=20
$PatientID =3D $dataIn->param('PatientID');
$Date =3D $dataIn->param('Date');
$Time =3D $dataIn->param('Time');
$TestType =3D $dataIn->param('TestType');
$Site =3D $dataIn->param('Site');
$OutputType =3D $dataIn->param('OutputType');
$Ext =3D $dataIn->param('Ext');


my $url =3D "http://100.200.10.10/musescripts/museweb.dll?RetrieveTestBy Dat=
eTime?PatientID=3D".$PatientID."&Date=3D".$Date."&Time=3D".$ Time."&TestType=
=3D".$TestType."&Site=3D".$Site."&OutputType=3D".$OutputType ."&Ext=3D".$Ext=
;


my $browser =3D LWP::UserAgent->new();


$browser->credentials('100.200.10.10:80', '100.200.10.10', 'user' =3D> =
'password');

=20
my $response =3D $browser->get($url);


print "Content-type: ".$response->header('Content-type');
print "\n\n";

print $response->content;

--____IDGSMDTPKCJYGAIDCSAC____
Content-Type: multipart/related; boundary="____TITWXRYKJLKCDMBDJDVN____"


--____TITWXRYKJLKCDMBDJDVN____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


>


I'm  trying to link a web application to a clinical portal in a =
hospital.  The portal links various web enabled applications so the =
clinician can see things from all sorts of databases all in one view. =
I am trying to display from our Electrocardiography application a =
PDF file of an ECG using LWP for display within this portal.  =
When I get the return of the PDF, the adobe acrobat plugin pops up =
but it comes up blank.   For multi page ECG's it comes up =
with multiple blank pages.   I have saved this blank file and =
looked at it, it seems like it has the same size as a PDF which displays =
in the inherent web application.   Loading this saved file into =
Adobe from the desktop, its still blank. Some characters hex code are =
different though (so I'm not sure this is an encoding issue).

 

Anyone have any thoughts why the PDF file displays

 

The code I'm using is:

 

#!c:\Perl\bin\perl.exe

 

#################################################
## GEMuse_detail.=
cgi            =
            &nb=
sp;            =
            &nb=
sp;            =
            &nb=
sp; #
## ==================== =3D=
==================== ===3D =
#
## - displays patients individual EKG result    &n=
bsp;            =
;            &n=
bsp;            =
;   #
#################################################

 

$| =3D 1;

 

use CGI;
use CGI qw/:standard/;
use LWP::UserAgent;

 


   $dataIn       =3D new =
CGI; 
   $dataIn->header();
   =
$requestType  =3D $dataIn->param('requestType');

 

  
   $PatientID     =
   =3D $dataIn->param('PatientID');
   $Date =
;            =3D =
$dataIn->param('Date');
   $Time    &nb=
sp;        =3D $dataIn->param('Time')=
;
   $TestType        =
=3D $dataIn->param('TestType');
   $Site   =
          =3D $dataIn->para=
m('Site');
   $OutputType       =
=3D $dataIn->param('OutputType');
   $Ext   =
           =3D $dataIn-&g=
t;param('Ext');

 


my $url =3D " ll?RetrieveTestByDateTime?PatientID=3D".$PatientID."&Dat e=3D".$Date."&a=
mp;Time=3D".$Time."&TestType=3D".$TestType."&Site=3D ".$Site."&O=
utputType=3D".$OutputType."&Ext=3D".$Ext'>http://100.200 .10.10/musescri=
pts/museweb.dll?RetrieveTestByDateTime?PatientID=3D".$Patien tID."&Date=
=3D".$Date."&Time=3D".$Time."&TestType=3D".$TestType ."&Site=3D"=
..$Site."&OutputType=3D".$OutputType."&Ext=3D".$Ext
;

 


my $browser =3D LWP::UserAgent->new();

 


$browser->credentials('100.200.10.10:80', '100.200.10.10', =
'user' =3D> 'password');

 

 
my $response =3D $browser->get($url);

 


print "Content-type: ".$response->header('Content-type');
pr=
int "\n\n";

 

print $response->content;


--____TITWXRYKJLKCDMBDJDVN____--

--____IDGSMDTPKCJYGAIDCSAC____--

Re: using LWP getting a PDF file which comes up blank

am 09.08.2006 15:39:28 von jjl

On Tue, 8 Aug 2006, Churton Budd wrote:
[...]
> using LWP for display within this portal. When I get the return of the
> PDF, the adobe acrobat plugin pops up but it comes up blank. For multi
> page ECG's it comes up with multiple blank pages. I have saved this
> blank file and looked at it, it seems like it has the same size as a PDF
> which displays in the inherent web application. Loading this saved file
> into Adobe from the desktop, its still blank. Some characters hex code
> are different though (so I'm not sure this is an encoding issue).
>
> Anyone have any thoughts why the PDF file displays
[...]

Didn't read your code, but: Are you processing the PDF file at any stage
as a text file? If so, stop doing that :)


John