Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
import PDF-FromHTML 0.23 from CPAN
git-cpan-module:   PDF-FromHTML
git-cpan-version:  0.23
git-cpan-authorid: AUDREYT
git-cpan-file:     authors/id/A/AU/AUDREYT/PDF-FromHTML-0.23.tar.gz
  • Loading branch information
Audrey Tang authored and schwern committed Dec 12, 2009
1 parent 600a918 commit f92255c
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 25 deletions.
10 changes: 10 additions & 0 deletions Changes
@@ -1,3 +1,13 @@
[Changes for 0.23 - 2007-02-05]

* Updated CAVEATS section to note that there is currently no plan
to support CSS for this module.
Contributed by: Craig Chant

* Updated license info in scripts/html2pdf to MIT.

* Various code warning/stricture/tidying up; no function changes.

[Changes for 0.22 - 2007-01-25]

* LICENSING CHANGE: This compilation and all individual files in it
Expand Down
2 changes: 1 addition & 1 deletion META.yml
Expand Up @@ -20,4 +20,4 @@ requires:
PDF::Writer: 0.05
XML::Twig: 0
perl: 5.6.0
version: 0.22
version: 0.23
4 changes: 1 addition & 3 deletions README
Expand Up @@ -18,9 +18,7 @@ PDF::FromHTML uses the standard perl module install process:

Copyright 2004, 2005, 2006, 2007 by Audrey Tang <cpan@audreyt.org>.

This software is released under the MIT license cited below. Additionally,
when this software is distributed with B<Perl Kit, Version 5>, you may also
redistribute it and/or modify it under the same terms as Perl itself.
This software is released under the MIT license cited below.

* The "MIT" License

Expand Down
18 changes: 9 additions & 9 deletions SIGNATURE
Expand Up @@ -14,11 +14,11 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

SHA1 934ecea307ca9c2a757329d20ffeee466c5e703b Changes
SHA1 412f0173c8fe5dd2f1340a7018f47e4caae51155 Changes
SHA1 a56639e72313c3edb655a9b11ebaae9e0c62bdf6 MANIFEST
SHA1 fddfb22071331eac031f2534710193c604d23413 META.yml
SHA1 7af9ee4d4c1b6a7420dc6d7caaa6bc31a23b4061 META.yml
SHA1 8124ee41c173886d167f43a4d2c5641dc5280f60 Makefile.PL
SHA1 605e855fcf78c3ca9fe76233f1e9899e1bc1e6f6 README
SHA1 9f050758e0dbcd4425d69cb7a17831870611d97e README
SHA1 603bb9de29fb8cba7f13409c546750972eff645d inc/Module/AutoInstall.pm
SHA1 9b2f9d83bcf77860f53a0c07c90a4a59ad9f5df1 inc/Module/Install.pm
SHA1 ad955f51ad2c40d4ba35395c27f5ed899a80bf7a inc/Module/Install/AutoInstall.pm
Expand All @@ -31,7 +31,7 @@ SHA1 f1d4e1bbcb40bb269f36e6dc011b3ca25d3829b7 inc/Module/Install/Metadata.pm
SHA1 b384bd42bc6263dc56d04a884ef4e5fe340049f8 inc/Module/Install/Scripts.pm
SHA1 0c2118868ef82ac517eb6d9c3bd93e6eb9bbf83e inc/Module/Install/Win32.pm
SHA1 e827d6d43771032fa3df35c0ad5e5698d0e54cda inc/Module/Install/WriteAll.pm
SHA1 aae553d840c0f127e14b6371ca5f77545cc99c85 lib/PDF/FromHTML.pm
SHA1 2b8de92503b1817204e44b2472dcc7b371580f14 lib/PDF/FromHTML.pm
SHA1 2f9e0c31d4bbe3ef1ff50a29e843e68b6b9738f0 lib/PDF/FromHTML/Template.pm
SHA1 02baf18dc18a119dcc625837f1b645c62b12af59 lib/PDF/FromHTML/Template/Base.pm
SHA1 50cdf2f13a87ec85cb89bcb2ddeb1d358f909c31 lib/PDF/FromHTML/Template/Constants.pm
Expand Down Expand Up @@ -62,13 +62,13 @@ SHA1 1911ca83963e864fcee30c62e0fd31b8f2632327 lib/PDF/FromHTML/Template/Element/
SHA1 a5b890a90482d38ccbb3d443fbe52e3c3f92566f lib/PDF/FromHTML/Template/Factory.pm
SHA1 900820c0caeb25227242b526f346c1a3608bcf76 lib/PDF/FromHTML/Template/Iterator.pm
SHA1 82a43e255d8b37bc6b834f912bf83be00c6bf79a lib/PDF/FromHTML/Template/TextObject.pm
SHA1 3ba23bb0f78d1cfb36638ef2962e397576cc7424 lib/PDF/FromHTML/Twig.pm
SHA1 cf53f30631379e1d6b178a91815a0b89773c3139 script/html2pdf.pl
SHA1 3114016cc905a5dc9374003d231b41e42cb6697a lib/PDF/FromHTML/Twig.pm
SHA1 528eec0f5859276a0bfb9f5f5e98edcfa6ebc7f2 script/html2pdf.pl
SHA1 dba925c9cd7d09347a17d66d4d9d3bd8215456ec t/1-basic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFuMHAtLPdNzw1AaARAljpAJ0Vtpyrkoa+DQBYjRT1/My0ynvsiACdGgx/
DWE7kIF6eRekCMzxpd0g+RQ=
=Y0vi
iD8DBQFFxlaBtLPdNzw1AaARAr/wAKCwVOHrDVuuuJb6QoWu2s0iTOC9pACgtgTg
Bw1q3Tq0kWr2XW9nnALLF0I=
=yH4S
-----END PGP SIGNATURE-----
23 changes: 18 additions & 5 deletions lib/PDF/FromHTML.pm
@@ -1,5 +1,5 @@
package PDF::FromHTML;
$PDF::FromHTML::VERSION = '0.22';
$PDF::FromHTML::VERSION = '0.23';

use 5.006;
use strict;
Expand Down Expand Up @@ -91,7 +91,7 @@ sub parse_file {
my $dir = Cwd::getcwd();

if (!ref $file) {
open my $fh, $file or die $!;
open my $fh, '<', $file or die $!;
chdir File::Basename::dirname($file);
$content = do { local $/; <$fh> };
}
Expand Down Expand Up @@ -179,6 +179,7 @@ sub convert {

# print STDERR "==> Temp file written to $filename\n";

local $@;
local $^W;
$self->pdf(eval { PDF::FromHTML::Template->new( filename => $filename ) })
or die "$filename: $@";
Expand All @@ -201,6 +202,20 @@ Add the height and width attributes if you are creating the source HTML,
it keeps PDF::FromHTML from having to open and read the source image file
to get the real size. Less file I/O means faster processing.
=head1 CAVEATS
Although PDF::FromHTML will work with both HTML and XHTML formats, it
is not designed to utilise CSS.
This means any HTML using external or inline CSS for design and
layout, including but not limited to: images, backgrounds, colours,
fonts etc... will not be converted into the PDF.
To get an idea of the likely resulting PDF, you may wish to use an
non-CSS capable browser for testing first.
There is currently no plan to adapt this module to utilise CSS.
=head1 SEE ALSO
L<PDF::FromHTML::Twig>, L<PDF::Template>, L<XML::Twig>.
Expand All @@ -217,9 +232,7 @@ Charleston Software Associates E<lt>info@charletonsw.comE<gt>
Copyright 2004, 2005, 2006, 2007 by Audrey Tang E<lt>cpan@audreyt.orgE<gt>.
This software is released under the MIT license cited below. Additionally,
when this software is distributed with B<Perl Kit, Version 5>, you may also
redistribute it and/or modify it under the same terms as Perl itself.
This software is released under the MIT license cited below.
=head2 The "MIT" License
Expand Down
4 changes: 1 addition & 3 deletions lib/PDF/FromHTML/Twig.pm
Expand Up @@ -612,9 +612,7 @@ Audrey Tang E<lt>cpan@audreyt.orgE<gt>
Copyright 2004, 2005, 2006, 2007 by Audrey Tang E<lt>cpan@audreyt.orgE<gt>.
This software is released under the MIT license cited below. Additionally,
when this software is distributed with B<Perl Kit, Version 5>, you may also
redistribute it and/or modify it under the same terms as Perl itself.
This software is released under the MIT license cited below.
=head2 The "MIT" License
Expand Down
27 changes: 23 additions & 4 deletions script/html2pdf.pl
@@ -1,5 +1,7 @@
#!/usr/local/bin/perl

use strict;
use warnings;
use PDF::FromHTML;

=head1 NAME
Expand Down Expand Up @@ -39,11 +41,28 @@ =head1 AUTHORS
=head1 COPYRIGHT
Copyright 2004 by Audrey Tang E<lt>cpan@audreyt.orgE<gt>.
Copyright 2004, 2005, 2006, 2007 by Audrey Tang E<lt>cpan@audreyt.orgE<gt>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
This software is released under the MIT license cited below.
See L<http://www.perl.com/perl/misc/Artistic.html>
=head2 The "MIT" License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
=cut

0 comments on commit f92255c

Please sign in to comment.