debian/0000755000000000000000000000000011744320650007170 5ustar debian/control0000644000000000000000000000277411744241624010610 0ustar Source: pod2pdf Section: perl Priority: optional Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl (>= 5.6.0-12), perl-modules, libpdf-api2-perl (>= 0.6), libgetopt-argvfile-perl Maintainer: Guo Yixuan Standards-Version: 3.9.3 Homepage: http://search.cpan.org/dist/pod2pdf/ Vcs-Browser: http://svn.debian.org/wsvn/pkg-escience/pod2pdf/trunk/ Vcs-Svn: svn://svn.debian.org/svn/pkg-escience/pod2pdf/trunk/ Package: pod2pdf Architecture: all Depends: ${perl:Depends}, ${misc:Depends}, perl-modules, libpdf-api2-perl (>= 0.6), libgetopt-argvfile-perl Recommends: libimage-size-perl, libfile-type-perl Provides: libpod2pdf-perl Description: Plain Old Documentation to Portable Document Format converter POD allows for the documentation of Perl code. But with a few tricks, e.g., when disguised as comments, it is applicable to many other languages, too. It resembles HTML in the way that it allows for the structured representation of text. Hence, it looks rather good when converted for printers, HTML or man pages. . This package represents more than a mere alternative to pod2man|groff -man to achieve a coversion from POD to PostScript and from there via ps2pdf to PDF. Its major advantage lies in the inclusion of images for the documentation. This renders POD suitable for many smallish projects as a lingua franca for their documentation - associated with the source and separate documents - so texts (and graphics) can be shared more easily between documenters and programmers. debian/copyright0000644000000000000000000000215411744241624011130 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pod2pdf Upstream-Contact: Jon Allen (JJ) Source: http://search.cpan.org/dist/pod2pdf/ Files: * Copyright: 2007, Jon Allen (JJ) License: Artistic-2.0 Files: debian/* Copyright: 2009-2010, Steffen Moeller 2012, Guo Yixuan License: Artistic-2.0 or GPL-3+ License: Artistic-2.0 This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. On Debian GNU/Linux systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic' License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-3' debian/changelog0000644000000000000000000000203211744241624011042 0ustar pod2pdf (0.42-4) unstable; urgency=low * Update debian/copyright. * Bump policy to 3.9.3 (no change needed). * Bump debhelper to 8. * Update tags in debian/patches. * Allow float point number in options: --page-width, --page-height, --left-margin, --right-margin, --top-margin, --bottom-margin, and --margins. * Fixed the overlapped text bug. * Add an option: --outlines (Closes: #651256). -- Guo Yixuan Fri, 20 Apr 2012 11:09:18 +0800 pod2pdf (0.42-3) unstable; urgency=low * New Maintainer * Fixed PDF Producer info * Changed pod2pdf's manpage extension to .1p -- Guo Yixuan Fri, 24 Feb 2012 17:07:43 +0800 pod2pdf (0.42-2) unstable; urgency=low * Documentation fixes (Closes: #541076). * Timestamp in ISO format (Closes: #550265) -- Steffen Moeller Sun, 12 Sep 2010 17:25:16 +0200 pod2pdf (0.42-1) unstable; urgency=low * Initial Release (Closes: #536695). -- Steffen Moeller Sun, 12 Jul 2009 15:49:19 +0200 debian/compat0000644000000000000000000000000211744241624010371 0ustar 8 debian/watch0000644000000000000000000000015311731625311010216 0ustar version=3 http://search.cpan.org/dist/pod2pdf/ .*/pod2pdf-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ debian/patches/0000755000000000000000000000000011744320650010617 5ustar debian/patches/overlapping-text.patch0000644000000000000000000000175011744241624015156 0ustar Description: Fix for overlapping text When the last word in a text paragraph occur on a new page, it will overlap with the next paragraph. (This usually happens when the page size is small.) . Reason: When $word is the last word in a paragraph, in $self->print_word($word), newline() called linefeed(), then formfeed(), and formfeed() resets print_flag. Then {x,y}-position are not changed until the first word in the next paragraph, so it overlaps with previous word. Author: Guo Yixuan Bug: https://rt.cpan.org/Public/Bug/Display.html?id=76631 --- a/lib/App/pod2pdf.pm +++ b/lib/App/pod2pdf.pm @@ -1039,6 +1039,7 @@ $self->{text_size}, $word, -color => $self->{text_color}); + $self->set_print_flag; if ($self->{x_position} > $self->{page_width} - $self->{right_margin}) { $self->newline; } debian/patches/fix-producer-version.patch0000644000000000000000000000102211744241624015730 0ustar Description: Fix to report correct version This fix will fix the "Producer: App::pod2pdf version unknown" bug. Bug: https://rt.cpan.org/Public/Bug/Display.html?id=73182 Author: Guo Yixuan Last-Update: 2012-04-11 --- a/lib/App/pod2pdf.pm +++ b/lib/App/pod2pdf.pm @@ -422,7 +422,7 @@ sub create_pdf { my $self = shift; my $class = ref $self; - my $version = $::{$class.'::'}{VERSION} ? ${ $::{$class.'::'}{VERSION} } : 'unknown'; + my $version = $self->VERSION(); # Define styles # debian/patches/series0000644000000000000000000000017511744241624012042 0ustar timestamp.patch fix-producer-version.patch manpage-section.patch allow-float.patch overlapping-text.patch add-outlines.patch debian/patches/add-outlines.patch0000644000000000000000000000663111744241624014241 0ustar Description: New feature to add outlines An option (--outlines) to enable adding outlines in pdf. Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=73149 Author: Guo Yixuan Bug-Debian: http://bugs.debian.org/651256 --- a/bin/pod2pdf +++ b/bin/pod2pdf @@ -81,6 +81,7 @@ 'icon-scale' => '=s', 'timestamp' => '!', 'output-file' => '=s', + 'outlines' => '!', ); my %config; @@ -220,6 +221,10 @@ Sets an optional footer text string that will be included in the bottom left corner of each page. +=item C<--outlines> + +Adds outlines (bookmarks) to pdf according to headings (=head1, =head2, ...). + =item C<--version> Prints version number and exits. --- a/lib/App/pod2pdf.pm +++ b/lib/App/pod2pdf.pm @@ -83,6 +83,8 @@ } else { $self->{y_position} -= ($heading_space - $default_space); } + # add an outline at the heading's position + $self->generate_outline($expansion, $command, $self->{page_number}, $self->{x_position}, $self->{y_position} + $heading_space) if $self->{outlines}; $self->print_text_with_style($expansion,$command); $self->spacer; $self->indent(48); @@ -492,6 +494,9 @@ $self->{pdf} = PDF::API2->new; $self->{pdf}->info('Producer'=>"$class version $version"); $self->{pdf}->mediabox($self->{page_width},$self->{page_height}); + + # push the root Outlines object into outline_stack + push @{$self->{outline_stack}}, $self->{pdf}->outlines() if $self->{outlines}; if ($self->{icon} && $self->images) { if (-e $self->{icon}) { @@ -925,6 +930,61 @@ #----------------------------------------------------------------------- + +# Outline method +# +# On encountering a heading, generate_outline($text, $style, $page, $x, $y) +# is called, which use $style to determine depth in outline tree. +# $self->{outline_stack} is used to record the structure of PDF Outlines. + +#----------------------------------------------------------------------- + +sub generate_outline { + my $self = shift; + my $text = shift; + $text =~ s/\s*$//; # remove trailing newlines and spaces + + my $style = shift; + + my $page = shift; #$self->{page_number}; + my $pdfpage = $self->{pdf}->openpage($page); + + my $x = shift; + my $y = shift; + + my %level = ( + 'head1' => 1, + 'head2' => 2, + 'head3' => 3, + 'head4' => 4, + ); + my $level = $level{$style}; + my $up_level = $level - 1; + my $cur_level = scalar @{$self->{outline_stack}} - 1; + + # finding the right place to insert new outline + while ($cur_level < $up_level) { + my $tail = $self->{outline_stack}[-1]; + push @{$self->{outline_stack}}, $tail->outline(); + $cur_level ++; + } + while ($cur_level > $up_level) { + pop @{$self->{outline_stack}}; + $cur_level --; + } + my $tail = $self->{outline_stack}[-1]; + + # create a new sub-outline, setting title and dest + my $outline = $tail->outline(); + $outline->title($text); + # $outline->dest($pdfpage); + # $outline->dest($pdfpage, "-xyz" => [$self->{x_position}, $self->{y_position}, 0]); + $outline->dest($pdfpage, "-xyz" => [$x, $y, 0]); + + push @{$self->{outline_stack}}, $outline; +} + +#----------------------------------------------------------------------- #----------------------------------------------------------------------- # PDF file output debian/patches/manpage-section.patch0000644000000000000000000000071111744241624014714 0ustar Description: Change pod2pdf's manpage extension to .1p Author: Guo Yixuan Last-Update: 2012-04-11 --- a/Makefile.PL +++ b/Makefile.PL @@ -31,7 +31,7 @@ 'Pod::Escapes' => 0, 'Getopt::ArgvFile' => 0 }, 'MAN1PODS' => { - 'bin/pod2pdf' => "\$(INST_MAN1DIR)/pod2pdf.1", + 'bin/pod2pdf' => "\$(INST_MAN1DIR)/pod2pdf.1p", }, clean => { FILES => "*.bak pod2pdf-*" }, debian/patches/timestamp.patch0000644000000000000000000000373711744241624013660 0ustar Description: Corrects the option --timestamp to use ISO 8601 For the printout of the timestamp not as the Perl-typical localtime but in an ISO 8601 format. ISO 8601 is a standard for dates and times which is suitable (agnostic; only numbers) for international use. . Note: although the upstream tracker list this bug as fixed in 0.42, this patch is not applied. Forwarded: https://rt.cpan.org/Ticket/Display.html?id=50342 Author: Jari Aalto Bug-Debian: http://bugs.debian.org/550265 Last-Update: 2012-04-11 Index: pod2pdf-0.42/bin/pod2pdf =================================================================== --- pod2pdf-0.42.orig/bin/pod2pdf 2010-09-12 17:52:40.696502868 +0200 +++ pod2pdf-0.42/bin/pod2pdf 2010-09-12 17:52:56.936477300 +0200 @@ -46,6 +46,21 @@ # in @ARGV with the contents of the specified file) + +#-------------------------------------------------------------------------- + +sub dateISO8601 ($) { + my ($timeval) = shift || time; + + warn "time: $timeval"; + + my ($yyyy, $MM, $dd, $hh, $mm) = (localtime $timeval)[5, 4, 3, 2, 1]; + $yyyy += 1900; + $MM++; + + sprintf "$yyyy-%02d-%02d %02d:%02d", $MM, $dd, $hh, $mm; +} + #--Parse command-line options---------------------------------------------- my %options = ( @@ -74,9 +89,11 @@ version => sub{ print "This is pod2pdf, version $App::pod2pdf::VERSION\n"; exit } ) or die("[Error] Could not parse options"); -$config{title} = (@ARGV) ? $ARGV[0] : 'STDIN' unless (exists $config{title}); -$config{title} .= (' - ' . ((@ARGV) ? scalar localtime($^T - (-M $ARGV[0])*24*60*60) : scalar localtime)) if (exists $config{timestamp}); +my $file = $ARGV[0]; +my $time = $file ? $^T - (-M $file) * 24 * 60 * 60 : time; +$config{title} = $file ? $file : 'STDIN' unless exists $config{title}; +$config{title} .= ' - ' . dateISO8601 $time if exists $config{timestamp}; #--Set output location----------------------------------------------------- debian/patches/allow-float.patch0000644000000000000000000000206011744241624014062 0ustar Description: Allow float point number in options These options are affected: --page-width, --page-height, --left-margin, --right-margin, --top-margin, --bottom-margin, and --margins. . They used to only allow integer as parameter. Author: Guo Yixuan Bug: https://rt.cpan.org/Public/Bug/Display.html?id=76624 --- a/bin/pod2pdf +++ b/bin/pod2pdf @@ -64,15 +64,15 @@ #--Parse command-line options---------------------------------------------- my %options = ( - 'page-height' => '=i', - 'page-width' => '=i', + 'page-height' => '=f', + 'page-width' => '=f', 'page-size' => '=s', 'page-orientation' => '=s', - 'margins' => '=i', - 'left-margin' => '=i', - 'right-margin' => '=i', - 'top-margin' => '=i', - 'bottom-margin' => '=i', + 'margins' => '=f', + 'left-margin' => '=f', + 'right-margin' => '=f', + 'top-margin' => '=f', + 'bottom-margin' => '=f', 'header' => '!', 'footer' => '!', 'title' => '=s', debian/README.Debian0000644000000000000000000000064711731625311011236 0ustar pod2pdf for Debian ================== The README file mentions Paper::Specs which is not yet available for Debian. It would be lovely if someone could address the respective packaging work. dh-make-perl suggests the package to be named libpod2pdf-perl, but since the package will mostly be used as a binary, I have decided against that convention. Steffen Moeller Sun, 12 Jul 2009 16:13:58 +0200 debian/rules0000755000000000000000000000003611731625311010245 0ustar #!/usr/bin/make -f %: dh $@ debian/source/0000755000000000000000000000000011744320650010470 5ustar debian/source/format0000644000000000000000000000001411731625310011673 0ustar 3.0 (quilt)