Thanks for you comments and fixes .. however I can only see one thing that is changed (other than the addition of CLI code).

You've called pdfimageobj on the old pdf rather than the new one. That's wrong -- you need to call it on the new file, so that the page is loaded into the new pdf. The gfx->pdfimage call later then tells where that page should be placed.

You can tell that by the interface: You code ($img = $oldpdf->pdfimageobj($oldpdf, $pg)) would set @_ in the sub to ($oldpdf, $oldpdf, $pg). That wouldn't be right. There's be no need to declare the $oldpdf as a parameter to the sub as it's the object on which it's being called.

"Get real! This is a discussion group, not a helpdesk. You post something, we discuss its implications. If the discussion happens to answer a question you've asked, that's incidental." -- nobull@mail.com in clpm

In reply to Re^3: PDF mod suggestions by BigLug
in thread PDF mod suggestions by blue.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.