[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB6  Adding Header, Footers, and security to an existing PDF file

Posted on 2011-10-29
7
Medium Priority
?
968 Views
Last Modified: 2012-06-27
Hi.
I am a  VB6 programmer and I am looking for a OCX or ActiveX that will enable me to do the following

1. Open an existing PDF of an image
2. Add Header and Footer
3. Secure it with No Print/Copy etc
4. Add a Owner password

And to be able to save it out again. The solution needs to be inexpensive so components (if required) needs to be under the $100 mark.

The project is to enable artists to add information to their PDF artwork so that it can be tracked back to the buyer if copied to forums etc.

Many thanks
Dave
0
Comment
Question by:marcwolf
  • 5
  • 2
7 Comments
 
LVL 11

Accepted Solution

by:
kbirecki earned 2000 total points
ID: 37049898
I've worked with tools that can do what you are asking for.  They are freely available and have licensing restrictions of you use them for commercial purposes, which you'd have to check into yourself - I don't use them that way.

The first part of placing annotations on the document is covered in an article I wrote titled Using open source tools to place annotation text as a stamp on a PDF document.  It uses an external utility called ImageMagick, which you can find more information about here.

As for the second part, I can write up steps for you (I'm still planning on writing an article on this as well), but the tool I use is PDFTK available at http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/.  It has an option for applying an owner password.  

In both cases, you have to Shell out of VB6 to execute the commands, and then continue.  I would recommend considering using something like ShellAndWait to process your commands before continuing your VB6 app because the Shell'd command could still be executing when the VB6 app continues and expects results from the external utility to already be done.  ShellAndWait will allow the external utility to finish before continuing.  A recent question I participated in discussed several methods to do this (and there are more if you search for something like "ShellAndWait"), and I included what I use for ShellAndWait, but there were other valid methods on that question, and the author selected one of the earlier suggested solutions.

Let me know if you would like an example of applying the owner password with PDFTK.
0
 
LVL 1

Author Comment

by:marcwolf
ID: 37050035
Hi Kbirecki
It goes part of the way but I really wanted to use Headers and Footers. specifically. The concept of creating a image file and then using it as a watermark will work but only as a last resort.

I've used the shell out and monitor process before with VB6 so I won't have any probs with that.

Take Care
Dave
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 37050118
When you say you want to use headers and footers, what do you mean?  Are you expecting to shrink the image of the pdf so that you can leave room for headers and footers, or are you going to just overwrite whatever is in the area of the headers and footers?  Or are you thinking of something like this: http://www.nitropdf.com/help/headers_footers.htm

From your description, I thought you were trying to be able to determine the origin of a document and headers and footers can be stripped.  Is that a concern?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:marcwolf
ID: 37051423
Hi.
Yes - like in Nitro.  For example a comic is a series of pages stored in a PDF. To beable to shrink the picture of the comic slightly and then insert text would be good.
If the PDF is then locked and secured then it cannot be changes and  if it is distributed illegally then the source (being the name and transaction ID of the recipient) will be clearly visible.

But I do get your point re the shrinkage.
Many thanks for the advice
Dave
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 37054039
I think you have to go the watermark route because actually using the header/footer capabilities is not going to do what i think you want.  Those are properties or fields on a PDF document, and can be stripped out.  If you use the concept of watermarking, it becomes embedded in the PDF and cannot be easily separated.

I also use several tools from a-pdf.com, and they may have something you are looking for, but for basic watermarking, the article I references works and allows you to place the text anywhere on the page, even in the header/footer areas.  That's how I use, to mark when a document is scanned.

Another PDF security software is LockLizard.  I've run into some of those at work and they are pretty secure, meaning they can't easily have the security removed, or at least beyond my ability.

The last idea I have that would allow you to resize a PDF is ImageMagick.  It does have the ability to convert PDF to JPG, for instance, and resize images, and much more.  But that's the only way I can think of to resize a PDF is to convert to an image.  But this is slow on a large file.
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 37054252
OK, I just ran across some more resources for you to look at.

This page describes how to use a utility called Advanced PDF Tools.

This and other PDF tools are on the site http://www.verypdf.com.
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 37055464
Thanks for the points.  Can I ask what direction you ended up going?
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In a previous article here at Experts Exchange (http://www.experts-exchange.com/articles/18414/Create-a-PDF-file-with-Contact-Sheets-montage-of-thumbnails-for-all-JPG-files-in-a-folder-and-each-of-its-subfolders-using-an-automated-batch-method.html)…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question