A fair question. It seem I made a newbie mistake by not publishing the full code. Here it is:

use strict; use CAM::PDF; use Data::Printer; my $doc1 = 'Document1.PDF'; my $draw1 = 'Drawing1.PDF'; my $newdoc1 = 'NewDocument1.PDF'; print "open the original document \n"; my $pdf1 = CAM::PDF->new($doc1); my @prefs = $pdf1->getPrefs(); p (@prefs); print "save it to the new location \n"; $pdf1->output($newdoc1); print "open the new document \n"; $pdf1 = CAM::PDF->new($newdoc1); print "open a drawing \n"; my $pdf2 = CAM::PDF->new($draw1); print "append the drawing to the new document \n"; $pdf1->appendPDF($pdf2); print "save the appended document \n"; $pdf1->output($newdoc1); print "Done \n"

For clarity I did not include the "if not" code. This code opens the original document and saves it as the new document. Then it re-opens the new document and appends a drawing document and finally saves the combined document. Except that the save does not happen. The output is below:

open the original document [ [0] undef, [1] undef, [2] 1, [3] 1, [4] 1, [5] 1 ] save it to the new location open the new document open a drawing append the drawing to the new document save the appended document Bad request for object 1121 at position 0 in the file Use of uninitialized value in string eq at C:/Dwimperl/perl/site/lib/C +AM/PDF.pm line 4898. Done Press any key to continue . . .

The first save is ok and is the original document but the second save never happens and the appended drawing is missing.


In reply to Re^4: CAM::PDF cleanoutput Error by Anonymous Monk
in thread CAM::PDF cleanoutput Error by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.