Subject: | PDF::API2::Basic::PDF::File->copy() fails to copy properly |
Date: | Fri, 10 Jan 2014 21:40:07 -0500 |
To: | bug-PDF-API2 [...] rt.cpan.org |
From: | "J.C. Wren" <jcwren [...] jcwren.com> |
PDF::API2 is version 2.020.
Using the following program, I would expect that "test_in.pdf" should be
copied to "test_out.pdf", and that "test_out.pdf" would be a usable file.
use strict;
use warnings;
use PDF::API2;
my $out = PDF::API2::Basic::PDF::File->new;
my $pdf = PDF::API2::Basic::PDF::File->open ("test_in.pdf");
$pdf->copy ($out);
$out->{' version'} = 4;
$out->out_file ("test_out.pdf");
However, Adobe Reader on multiple platforms will not open the file (error
14), and pdfinfo (from poppler) reports the following:
jcw$ pdfinfo test_in.pdf
Title: Competitors in CGC Jan 11th
Subject: Shoot'n Score It
Keywords: Shoot'n Score It, http://shootnscoreit.com
Author: JC Wren
Creator: Shoot'n Score It
Producer: ReportLab PDF Library - www.reportlab.com
CreationDate: Fri Jan 10 10:34:03 2014
Tagged: no
Form: none
Pages: 3
Encrypted: no
Page size: 595.276 x 841.89 pts (A4)
Page rot: 0
File size: 8502 bytes
Optimized: no
PDF version: 1.4
jcw$ pdfinfo test_out.pdf
Syntax Error: Top-level pages object is wrong type (null)
Syntax Error: Top-level pages object is wrong type (null)
Command Line Error: Wrong page range given: the first page (1) can not be
after the last page (0).
I'm no expert on PDF file formats, and spending a few minutes staring at it
didn't yield any useful clues.
--jc
Save a life; adopt a shelter animal.
Message body not shown because it is not plain text.
Message body not shown because it is not plain text.