[Perl-unix-users] Creating a Dynamic Table??

2007-01-10 Thread Ben Eagle
I am making a PDF , which using PDF::Table I am making a table inside
that PDF.

 

What I am trying to do is make the table dynamic, cause I am passing
variables and I do not want a blank table row if the variable is empty.
This is what I have tried so far:

 

my $some_data =[

["HP Hardware", "Total Cost"],

[$hardware1, $hardwareValue1],

[$hardware2, $hardwareValue2],

[$hardware3, $hardwareValue3],

[$hardware4, $hardwareValue4],

[$hardware5, $hardwareValue5],

[$hardware6, $hardwareValue6],

[$hardware7, $hardwareValue7],

[$hardware8, $hardwareValue8],

[$hardware9, $hardwareValue9],

[$hardware10, $hardwareValue10],

[$hardware11, $hardwareValue11],

[$hardware12, $hardwareValue12],

[$hardware13, $hardwareValue13],

[$hardware14, $hardwareValue14],

[$hardware15, $hardwareValue15],

 ];

 

for (my $i=0; $i< scalar($some_data); $i++) {

 

if ($hardware[$i] eq "") {



}

 

}

 

 

I am thinking if the variable is blank I want to delete the row from
$some_data, I don't know the syntax to do it,

 

Any help or suggestions would be helpful, thanks

 

Ben

___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

[Perl-unix-users] Creating a Dynamic Table??

2007-01-10 Thread Ben Eagle
I am making a PDF , which using PDF::Table I am making a table inside
that PDF.

 

What I am trying to do is make the table dynamic, cause I am passing
variables and I do not want a blank table row if the variable is empty.
This is what I have tried so far:

 

my $some_data =[

["HP Hardware", "Total Cost"],

[$hardware1, $hardwareValue1],

[$hardware2, $hardwareValue2],

[$hardware3, $hardwareValue3],

[$hardware4, $hardwareValue4],

[$hardware5, $hardwareValue5],

[$hardware6, $hardwareValue6],

[$hardware7, $hardwareValue7],

[$hardware8, $hardwareValue8],

[$hardware9, $hardwareValue9],

[$hardware10, $hardwareValue10],

[$hardware11, $hardwareValue11],

[$hardware12, $hardwareValue12],

[$hardware13, $hardwareValue13],

[$hardware14, $hardwareValue14],

[$hardware15, $hardwareValue15],

 ];

 

for (my $i=0; $i< scalar($some_data); $i++) {

 

if ($hardware[$i] eq "") {



}

 

}

 

 

I am thinking if the variable is blank I want to delete the row from
$some_data, I don't know the syntax to do it,

 

Any help or suggestions would be helpful, thanks

 

Ben

___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

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

2007-01-17 Thread Ben Eagle
Using PDF::API2, I am trying to build a pdf straight to the browser
without having to save it to the server.

 

I am using:

 

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

 

print $pdf->stringify;

$pdf->end;

 

 

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

 

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

___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

[Perl-unix-users] PDF::API2 creating paragraph

2007-01-18 Thread Ben Eagle
I have been trying (unsuccessfully I m ight add) to create paragraphs, I
know it can be done but I have yet to get it to work, here are a few
snippets trying to create it neither work

 

use PDF::API2;

use perlchartdir;

use strict;

use warnings;

 

use constant mm => 25.4/72;

use constant in =>1/72;

use constant pt =>1;

 

my $Template = "Dell_Deployment_Optimization.pdf";

 

my $pdftable = new PDF::Table;

 my $pdf = new PDF::API2("testme.pdf");

my $page = $pdf->page;

my $txt = $pdf->text;

 

my $paragraph = "hfsdhfash jklshf jkshdf sjfh asjf jlkhasdf shf kljashf
kjhasd jklhsdfsahfash asfhf ash sfkjh v,nn zxn vkhn n gfoi dfkh vh akdfh
ihzdh klhdkh khgdhfiofjfjfas m, noncv shfhf hshff sdhfshfioshf hsdfs";

 

my $font = $pdf->corefont("Helvetica");

my $lead = 10;

my $fontsize = 12;

my $x = 50;

my $y = 50;

my $width = 300;

my $bottom_margin= 20;

 

$txt = $pdf->font($font,$fontsize);

$txt = $pdf->lead($lead);

$txt = $pdf->translate($x,$y);

my $overflow = $pdf->paragraph( $paragraph,  $width,
$y+$lead-$bottom_margin );

 

print $pdf->stringify;

binmode STDOUT;

 

$pdf->end;

 

 

 

also this code for API2, and I have yet figured out how to get it to
work

 

 

($width_of_last_line, $ypos_of_last_line, $left_over_text) =
$pdftable->text_block(

$txt,

$text_to_place,

#X,Y - coordinates of upper left corner

x=> $left_edge_of_block,

y=> $y_position_of_first_line,

w=> $width_of_block,

h=> $height_of_block,

#OPTIONAL PARAMS

lead => $font_size | $distance_between_lines,

align=> "left|right|center|justify|fulljustify",

hang => $optional_hanging_indent,

Only one of the subsequent 3params can be given. 

They override each other.-parspace is the weightest

parspace => $optional_vertical_space_before_first_paragraph,

flindent => $optional_indent_of_first_line,

fpindent => $optional_indent_of_first_paragraph,

 

indent   => $optional_indent_of_text_to_every_non_first_line,

 );

 

 

everytime I try to use these it either fails, or tells me to download
the .pl file,any help would be great

___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

[Perl-unix-users] PDF Paragraphs

2007-01-23 Thread Ben Eagle
One of the last problems I am having,

 

I need to make paragraphs in PDF API2, I have yet been able to get
anything to work. Nor is there any good documentation anywhere on it,
and the ones that there is do not work.

 

Has anyone got this feature to work and if so and you please shed some
light on it for me??

 

Thanks for all the Help

___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

[Perl-unix-users] Perl module stopping script from running??

2007-02-08 Thread Ben Eagle
I am using a developed module called per ChartDirector, which creates
png charts I use to add to a pdf file.

 

The pdf was not being created, and I found out that when I add 'use
perchartdirector;' the script bombs but only from the browser, in the
shell prompt it runs just fine, this is a problem since the script is
suppose to be ran from the browser. 

 

The server is Solaris, running apache under tomcat (I didn't set it up).
Now I know on another linux server and my windows server the program
runs fine, but kinda wondering why it stops running when called from the
browser, could it be because its under SSL?

___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: [Perl-unix-users] Perl module stopping script from running??

2007-02-08 Thread Ben Eagle
That seemed to take care of the problem of finding the module, but
unfortunetly my script still doesn't work so I will have to fix thoughs
bugs

 

But thanks Matt you deffently got me in the next step.

 

-Original Message-
From: Matt Schneider [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 08, 2007 11:04 AM
To: Ben Eagle; perl-unix-users@listserv.ActiveState.com
Subject: RE: [Perl-unix-users] Perl module stopping script from
running??

 

The path variable is probably different for the anonymous web user on
Solaris.  Can you add make it work by adding a use lib statement that
tells the script where the module is installed?

 

Something like:

use lib '/usr/local/perl/lib/whatever';

 

Matt

 

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Ben Eagle
Sent: Thursday, February 08, 2007 8:54 AM
To: perl-unix-users@listserv.ActiveState.com
Subject: [Perl-unix-users] Perl module stopping script from running??

I am using a developed module called per ChartDirector, which creates
png charts I use to add to a pdf file.

 

The pdf was not being created, and I found out that when I add 'use
perchartdirector;' the script bombs but only from the browser, in the
shell prompt it runs just fine, this is a problem since the script is
suppose to be ran from the browser. 

 

The server is Solaris, running apache under tomcat (I didn't set it up).
Now I know on another linux server and my windows server the program
runs fine, but kinda wondering why it stops running when called from the
browser, could it be because its under SSL?

___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

[Perl-unix-users] Parameters in Sessions?

2007-08-01 Thread Ben Eagle

I am trying to save parameters being passed from Flash, Flash is sending
parameters using GET and there are too many to send all of them so I
must split them into 3 different GET. so I am using perl and
CGI::Session to save the parameters, and then loading back up and saving
all of the parameters to a Hash. I can't seem to get it to properly
work, I am not really familure with sessions, so I have been reading up
on them, yet still not proficient.

I am using flash projector file so POST is not permitted as a security
precaution (adobe)

well I got the parameters being passed to save in the session but I am
having difficulty loading the parameters up again and pushing the loaded
parameters to the new parameters passed in a hash, not sure if I am
totally getting the concept.

I can save the parameter to the session file just fine, but when I try
and load them up it won't load the old parameters. Then I try to add the
new parameters passed to the saved session and it doesn't add the new
values to the old values like I am needing,

Any Ideas?

use CGI;
use CGI::Session;
use strict;

my $q = new CGI;
print $q->header( "text/html" );

my %valueHash;
my %newHash;
GrabParams();   
my $session;

if ($valueHash{"sessPass"} == 1) {
$session = new CGI::Session(undef, undef,
{Directory=>'tmp/sessions'}) or die CGI::Session->errstr;
printf("SessionID: %s ", $session->id );
}else{
$session = new CGI::Session($valueHash{"session"}) or die
CGI::Session->errstr;

#$session->param('valueHash', \%valueHash);

while (my($k, $v) = each($session->param("valueHash"))) {
$newHash{$k} = $v;
printf("key: %s value: %s", $k, $v);
}

}
foreach my $name (keys(%newHash)) {
foreach my $value ($newHash{$name}) {
$valueHash{$name} = $value;
}
}

foreach(%valueHash){
printf (" %s ", $_);
}

$session->param('valueHash', \%valueHash);
#printf("hash: %s", %{$session->param("valueHash")});

sub GrabParams{
my ( $paramName, $paramValue);
foreach $paramName ($q->param) {
foreach $paramValue ($q->param( $paramName )) {
 $valueHash{ $paramName } =  pack 'U0A*',
$paramValue;
}   
}   
}
___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[Perl-unix-users] Parse CSS in perl?

2008-01-27 Thread Ben Eagle

Whats the best way to parse CSS,
I am trying to make a Perl form that will allow users to edit a current CSS file

I looked at the CSS module on CPAN but the document tation is vague, 
does aqny one have an example of this??

Thanks
Ben
<>___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: [Perl-unix-users] Parse CSS in perl?

2008-01-28 Thread Ben Eagle
Bill,

That deffently would be a option for more advanced users but I was
trying to make it some what easier for the beginner.
I made a form that passes all the values to a Perl script and the Perl
script places the values in a css string and then prints it into a css
file.

But with that I need to find out how to get the values from the css to
re-populate the form.

Any Ideas?
___
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs