[libpdf-create-perl] 01/07: Imported Upstream version 1.08
gregor herrmann
gregoa at debian.org
Mon Dec 16 18:43:51 UTC 2013
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libpdf-create-perl.
commit ac08ce8e4db8e768e4beb4bff8774329af2ce1b6
Author: gregor herrmann <gregoa at debian.org>
Date: Mon Dec 16 19:31:22 2013 +0100
Imported Upstream version 1.08
---
Build.PL | 14 --
CHANGES | 92 ++++++---
Changes | 413 --------------------------------------
MANIFEST | 13 +-
MANIFEST.SKIP | 2 +-
META.json | 48 +++++
META.yml | 36 +++-
Makefile.PL | 16 +-
sample-cgi.pl => eg/sample-cgi.pl | 0
sample.pl => eg/sample.pl | 0
lib/PDF/Create.pm | 51 +++--
lib/PDF/Create/Outline.pm | 13 +-
lib/PDF/Create/Page.pm | 17 +-
lib/PDF/Image/GIF.pm | 13 +-
lib/PDF/Image/JPEG.pm | 13 +-
t/01-basic.t | 7 +-
t/02-string.t | 2 +-
t/03-image.t | 2 +-
t/04-drawing.t | 2 +-
t/05-outline.t | 2 +-
t/06-annotation.t | 2 +-
t/07-fonts.t | 2 +-
t/09-cgi-script.pl | 2 +-
t/09-cgi.t | 15 +-
t/11-encode.t | 121 +++++++++++
t/50-versioning.t | 23 +++
t/99-wifi-parabola.t | 2 +-
27 files changed, 382 insertions(+), 541 deletions(-)
diff --git a/Build.PL b/Build.PL
deleted file mode 100644
index 61df1b0..0000000
--- a/Build.PL
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Build.PL for PDF::Create
-#
-use Module::Build;
-
-my $build = Module::Build->new(
- module_name => 'PDF::Create',
- license => 'perl',
- requires => {
- 'perl' => '5.5.0',
- },
- );
-
-$build->create_build_script;
diff --git a/CHANGES b/CHANGES
index 5ba9702..08542d4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,30 +1,66 @@
-Further changes are documented in the 'Changes' file
-
-Version 0.09 30.9.2007
-- Markus Baertschi, markus at markus.org
- Added stringml for multi-line strings
- Changed get_page_size to case-independent
-
-Version 0.08 3.9.2007
-- Markus Baertschi, markus at markus.org
- Get back in sync with CPAN/PAUSE
- Fixed check for open file in Create.pm
- Touched up the README
-
-Version 0.07
-- Markus Baertschi, markus at markus.org
- Added image samples to sample.pl
- Touched up the README
- Added check for open file in JPEG/GIFImages
-
-Version 0.06
-- Fabien Tassin
- Added support for JPEG and GIF images
-- Markus Baertschi, markus at markus.org
- Packaged for release on CPAN
-
-Version 0.01
-- Fabien Tassin
- Original Release
+1.08 2013.12.11
+
+ Eliminate pipe from CGI test script t/09
+ Filehandle => FileHandle typo fixed #91312
+
+1.07 2013.12.10
+
+ New maintainer SZABGAB
+ Tried to reconstruct entries in the CHANGES file
+ Some more test case
+ Code clean-up (remove indirect calls)
+ Remove Build.PL
+ use warnings;
+ Officially require perl 5.006.
+ Move example file to the eg/ directory
+
+1.06 2010.07.06
+
+1.05 2010.02.26
+
+1.04 2009.07.13
+
+1.03 200 2009.03.24
+
+1.02 208.07.10
+
+1.01 2008.06.03
+
+1.00 2008.05.31
+
+0.10 2008.05.31
+
+
+0.09 2007.09.30
+
+ - Markus Baertschi, markus at markus.org
+ - Added stringml for multi-line strings
+ - Changed get_page_size to case-independent
+
+0.08 2007.09.03
+
+ - Markus Baertschi, markus at markus.org
+ - Get back in sync with CPAN/PAUSE
+ - Fixed check for open file in Create.pm
+ - Touched up the README
+
+0.07
+
+ - Markus Baertschi, markus at markus.org
+ - Added image samples to sample.pl
+ - Touched up the README
+ - Added check for open file in JPEG/GIFImages
+
+0.06
+
+ - Fabien Tassin
+ - Added support for JPEG and GIF images
+ - Markus Baertschi, markus at markus.org
+ - Packaged for release on CPAN
+
+0.01
+
+ - Fabien Tassin
+ - Original Release
diff --git a/Changes b/Changes
deleted file mode 100644
index e6b9c50..0000000
--- a/Changes
+++ /dev/null
@@ -1,413 +0,0 @@
-commit 61da9f7... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 16:04:19 2010 +0200
-
- Updated version number
-
-commit e127e19... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 16:04:05 2010 +0200
-
- Updated Howto
-
-commit 8b24c54... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 16:03:49 2010 +0200
-
- Fixed Makefile and MANIFEST for Build.PL
-
-commit 41a6ce3... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 16:02:46 2010 +0200
-
- Added Build.PL
-
-commit d312b0f... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 15:26:13 2010 +0200
-
- Save locale in Page-image (rt.perl.org bug #57340)
-
-commit 281c452... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 14:20:50 2010 +0200
-
- Made this test windows-compatible (rt.perl.org bug #55505)
-
-commit 3a95266... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 12:06:58 2010 +0200
-
- Add prerequisite for perl 5.005 (rt bug #55198)
-
-commit 720a622... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 12:06:00 2010 +0200
-
- Fix typo
-
-commit 964e35a... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jul 6 11:04:51 2010 +0200
-
- File permissions changed
-
-commit 6364179... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Mar 4 13:47:00 2010 +0100
-
- Fixed POD (rt bug #55184)
-
-commit df8dc6d... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Wed Mar 3 13:21:59 2010 +0100
-
- Test-script cleanup, proper use of ok() with pdftotext
-
-commit 9aa1e84... PDF::Create 1.06
-Author: Markus Baertschi <markus at markus.org>
-Date: Wed Mar 3 12:54:46 2010 +0100
-
- Run the cgi with the correct perl from $Config{perlpath}.
-
-commit 24af861... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Feb 26 00:36:23 2010 +0100
-
- Fixed some typos in the POD
-
-commit 107e555... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Feb 26 00:35:54 2010 +0100
-
- Fixed the usage of the test suite (skip was used wrongly).
-
-commit 4e986bf... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Feb 25 15:21:31 2010 +0100
-
- Version 1.05\nAdded t/10-versionig.t\nFix to Changes.PL
-
-commit 6d00812... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Feb 25 15:20:21 2010 +0100
-
- Even more POD additions
-
-commit f839573... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Feb 25 12:19:54 2010 +0100
-
- Changed version number to 1.05
-
-commit 5792675... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Feb 25 11:43:45 2010 +0100
-
- Fixed minor Perl::Critic issues
-
-commit 958de17... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Feb 25 01:11:33 2010 +0100
-
- Image scaling bug, patch by Simon Green <simon at simongreen.name>
-
- I have noticed one bug with the software though. If you
- are scaling an image, and are centering it, it calculates the the bottom
- left based on the original image size, not the scaled size. Attached is a
- patch (against 1.03) that fixes this.
-
-commit 0f3540e... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Feb 25 01:05:58 2010 +0100
-
- more POD fixes and comments
-
-commit 222bfd1... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Feb 23 23:04:54 2010 +0100
-
- PerlTidy, Fixed comments and POD
-
-commit d4c4ad8... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Feb 23 23:04:26 2010 +0100
-
- PerlTidy, Fixed comments and POD
-
-commit 4ea632b... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Feb 23 01:17:43 2010 +0100
-
- Fixed formatting (perltidy) and updated POD documentation
-
-commit caee422... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Mon Feb 22 19:54:11 2010 +0100
-
- git in eclipe is a mess
-
-commit 25a483a... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Mon Feb 22 19:29:26 2010 +0100
-
- Added new test scripts
-
-commit 50d6a96... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Mon Feb 22 19:28:50 2010 +0100
-
- Added experimental 'text' function
-
-commit a911de2... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Mon Feb 22 19:26:37 2010 +0100
-
- Added Gary's annotation fonction and related stuff (string_underline).
- Cleaned up test files, grouped by topic, uses Test::More
-
-commit 5f0f957... PDF::Create 1.05
-Author: markus <markus at T60>
-Date: Sun Feb 21 17:38:20 2010 +0100
-
- Cosmetic and toolchain mods.
- As sent to Gary
-
-commit 5cdb49b... PDF::Create 1.05
-Author: markus <markus at markus.org>
-Date: Sun Feb 21 00:25:46 2010 +0100
-
- Fixed debug() stuff
- Removed history from comments
- General cleanup
-
-commit c9a8312... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Jan 21 01:07:22 2010 +0100
-
- fixed corrupt xref
-
-commit 2fdf959... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Jan 21 00:23:53 2010 +0100
-
- Improved debugging, Initial version of annotations
-
-commit c489e84... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Jan 21 00:18:50 2010 +0100
-
- Set version to 'perl' for Fedora
-
-commit f77d116... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Sun Nov 1 23:38:49 2009 +0100
-
- Fix the MANIFEST file with all test updates
-
-commit 6c147dc... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Sun Nov 1 23:29:28 2009 +0100
-
- Fixed Changes.PL
-
-commit 6825c1e... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Oct 30 19:22:52 2009 +0100
-
- Cleanup test files
- Add 'real' test using 'pdftotext'
- Add a cgi-script test/example
-
-commit aeaa1e1... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Wed Aug 5 20:16:47 2009 +0200
-
- Changing version number
-
-commit bac6875... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Mon Jul 13 21:50:16 2009 +0200
-
- Some more test cleanup (eliminate warnings, remove test 7)
-
-commit 42333d1... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Apr 24 23:41:39 2009 +0200
-
- Fix and unify test samples (generate pdf name from script name).
-
- Add new sample 'parabola.t', to show how to generate graphices.
-
-commit 77de8c0... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Apr 24 23:32:56 2009 +0200
-
- Improve doc and error message for unsupported gif images.
-
-commit a04d34d... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Apr 24 23:26:25 2009 +0200
-
- Add new sample featuring font color and drawing/writing on images.
-
-commit 7d79e9e... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Mar 27 13:29:35 2009 +0100
-
- Improved git detection in Changes.PL by Philippe Audéoud
-
-commit 24a1ee0... PDF::Create 1.05
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Mar 26 17:20:48 2009 +0100
-
- Hacked Changes.PL to skip out in a non-obstrusive way if git is not found or the git environment is not right.
-
-commit d2f238a... PDF::Create v1.03
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Mar 24 00:52:31 2009 +0100
-
- Fix: Missing % in line 93, reported by Dan Carson.
-
-commit d6b21d3... PDF::Create v1.03
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri Jul 11 00:01:10 2008 +0200
-
- Updated Changelog generation to add version information.
- The version information is coming from tags. New version = tag.
-
-commit 87b3f1b... PDF::Create v1.02
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu Jul 10 22:36:02 2008 +0200
-
- Fixed gif image processing on big-endian machines.
- Thanks to Neil Watkiss <neil.watkiss at gmail.com> for the patch.
- Published as Version 1.02.
-
-commit 886ea2e... PDF::Create v1.01
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jun 3 12:43:41 2008 +0200
-
- Renamed Image modules to fix bug 28636 (rt.cpan.org).
-
-commit 7acfe62... PDF::Create v1.01
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue Jun 3 10:53:56 2008 +0200
-
- Updates Michael's email, added reference to git repository at github
-
-commit e52ef1f... PDF::Create v1.01
-Merge: 88fad3e 875425d
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 19:26:23 2008 +0200
-
- Merge branch 'master' of git://github.com/markusb/pdf-create
-
-commit 88fad3e... PDF::Create v1.01
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 19:20:33 2008 +0200
-
- Updated version to 1.0 to fit better with PDF::Create and show maturity
-
-commit ccf26de... PDF::Create v1.01
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 19:18:35 2008 +0200
-
- Updated build system to generate Changes file directly from git log
-
-commit 28b0922... PDF::Create v1.0
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 12:49:32 2008 +0200
-
- Version 1.0
-
-commit 875425d... PDF::Create v1.01
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 12:49:32 2008 +0200
-
- Version 1.0
-
-commit 9adbcbf... PDF::Create v1.0
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 12:05:17 2008 +0200
-
- More POD fixing
-
-commit 6f7ba3f... PDF::Create v0.10
-Author: Markus Baertschi <markus at markus.org>
-Date: Sat May 31 11:23:50 2008 +0200
-
- Version 0.10
-
-commit f9e1656... PDF::Create v0.10
-Author: Markus Baertschi <markus at markus.org>
-Date: Fri May 30 09:00:53 2008 +0200
-
- Clarified documentation
-
-commit da76efc... PDF::Create v0.10
-Author: Markus Baertschi <markus at markus.org>
-Date: Thu May 29 22:04:07 2008 +0200
-
- Fixed 'Rotate', added debugging
-
-commit e240621... PDF::Create v0.10
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 19:44:21 2008 +0200
-
- Fixed documentation formatting
-
-commit fe3823d... PDF::Create v0.10
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 18:00:13 2008 +0200
-
- Added small cgi sample
-
-commit 87fc07f... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 17:21:57 2008 +0200
-
- Changed version to 0.9
-
-commit 90f37ce... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 17:18:40 2008 +0200
-
- Cleaned up samples and comments
-
-commit 2b50205... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 17:07:10 2008 +0200
-
- Added better testing
-
-commit 48262cc... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 17:03:48 2008 +0200
-
- Improved documentation
-
-commit 3ed3ded... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Tue May 20 17:02:30 2008 +0200
-
- Add error-checking
-
-commit a726f88... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Sun Sep 30 19:00:42 2007 +0200
-
- Re-added pdf-logo files
-
-commit 1490f88... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Sun Sep 30 18:59:04 2007 +0200
-
- New function: printnl (print multiple lines)
- Modified: get_page_size (arguments case-independent)
-
-commit e4d7378... PDF::Create v0.9
-Author: Markus Baertschi <markus at markus.org>
-Date: Mon Sep 3 18:05:29 2007 +0200
-
- Initial import.
diff --git a/MANIFEST b/MANIFEST
index 9c2b117..0483200 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,18 +1,16 @@
CHANGES
-Changes
+eg/sample-cgi.pl
+eg/sample.pl
lib/PDF/Create.pm
lib/PDF/Create/Outline.pm
lib/PDF/Create/Page.pm
lib/PDF/Image/GIF.pm
lib/PDF/Image/JPEG.pm
Makefile.PL
-Build.PL
-MANIFEST
+MANIFEST This list of files
MANIFEST.SKIP
pdf-logo.svg
README
-sample-cgi.pl
-sample.pl
t/01-basic.t
t/02-string.t
t/03-image.t
@@ -22,7 +20,10 @@ t/06-annotation.t
t/07-fonts.t
t/09-cgi-script.pl
t/09-cgi.t
+t/11-encode.t
+t/50-versioning.t
t/99-wifi-parabola.t
t/pdf-logo.gif
t/pdf-logo.jpg
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 5c91536..8e98fb1 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -9,6 +9,6 @@ pm_to_blib
\.pdf$
\.tmp$
^devel/
-^_build/
.git/
^\..*
+^MYMETA.*
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..6cbefee
--- /dev/null
+++ b/META.json
@@ -0,0 +1,48 @@
+{
+ "abstract" : "create PDF files",
+ "author" : [
+ "unknown"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 6.78, CPAN::Meta::Converter version 2.132661",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "PDF-Create",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : "0",
+ "Data::Dumper" : "0",
+ "FileHandle" : "0"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "repository" : {
+ "url" : "http://github.com/szabgab/pdf-create"
+ }
+ },
+ "version" : "1.08"
+}
diff --git a/META.yml b/META.yml
index 9c80229..a9d63f6 100644
--- a/META.yml
+++ b/META.yml
@@ -1,12 +1,26 @@
---- #YAML:1.0
-name: PDF-Create
-version: 1.06
-abstract: create PDF files
-license: perl
-author: ~
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
+---
+abstract: 'create PDF files'
+author:
+ - unknown
+build_requires:
+ ExtUtils::MakeMaker: 0
+configure_requires:
+ ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.78, CPAN::Meta::Converter version 2.132661'
+license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: PDF-Create
+no_index:
+ directory:
+ - t
+ - inc
+requires:
+ Carp: 0
+ Data::Dumper: 0
+ FileHandle: 0
+resources:
+ repository: http://github.com/szabgab/pdf-create
+version: 1.08
diff --git a/Makefile.PL b/Makefile.PL
index 6339a7d..f17591b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,16 +1,24 @@
#
# Makefile.PL for PDF::Create
#
-use 5.005;
+use 5.006;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => "PDF::Create",
VERSION_FROM => "lib/PDF/Create.pm",
-# VERSION => "$version",
ABSTRACT_FROM => "lib/PDF/Create.pm",
+ 'PREREQ_PM' => {
+ 'Carp' => 0,
+ 'FileHandle' => 0,
+ 'Data::Dumper' => 0,
+ },
LICENSE => "perl",
dist => { COMPRESS => "gzip", SUFFIX => "gz" },
clean => { FILES => '*.bak *.old mibs/*.dump *.pdf' . 'lib/*/*~ lib/*/*/*~' },
- PL_FILES => {}, # prevent Build.PL from getting executed
- );
+ META_MERGE => {
+ resources => {
+ repository => 'http://github.com/szabgab/pdf-create',
+ }
+ },
+);
diff --git a/sample-cgi.pl b/eg/sample-cgi.pl
similarity index 100%
rename from sample-cgi.pl
rename to eg/sample-cgi.pl
diff --git a/sample.pl b/eg/sample.pl
similarity index 100%
rename from sample.pl
rename to eg/sample.pl
diff --git a/lib/PDF/Create.pm b/lib/PDF/Create.pm
old mode 100644
new mode 100755
index 9d1e11d..46f8e33
--- a/lib/PDF/Create.pm
+++ b/lib/PDF/Create.pm
@@ -12,8 +12,9 @@
#
package PDF::Create;
-
use strict;
+use warnings;
+
use Carp qw(confess croak cluck carp);
use FileHandle;
use PDF::Create::Page;
@@ -21,13 +22,7 @@ use PDF::Create::Outline;
use PDF::Image::GIF;
use PDF::Image::JPEG;
-our ( @ISA, @EXPORT, @EXPORT_OK, @EXPORT_FAIL );
-require Exporter;
- at ISA = qw(Exporter);
- at EXPORT = qw();
- at EXPORT_OK = qw($VERSION);
-
-our $VERSION = "1.06";
+our $VERSION = '1.08';
my $DEBUG = 0;
@@ -46,7 +41,7 @@ sub new
$self->{'version'} = $params{'Version'} || "1.2";
$self->{'trailer'} = {};
- $self->{'pages'} = new PDF::Create::Page();
+ $self->{'pages'} = PDF::Create::Page->new();
$self->{'current_page'} = $self->{'pages'};
$self->{'pages'}->{'pdf'} = $self; # circular reference
$self->{'page_count'} = 0;
@@ -61,7 +56,7 @@ sub new
$self->{'fh'} = $params{'fh'};
} elsif ( defined $params{'filename'} ) {
$self->{'filename'} = $params{'filename'};
- my $fh = new FileHandle "> $self->{'filename'}";
+ my $fh = FileHandle->new( "> $self->{'filename'}" );
carp "PDF::Create.pm: $self->{'filename'}: $!\n" unless defined $fh;
binmode $fh;
$self->{'fh'} = $fh;
@@ -248,12 +243,14 @@ sub encode
$val = "$val";
}
|| $type eq 'string' && do {
+ $val = '' if not defined $val;
$val = "($val)"; # TODO: split it. Quote parentheses.
}
|| $type eq 'number' && do {
$val = "$val";
}
|| $type eq 'name' && do {
+ $val = '' if not defined $val;
$val = "/$val";
}
|| $type eq 'array' && do {
@@ -529,7 +526,7 @@ sub new_outline
my %params = @_;
unless ( defined $self->{'outlines'} ) {
- $self->{'outlines'} = new PDF::Create::Outline();
+ $self->{'outlines'} = PDF::Create::Outline->new();
$self->{'outlines'}->{'pdf'} = $self; # circular reference
$self->{'outlines'}->{'Status'} = 'opened';
}
@@ -1079,13 +1076,17 @@ sub get_data
__END__
+=encoding utf8
+
=head1 NAME
PDF::Create - create PDF files
=head1 SYNOPSIS
-Create PDF output from your perl program using a couple of subroutines to
+C<PDF::Create> provides an easy module to create PDF output from your
+perl programs. It is designed to be easy to use and simple to install and
+maintain. It provides a couple of subroutines to
handle text, fonts, images and drawing primitives. Simple documents are
easy to create with the supplied routines.
@@ -1102,7 +1103,7 @@ Example PDF creation with C<PDF::Create>:
use PDF::Create;
# initialize PDF
- my $pdf = new PDF::Create('filename' => 'mypdf.pdf',
+ my $pdf = PDF::Create->new('filename' => 'mypdf.pdf',
'Author' => 'John Doe',
'Title' => 'Sample PDF',
'CreationDate' => [ localtime ], );
@@ -1120,7 +1121,7 @@ Example PDF creation with C<PDF::Create>:
my $toc = $pdf->new_outline('Title' => 'Title Page', 'Destination' => $page);
# Write some text
- $page->stringc($f2, 40, 306, 426, "PDF::Create");
+ $page->stringc($f1, 40, 306, 426, "PDF::Create");
$page->stringc($f1, 20, 306, 396, "version $PDF::Create::VERSION");
$page->stringc($f1, 20, 306, 300, 'by John Doe <john.doe at example.com>');
@@ -1156,7 +1157,7 @@ Create a new pdf structure for your PDF.
Example:
- my $pdf = new PDF::Create('filename' => 'mypdf.pdf',
+ my $pdf = PDF::Create->new('filename' => 'mypdf.pdf',
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'John Doe',
@@ -1170,8 +1171,11 @@ C<new> returns an object handle used to add more stuff to the PDF.
=item 'filename'
-destination file that will contain the resulting
-PDF or an already opened filehandle or '-' for stdout.
+destination file that will contain the resulting PDF or '-' for stdout.
+
+=item 'fh'
+
+an already opened filehandle that will contain the resulting PDF.
=item 'Version'
@@ -1221,7 +1225,7 @@ CGI Example:
use CGI; use PDF::Create;
print CGI::header( -type => 'application/x-pdf', -attachment => 'sample.pdf' );
- my $pdf = new PDF::Create('filename' => '-', # Stdout
+ my $pdf = PDF::Create->new('filename' => '-', # Stdout
'Author' => 'John Doe',
'Title' => 'My title',
'CreationDate' => [ localtime ],
@@ -1523,6 +1527,11 @@ Set the width of subsequent lines to C<w> points.
Set the color of the subsequent drawing operations.
+Each color ranges from 0.0 to 1.0, that is, darkest red (0.0) to
+brightest red (1.0). The same holds for green and blue. These three
+colors mix additively to produce the colors between black (0.0, 0.0,
+0.0) and white (1.0, 1.0, 1.0).
+
PDF distinguishes between the stroke and fill operations
and provides separate color settings for each.
@@ -1604,6 +1613,12 @@ Parameters can be:
- xskew, yskew: Skew of image.
+Example jpeg image:
+
+ # include a jpeg image with scaling to 20% size
+ my $jpg = $pdf->image("image.jpg");
+ $page->image( 'image' => $jpg, 'xscale' => 0.2, 'yscale' => 0.2, 'xpos' => 350, 'ypos' => 400 );
+
=back
=head1 Limitations
diff --git a/lib/PDF/Create/Outline.pm b/lib/PDF/Create/Outline.pm
index 57ef019..a97cc23 100644
--- a/lib/PDF/Create/Outline.pm
+++ b/lib/PDF/Create/Outline.pm
@@ -14,18 +14,15 @@
#
package PDF::Create::Outline;
-
use strict;
-use vars qw(@ISA @EXPORT $VERSION $DEBUG);
-use Exporter;
+use warnings;
+
use Carp;
use FileHandle;
use Data::Dumper;
- at ISA = qw(Exporter);
- at EXPORT = qw();
-$VERSION = 1.05;
-$DEBUG = 0;
+our $VERSION = '1.08';
+our $DEBUG = 0;
sub new
{
@@ -40,7 +37,7 @@ sub new
sub add
{
my $self = shift;
- my $outline = new PDF::Create::Outline();
+ my $outline = PDF::Create::Outline->new();
$outline->{'id'} = shift;
$outline->{'name'} = shift;
$outline->{'Parent'} = $self;
diff --git a/lib/PDF/Create/Page.pm b/lib/PDF/Create/Page.pm
index f2817e2..7537647 100644
--- a/lib/PDF/Create/Page.pm
+++ b/lib/PDF/Create/Page.pm
@@ -14,19 +14,16 @@
#
package PDF::Create::Page;
-
use strict;
-use vars qw(@ISA @EXPORT $VERSION $DEBUG);
-use Exporter;
+use warnings;
+
use Carp;
use FileHandle;
use Data::Dumper;
use POSIX qw(setlocale LC_NUMERIC);
- at ISA = qw(Exporter);
- at EXPORT = qw();
-$VERSION = 1.05;
-$DEBUG = 0;
+our $VERSION = '1.08';
+our $DEBUG = 0;
my $font_widths = &init_widths;
@@ -46,7 +43,7 @@ sub new
sub add
{
my $self = shift;
- my $page = new PDF::Create::Page();
+ my $page = PDF::Create::Page->new();
$page->{'pdf'} = $self->{'pdf'};
$page->{'Parent'} = $self;
$page->{'id'} = shift;
@@ -419,8 +416,10 @@ sub string_width
my $string = shift;
croak 'No string given' unless defined $string;
-
+
my $fname = $self->{'pdf'}{'fonts'}{$font}{'BaseFont'}[1];
+ croak('Unknown font: ' . $fname) unless defined $$font_widths{$fname}[ ord "M" ];
+
my $w = 0;
for my $c ( split '', $string ) {
$w += $$font_widths{$fname}[ ord $c ];
diff --git a/lib/PDF/Image/GIF.pm b/lib/PDF/Image/GIF.pm
index 31709c2..5107a87 100644
--- a/lib/PDF/Image/GIF.pm
+++ b/lib/PDF/Image/GIF.pm
@@ -14,14 +14,11 @@
package PDF::Image::GIF;
use strict;
-use vars qw(@ISA @EXPORT $VERSION $DEBUG);
-use Exporter;
+use warnings;
use FileHandle;
- at ISA = qw(Exporter);
- at EXPORT = qw();
-$VERSION = 1.05;
-$DEBUG = 0;
+our $VERSION = '1.08';
+our $DEBUG = 0;
sub new
{
@@ -370,7 +367,7 @@ sub Open
my $flags;
$self->{filename} = $filename;
- my $fh = new FileHandle "$filename";
+ my $fh = FileHandle->new("$filename");
if ( !defined $fh ) { $self->{error} = "PDF::Image::GIF.pm: $filename: $!"; return 0 }
binmode $fh;
read $fh, $s, 3;
@@ -484,7 +481,7 @@ sub ReadData
my $result = "";
- my $fh = new FileHandle $self->{filename};
+ my $fh = FileHandle->new($self->{filename});
if ( !defined $fh ) { $self->{error} = "PDF::Image::GIF.pm: $self->{filename}: $!"; return 0 }
binmode $fh;
seek( $fh, $self->{private}->{datapos}, 0 );
diff --git a/lib/PDF/Image/JPEG.pm b/lib/PDF/Image/JPEG.pm
index 91812d7..c11bed4 100644
--- a/lib/PDF/Image/JPEG.pm
+++ b/lib/PDF/Image/JPEG.pm
@@ -14,14 +14,11 @@
package PDF::Image::JPEG;
use strict;
-use vars qw(@ISA @EXPORT $VERSION $DEBUG);
-use Exporter;
+use warnings;
use FileHandle;
- at ISA = qw(Exporter);
- at EXPORT = qw();
-$VERSION = 1.05;
-$DEBUG = 0;
+our $VERSION = '1.08';
+our $DEBUG = 0;
sub new
{
@@ -166,7 +163,7 @@ sub Open
my $adobeflag = 0;
my $components = 0;
- my $fh = new FileHandle $filename;
+ my $fh = FileHandle->new($filename);
if ( !defined $fh ) { $self->{error} = "PDF::Image::JPEG.pm: $filename: $!"; return 0 }
binmode $fh;
@@ -338,7 +335,7 @@ sub ReadData
my $s = "";
my $result;
my $JPEG_BUFSIZE = 1024;
- my $fh = new FileHandle $self->{filename};
+ my $fh = FileHandle->new($self->{filename});
if ( !defined $fh ) { $self->{error} = "PDF::Image::JPEG.pm: $self->{filename}: $!"; return 0 }
binmode $fh;
seek( $fh, $self->{private}->{datapos}, 0 );
diff --git a/t/01-basic.t b/t/01-basic.t
index 2815468..61e0859 100755
--- a/t/01-basic.t
+++ b/t/01-basic.t
@@ -26,18 +26,19 @@ $pdfname =~ s/\.t/\.pdf/;
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
'Title' => 'Testing Basic Stuff',
);
-ok( defined $pdf, "Create new PDF" );
+isa_ok( $pdf, 'PDF::Create' );
ok( $pdf->add_comment("Testing Basic Stuff"), "Add a comment" );
my $root = $pdf->new_page( 'MediaBox' => $pdf->get_page_size('A4') );
-ok( defined $root, "Create page root" );
+#ok( defined $root, "Create page root" );
+isa_ok( $root, 'PDF::Create::Page' );
# Prepare font
my $f1 = $pdf->font( 'Subtype' => 'Type1',
diff --git a/t/02-string.t b/t/02-string.t
index 665a450..87ddb2d 100755
--- a/t/02-string.t
+++ b/t/02-string.t
@@ -25,7 +25,7 @@ $pdfname =~ s/\.t/\.pdf/;
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/03-image.t b/t/03-image.t
index 65951e3..8bbb069 100755
--- a/t/03-image.t
+++ b/t/03-image.t
@@ -28,7 +28,7 @@ my $jpgname = dirname($0) . "/pdf-logo.jpg";
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/04-drawing.t b/t/04-drawing.t
index 86c529b..bb154c5 100755
--- a/t/04-drawing.t
+++ b/t/04-drawing.t
@@ -25,7 +25,7 @@ $pdfname =~ s/\.t/\.pdf/;
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/05-outline.t b/t/05-outline.t
index be9caef..8e3d00f 100755
--- a/t/05-outline.t
+++ b/t/05-outline.t
@@ -23,7 +23,7 @@ $pdfname =~ s/\.t/\.pdf/;
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/06-annotation.t b/t/06-annotation.t
index ad5b955..b6ef633 100755
--- a/t/06-annotation.t
+++ b/t/06-annotation.t
@@ -23,7 +23,7 @@ $pdfname =~ s/\.t/\.pdf/;
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/07-fonts.t b/t/07-fonts.t
index 1ab6738..106ff3b 100755
--- a/t/07-fonts.t
+++ b/t/07-fonts.t
@@ -23,7 +23,7 @@ $pdfname =~ s/\.t/\.pdf/;
# start testing
#
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/09-cgi-script.pl b/t/09-cgi-script.pl
index fb7c52e..b1fdaf8 100755
--- a/t/09-cgi-script.pl
+++ b/t/09-cgi-script.pl
@@ -22,7 +22,7 @@ print CGI::header( -type => 'application/pdf' );
#
# Start the pdf with '-' (stdout) as filename
#
-my $pdf = new PDF::Create( 'filename' => "-",
+my $pdf = PDF::Create->new( 'filename' => "-",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
diff --git a/t/09-cgi.t b/t/09-cgi.t
index a740b3d..455bd59 100755
--- a/t/09-cgi.t
+++ b/t/09-cgi.t
@@ -9,7 +9,8 @@
BEGIN { unshift @INC, "lib", "../lib" }
use strict;
-use File::Basename;
+use File::Basename qw(dirname);
+use File::Spec;
use PDF::Create;
use Test::More tests => 2;
use Config;
@@ -21,7 +22,17 @@ my $cginame = File::Spec->catfile(dirname($0) . "/09-cgi-script.pl");
#
# run the cgi
#
-ok( !system(qq($cginame | $Config{"perlpath"} -n -e "print if \$. > 2" >$pdfname)), "CGI executes" );
+my @out = `$Config{"perlpath"} $cginame`;
+shift @out;
+shift @out;
+#diag $out;
+diag $pdfname;
+if (open my $fh, '>', $pdfname) {
+ print $fh @out;
+ close $fh;
+}
+
+ok scalar(@out), "CGI executes";
################################################################
#
diff --git a/t/11-encode.t b/t/11-encode.t
new file mode 100644
index 0000000..4522844
--- /dev/null
+++ b/t/11-encode.t
@@ -0,0 +1,121 @@
+#!/usr/bin/perl -w
+use strict;
+use PDF::Create;
+use Test::More;
+
+
+# The cases array contains test-cases
+# In each triple the first value is the expected return value
+# of the encode() method.
+# The second and third values are the two parameters
+# of the encode() method.
+# The third parameter is optional but it can also be a complex
+# data structure.
+# expected, type, value
+my @cases = (
+ [undef, 'null'],
+ ['anything', 'null', 'anything'], # any value
+
+ [undef, 'number'],
+ ['value', 'number', 'value'], # any value
+
+ ["\n", 'cr'],
+ ["\n", 'cr', 'abc'], # TODO: probably should complain that a 2nd, unnecesssary param was given
+
+ ['true', 'boolean', 'true'],
+ ['false', 'boolean', 'false'],
+ ['false', 'boolean', '0'],
+ ['true', 'boolean', '42'], # any other value as the 3rd item
+# ['true', 'boolean', undef], # TODO: give error or eliminate warnings
+
+ ['any string', 'verbatim', 'any string'], # anything
+ ['x', 'verbatim', 'x'], # anything
+# [undef, 'verbatim', undef], # TODO should give error, now fails with unknown type as the do{} fails
+# [0, 'verbatim', 0], # TODO should work?, now fails with unknown type as the do{} fails
+
+
+ ['(any string)', 'string', 'any string'], # anything
+ ['(x)', 'string', 'x'], # anything
+ ['()', 'string', undef], # TODO what should happen? eliminate warnings
+ ['(0)', 'string', 0],
+
+
+ # TODO: shouldn't this check if the given value was indeed a number?
+ ['any string', 'number', 'any string'], # anything
+ ['x', 'number', 'x'], # anything
+ [undef, 'number', undef], # TODO eliminate warnngs
+ [0, 'number', 0],
+
+
+ ['/any string', 'name', 'any string'], # anything
+ ['/x', 'name', 'x'], # anything
+ ['/', 'name', undef], # TODO ???, eliminate warnings
+ ['/0', 'name', 0],
+
+ ['[/anything]', 'array', [
+ ['name', 'anything'],
+ ]
+ ],
+ ['[/42 abc]', 'array', [
+ ['name', 42],
+ ['verbatim', 'abc'],
+ ]
+ ],
+
+ # TODO more complex test cases for dictionary
+ ["<<\n/42 /text\n/abc (qwe)\n>>", 'dictionary', {
+ 42 => ['name', 'text'],
+ abc => ['string', 'qwe'],
+ }
+ ],
+
+ # TODO more complex test cases for object
+ ["abc 43 obj\n/qwe\nendobj", 'object', [
+ 'abc', 43, ['name', 'qwe']
+ ]
+ ],
+
+ ["abc 45 R", 'ref', ['abc', 45]],
+
+ ["<<\n/abc 46\n/23 /qwe\n>>\nstream\nsome data\nendstream\n",
+ 'stream', {
+ Data => 'some data',
+ abc => ['number', 46],
+ 23 => ['name', 'qwe'],
+ }
+ ],
+);
+
+plan tests => 2 + @cases;
+
+{
+ my @warn;
+ local $SIG{__WARN__} = sub { push @warn, @_ };
+ PDF::Create::encode();
+ # TODO eliminat warning from code caused by undef in $type
+ like $warn[1], qr/PDF::Create::encode: empty argument, called by/, 'no params';
+};
+
+eval {
+ PDF::Create::encode('something');
+};
+like $@, qr{Error: unknown type 'something'}, 'exception';
+
+my %too_random = map { $_ => 1 } qw(dictionary stream);
+
+foreach my $c (@cases) {
+ my ($expected, $type, $value) = @$c;
+
+ SKIP: {
+ if ($too_random{$type}) {
+ if (defined $ENV{PERL_PERTURB_KEYS} and $ENV{PERL_PERTURB_KEYS} == 2
+ and defined $ENV{PERL_HASH_SEED} and $ENV{PERL_HASH_SEED} == 1) {
+ } else {
+ skip 'PERL_PERTURB_KEYS=2 and PERL_HASH_SEED=1 has to be in order to have predictable Hashes', 1;
+ }
+ }
+ my $name = $type . (defined $value ? ",$value" : '');
+ is PDF::Create::encode($type, $value), $expected, $name;
+ }
+}
+
diff --git a/t/50-versioning.t b/t/50-versioning.t
new file mode 100644
index 0000000..5ddab3d
--- /dev/null
+++ b/t/50-versioning.t
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+#
+# PDF::Create - Test Script
+#
+# Copyright 2010- Markus Baertschi <markus at markus.org>
+#
+# Please see the CHANGES and Changes file for the detailed change log
+#
+# Check module versions against PDF::Create version
+#
+
+BEGIN { unshift @INC, "lib", "../lib" }
+use strict;
+use PDF::Create;
+use Test::More tests => 5;
+
+my $version = $PDF::Create::VERSION;
+
+ok($version eq $PDF::Create::VERSION,"PDF::Create version is $PDF::Create::VERSION");
+ok($version eq $PDF::Create::Page::VERSION,"PDF::Create::Page version is $PDF::Create::Page::VERSION");
+ok($version eq $PDF::Create::Outline::VERSION,"PDF::Create::Outline version is $PDF::Create::Outline::VERSION");
+ok($version eq $PDF::Image::GIF::VERSION,"PDF::Image::GIF version is $PDF::Image::GIF::VERSION");
+ok($version eq $PDF::Image::JPEG::VERSION,"PDF::Image::JPEG version is $PDF::Image::JPEG::VERSION");
diff --git a/t/99-wifi-parabola.t b/t/99-wifi-parabola.t
index 4d99a93..f02bc9d 100755
--- a/t/99-wifi-parabola.t
+++ b/t/99-wifi-parabola.t
@@ -19,7 +19,7 @@ use Test::More tests => 1;
my $pdfname = $0;
$pdfname =~ s/\.t/\.pdf/;
-my $pdf = new PDF::Create( 'filename' => "$pdfname",
+my $pdf = PDF::Create->new( 'filename' => "$pdfname",
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Markus Baertschi',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libpdf-create-perl.git
More information about the Pkg-perl-cvs-commits
mailing list