Results 1 to 4 of 4

Thread: Copy part of a pdf and stamp onto another one

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2018
    Posts
    160

    Copy part of a pdf and stamp onto another one

    Hi

    I need to grab part of a pdf and stamp it onto another pdf.

    I'm using itextsharp in vb.net to:

    1. Resize the 'from' pdf to a new 'crop' file with cropbox, mediabox etc set to the area I want to grab
    2. Stamp the 'crop' file on to another pdf at specific cor-ordinates

    This works to an extent, but the crop file still contains info I don't want, so when I stamp it on it adds some text from the original in a hidden layer on my new pdf.

    I've done a lot of googling today trying to find a way to remove hidden info when I resize a pdf, and it seems it's just impossible without using Acrobat.

    So I need another approach to this. Is there way to only grab part of a page when I use GetImportedPage and AddTemplate to stamp?

    Thanks for reading - happy to post code of what I've got so far but it's a bit of a mess!

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Copy part of a pdf and stamp onto another one

    I don't think so. That's why I don't bother trying to do it programmatically. Instead I slice up the PDF in Acrobat and create the smaller individual PDFs that get merged later. But I'm also usually always merging the same parts over and over, so it's not like the selections I'm slicing are dynamic. It also only happens once in a couple years, and only when they send me a large document where they've added the updated info (ugh, I hate, that, just send me the original updated form, not the whole document).

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2018
    Posts
    160

    Re: Copy part of a pdf and stamp onto another one

    Hi

    Thanks for replying.

    Unfortunately this is part of a daily task involving thousands of different files, so you can see why I'm looking for some sort of batch process!

    This is one of those things where it seems simple and you think there MUST be a way to do it, yet you just can't find it.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2018
    Posts
    160

    Re: Copy part of a pdf and stamp onto another one

    Looks like a PdfCleanUpProcessor may be the way to go.

    I'll need to clear 4 areas - above, below, left and right of the area I want to crop. That will remove the hidden info which was being left by resizing the source pdf.

    Then I just stamp that clean pdf on to the file I want. Simple as that (hopefully!)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width