diff --git a/.gitignore b/.gitignore index 9c73ab18..4e7e3810 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,9 @@ src/remind src/version.h tests/test.out www/Makefile +rem2pdf/Makefile.PL +MYMETA.json +MYMETA.yml +Makefile +blib/ +pm_to_blib diff --git a/configure b/configure index ecc72b32..e5811077 100755 --- a/configure +++ b/configure @@ -4005,7 +4005,7 @@ done VERSION=03.03.12 -ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile" +ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -4702,6 +4702,7 @@ do "www/Makefile") CONFIG_FILES="$CONFIG_FILES www/Makefile" ;; "src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;; "rem2html/Makefile") CONFIG_FILES="$CONFIG_FILES rem2html/Makefile" ;; + "rem2pdf/Makefile.PL") CONFIG_FILES="$CONFIG_FILES rem2pdf/Makefile.PL" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.in b/configure.in index ddd8db28..74ada7aa 100644 --- a/configure.in +++ b/configure.in @@ -49,4 +49,4 @@ AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups) VERSION=03.03.12 AC_SUBST(VERSION) AC_SUBST(PERL) -AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile) +AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL) diff --git a/rem2pdf/Makefile.PL.in b/rem2pdf/Makefile.PL.in new file mode 100644 index 00000000..4d535371 --- /dev/null +++ b/rem2pdf/Makefile.PL.in @@ -0,0 +1,12 @@ +use ExtUtils::MakeMaker; +WriteMakefile( + NAME => 'Remind::PDF', + AUTHOR => q{Dianne Skoll }, + VERSION => '@VERSION@', + PREREQ_PM => { + 'Getopt::Long' => 0, + 'Cairo' => 0, + 'Pango' => 0, + }, + EXE_FILES => [ 'bin/rem2pdf' ] + ); diff --git a/rem2pdf/bin/rem2pdf b/rem2pdf/bin/rem2pdf new file mode 100755 index 00000000..402145a2 --- /dev/null +++ b/rem2pdf/bin/rem2pdf @@ -0,0 +1,76 @@ +#!/bin/env perl +use strict; +use warnings; + +use Encode; +use Cairo; +use Pango; + +use Getopt::Long; + +my $media_to_size = { + "Letter" => [ 612, 792], + "Tabloid" => [ 792, 1224], + "Ledger" => [1224, 792], + "Legal" => [ 612, 1008], + "Statement" => [ 396, 612], + "Executive" => [ 540, 720], + "A3" => [ 842, 1190], + "A4" => [ 595, 842], + "A5" => [ 420, 595], + "B4" => [ 729, 1032], + "B5" => [ 519, 729], + "Folio" => [ 612, 936], + "Quarto" => [ 612, 780], + "10x14" => [ 720, 1008], +}; + +my $landscape = 0; +my $numbers_on_left = 0; +my $small_calendars = 0; +my $fill_entire_page = 0; + +my $media = 'Letter'; + +my $title_font = 'Sans 14'; +my $small_cal_font = 'Sans'; +my $header_font = 'Sans 14'; +my $entry_font = 'Sans 8'; +my $daynum_font = 'Sans Bold Oblique 14'; + +my $border_size = 6; +my $line_thickness = 1; + +my $margin_top = 36; +my $margin_bottom = 36; +my $margin_left = 36; +my $margin_right = 36; + +sub read_one_month +{ +} + +__END__ + +my $surface = Cairo::PdfSurface->create('/tmp/x.pdf', 612, 792); + +my $cr = Cairo::Context->create($surface); + +$cr->set_line_width($line_thickness); +for (my $x=36; $x < 612-36; $x += 72) { + $cr->move_to($x, 0); + $cr->line_to($x, 792); + $cr->stroke; +} + +$cr->set_source_rgb(0,0.5,0); +$cr->arc(612/2, 792/2, 36, 0, 2*3.1415926535); +$cr->stroke_preserve; +$cr->fill; +$cr->move_to(612/2, 792/2); +$cr->set_source_rgb(0,0,0); +$cr->set_font_size(36); +$cr->show_text(Encode::decode('UTF-8', "מֵם סוֹפִית‎çédo")); + +$surface->finish(); + diff --git a/rem2pdf/lib/Remind/PDF.pm b/rem2pdf/lib/Remind/PDF.pm new file mode 100644 index 00000000..e69de29b