|
-
May 5th, 2021, 09:39 AM
#1
Thread Starter
Addicted Member
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!
-
May 5th, 2021, 10:15 AM
#2
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
-
May 5th, 2021, 10:28 AM
#3
Thread Starter
Addicted Member
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.
-
May 5th, 2021, 11:33 AM
#4
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|