Permalink
Browse files

Updated to make a pdf template

  • Loading branch information...
1 parent 7b7e22d commit 5e536403db8b6d2d44272baccc6aad186098f39a @kthakore committed Mar 6, 2011
@@ -35,6 +35,7 @@ requires 'DateTime::Format::DateParse';
requires 'Catalyst::View::TT';
requires 'FCGI';
requires 'FCGI::ProcManager';
+requires 'Catalyst::Helper::View::PDF::Reuse';
requires
'Config::General'; # This should reflect the config file format you've chosen
@@ -54,6 +54,11 @@ __PACKAGE__->config->{'Plugin::Authentication'} = {
},
};
+# Configure the PDF::Reuse
+__PACKAGE__->config('View::PDF::Reuse' => {
+ INCLUDE_PATH => __PACKAGE__->path_to('root', 'templates')
+});
+
# Start the application
__PACKAGE__->setup();
@@ -75,6 +75,14 @@ sub base : Chained('/') PathPart('meeting') CaptureArgs(1) {
}
+sub pdf : Chained('base') :PathPart('pdf') :Args(0) {
+ my( $self, $c ) = @_;
+
+ $c->stash->{pdf_template} = 'hello_pdf.tt';
+ $c->forward('View::PDF::Reuse');
+
+}
+
sub cancel : Chained('base') :PathPart('cancel') :Args(0) {
my( $self, $c ) = @_;
@@ -0,0 +1,29 @@
+package SIMS::View::PDF::Reuse;
+
+use strict;
+use base 'Catalyst::View::PDF::Reuse';
+
+=head1 NAME
+
+SIMS::View::PDF::Reuse - PDF::Reuse View for SIMS
+
+=head1 DESCRIPTION
+
+PDF::Reuse View for SIMS.
+
+=head1 AUTHOR
+
+Kartik Thakore,,,
+
+=head1 SEE ALSO
+
+L<SIMS>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
@@ -35,6 +35,7 @@ function edit_comment( id, comment_input, submit_input)
<h1>Update Meeting Settings </h1>
<h3><a href="[% c.uri_for('/meeting') %]/[% meeting.id %]/cancel" > Cancel Meeting </a></h3>
+<h4><a href="[% c.uri_for('/meeting') %]/[% meeting.id %]/pdf" > Print PDF Copy of Meeting </a></h4>
<form method="post" action="[%c.uri_for('/meeting/') %][% meeting.id %]/update" >
<label>Meeting Date</label>
<input type="text" name="meeting_date" class="datetimeinput" value="[% meeting.datetime.mdy('/') %] [% meeting.datetime.hms() %]"><br />
@@ -0,0 +1,15 @@
+ [% pdf.prFont('Helvetica-Bold') %]
+ [% pdf.prFontSize(20) %]
+ [% pdf.prText(100,1010,'Meeting Report') %]
+ [% pdf.prFont('Helvetica') %]
+ [% pdf.prFontSize(10) %]
+ [% pdf.prText(100,1020,'Meeting Description') %]
+
+ [% y = 500 %]
+ [% FOREACH item IN advisors %]
+ [% pdf.prText(100,y,'test') %]
+ [% y = y - 13 %]
+ [% END %]
+
+
+ [% pdf.prEnd() %]
Binary file not shown.
@@ -0,0 +1,8 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::More;
+
+BEGIN { use_ok 'SIMS::View::PDF::Reuse' }
+
+done_testing();

0 comments on commit 5e53640

Please sign in to comment.