New Forum | Previous | Next | (P-PDF) Developers
Topic: Automate PDF creation in VB
Conf: (P-PDF) Developers, Msg: 140158
Date: 9/28/2005 05:04 AM
I would like to preface this post by telling you that I am new to Adobe Acrobat development, so my knowledge is very basic. First, I will describe what my application does and what the user wants it to do. Second, I will tell you what we've tried and what my requirements are.
1. This is an application, written in VB.NET, which generates legal documentation based upon a series of questions presented to the user. The application then interfaces with Word to create a usable document. Because these legal documents are occasionally emailed, the user needs to convert the documents to a PDF format to minimize tampering of the content. In the past the users have just utilized the PDFMaker add-in for Word and created them manually, but this means that the user can only create one document at a time. Therefore, the user has asked us to create a function in our application to automate the conversion of an entire folder of Word documents.
2. We were successful in making our application create a PDF file by doing the following:
a) Read in the list of Word documents located in the users directory.
b) Open each document in Word.
c) Change the active printer to the "Adobe PDF" printer.
d) Through the use of registry keys "strongly suggest" the location for storage of the new PDF file.
e) Train the users to press the enter key when the "Save As..." dialog box appears.
f) Change the active printer back to the default printer.
g) End process.
The issues that we've had with this method are as follows:
a) It requires user interaction and the user does not want to have to press the enter key or interact with this function in any way.
b) We have some documents with names that are over 59 characters in length and the Adobe PDF printer Save As dialog automatically truncates the document name to 56 characters and adds "..." before it tacks on the extension. This is especially unfortunate for the "Minimum Standards - Environmental Limited Phase 1 Site Assessment.doc", which gets truncated to "Minimum Standards - Environmental Limited Phase 1 Site Ass....doc".
c) Occasionally our documents will have a number in parentheses and the Adobe PDF printer Save As dialog automatically converts them into underscores, so the original document is called "Loan Agreement(1).doc" and the PDF will be called "Loan Agreement_1_.pdf". This is confusing to our users and the PDFMaker does not do any of these things to the document names.
We have purchased the Acrobat SDK and although I've read through it, I have yet to find a way to make our application work like the PDFMaker and take the user interaction out of our function. This must be written in VB and if the suggestion is to print a postscript file first and send it to the distiller, I would like an explanation as to what that's getting me. If I have to open Word to print anything I might as well continue to print to the "Adobe PDF" printer and save a step. Also with the addition of this function we upgraded all of our users to Acrobat 6.0 to ensure consistant functionality.
If anyone has a suggestion or could help to give me direction, I would appreciate it. I'm hoping I've over looked something in the SDK that will accomplish what I'm trying to do. Thanks.