Jason Mauss' Blog Cabin

Because someone's got to do the dirty work

Blog-Flair

Blogroll

Links

Supressing the 'Save As...' dialog with Acrobat PDFWriter 5.0

I noticed over on Jason Bock's blog he had been writing a little bit about some PDF development he'd been doing - so I thought it might be appropriate for me to chime in with a little helpful info of my own involving PDF development.

The application I'm currently working on requires using some older technology (VB6/ActiveX/ASP 3.0/ADO). In addition, some of the output needs to be exported into PDF documents. One of the tools we're using (ActiveReports) has native support for exporting to PDF but, the other tool does not. So our solution (rather than buying a 3rd-party PDF component) was to just print the document to the Acrobat PDFWriter printer driver, thus giving us a PDF document.

The only problem is that this application is part of an automated service that processes these documents on a server and it can't require any user interaction. This is a problem because when you print to the Acrobat PDFWriter with Acrobat 5.0, before you can get a PDF file you get this:

Seeing as how I couldn't allow this, I needed a way to programmatically provide the name of the PDF file to the Acrobat PDFWriter printer driver before printing. While this isn't exactly the “Adobe API” way to do it - there is a simple registry hack that solves the problem and works quite smoothly.

 

Creating a String Value named PDFFileName under the registry key shown in the status bar above, the Acrobat PDFWriter printer driver will use that value (“C:\PDF6.pdf” in the image above) and print to the PDF file without asking for anything from the user. While I wouldn't exactly call this robust, it works. (Be careful though - after the Acrobat PDFWriter printer uses the value, it removes it entirely from the collection of values, so you have to add the value back before each printing). I'm simply using the Registry API (RegCreateKeyEx) from within VB6 to accomplish this.

For those of you developing with Adobe Acrobat Distiller (Version 6.0 of Adobe Acrobat) the “Adobe PDF” printer driver and Distiller have a much more robust and powerful API. The Acrobat PDFWriter printer driver is nowhere to be found as of version 6.0. It's all about Distiller for Adobe going forward.

Comments

Zarani Barrow said:

The images you posted are no longer valid.  Can you tell me the exact registry key you modified. I'm trying to complete this same task and its a bear.

Thanks.

Zarani W. Barrow

# November 19, 2007 3:02 PM

Microsoft OEM Software said:

ITNsbj Very good article. Keep writing.

# March 9, 2012 6:24 AM

National Interest Waiver said:

Yeah, in my opinion, it is written on every fence!!....

# March 15, 2012 3:57 PM

fabio henrique zocca said:

Left on my site a link to this post. I think many people will be interested in it..!!

# March 15, 2012 5:35 PM

work from home said:

It`s really useful! Looking through the Internet you can mostly observe watered down information, something like bla bla bla, but not here to my deep surprise. It makes me happy..!!

# March 15, 2012 7:09 PM

victoria s secret gift card said:

Yeah, it is clear now !... Just can not figure out how often do you update your blog?!....

# March 15, 2012 8:44 PM

meteorologia portugal said:

I do`t regret that spent a few of minutes for reading. Write more often,  surely'll come to read something new!....

# March 18, 2012 12:35 PM

indie horror film said:

Muchos Gracias for your article post.Much thanks again. Much obliged.

# March 19, 2012 8:01 AM

build your website said:

Last a few years has been to Ibiza, so met a person there whose style of presentation is very similar to yours. But, unfortunately, that person is too far from the Internet!....

# March 19, 2012 8:01 AM

get back together with my ex said:

This article is for professionals..!!

# March 19, 2012 11:19 AM

Dental Laboratory said:

Yeah, in my opinion, it is written on every fence!!....

# March 19, 2012 2:42 PM

Baby Shower Invitations said:

Really enjoyed this post. Want more.

# March 19, 2012 5:27 PM

Boys Bedding said:

Read, of course, far from my topic. But still, we can work together. How do you feel about trust management?!....

# March 19, 2012 6:47 PM

ppi claims form said:

Hey, thanks for the article post.Much thanks again. Really Great.

# March 20, 2012 6:02 AM

hartnelldown said:

I must admit, the webmaster has written cool..!!

# March 20, 2012 6:39 AM

DUI Lawyer Denver said:

Cool:) I would say say it exploded my brain..!!

# March 20, 2012 9:05 AM

what is the best way to get rid of acne said:

Extremely easy by words but in reality�, a lot of things don`t correspond. Not everything is so rosy..!!

# March 20, 2012 11:50 AM

Mobile Ticketing said:

Thanks-a-mundo for the article post.Thanks Again. Fantastic.

# March 20, 2012 1:10 PM

home business work opportunity said:

It's pleasant sitting at work to distract from it�to relax and read the information written here:DD

# March 20, 2012 1:33 PM

ancestry genealogy said:

Enjoyed every bit of your article post.Much thanks again. Want more.

# March 20, 2012 1:38 PM

nightclub flyer design said:

I appreciate you sharing this blog post.Thanks Again. Will read on...

# March 20, 2012 4:40 PM

wholesale men clothing said:

Great, thanks for sharing this blog.Really looking forward to read more. Awesome.

# March 20, 2012 6:20 PM

moms chips said:

This is one awesome blog article.Really looking forward to read more. Fantastic.

# March 20, 2012 6:23 PM

White Lake Homes for sale, said:

Are you interested in webmaster`s income?!....

# March 20, 2012 6:42 PM

Gucci Shoulder Bags said:

This article is for professionals..!!

# March 20, 2012 8:24 PM

vBulletin Styles said:

Every time I come back here again and don`t get disappointed..!!

# March 20, 2012 10:04 PM

Binary Options said:

Strange but true. Your resource is expensive. At least it could be sold for good money on its auction!....

# March 21, 2012 1:27 AM

htc unlock said:

I envy you. The content and design of your blog is much better than mine. Who made a design for you?!....

# March 21, 2012 3:11 AM

nightclub flyer design said:

Thanks for the news! Just was thinking about it! By the way Happy New Year to all of you:DD

# March 21, 2012 4:58 AM

Binary Options said:

Thanks a lot for the blog.Thanks Again. Cool.

# March 21, 2012 5:44 AM

Hip Hop Beats said:

I loved your blog post.Thanks Again. Will read on...

# March 21, 2012 7:31 AM

Home security said:

Major thankies for the blog.Thanks Again. Fantastic.

# March 21, 2012 9:21 AM

google+ circles said:

Thanks so much for the post.Really looking forward to read more.

# March 21, 2012 10:46 AM

weight loss foods said:

Very good post.Much thanks again. Really Great.

# March 21, 2012 11:11 AM

pilgrim tours said:

Major thankies for the article.Really looking forward to read more.

# March 21, 2012 12:33 PM

Johan Ripås said:

Thanks a lot for the post.Thanks Again.

# March 21, 2012 12:59 PM

select 2012 golo s said:

Fantastic post.Thanks Again. Will read on...

# March 21, 2012 4:05 PM

anime said:

I appreciate you sharing this article. Will read on...

# March 21, 2012 4:35 PM

Christian louboutin on sale said:

Awesome blog post. Keep writing.

# March 21, 2012 7:37 PM

Cheap party dresses said:

Great, thanks for sharing this blog. Fantastic.

# March 21, 2012 8:12 PM

learn chinese said:

Really appreciate you sharing this blog post. Keep writing.

# March 21, 2012 10:14 PM

fine art gallery said:

I think this is a real great blog.Much thanks again. Fantastic.

# March 22, 2012 12:12 AM

cheap basketball jerseys said:

Looking forward to reading more. Great article. Cool.

# March 22, 2012 2:01 AM

score ipl live said:

Im grateful for the article post.Much thanks again. Fantastic.

# March 22, 2012 3:51 AM

adult contemporary said:

I truly appreciate this blog. Want more.

# March 22, 2012 5:41 AM

joomla plugin said:

I appreciate you sharing this article post. Fantastic.

# March 22, 2012 7:34 AM

Short term apartments tel aviv said:

I loved your blog.Thanks Again. Cool.

# March 22, 2012 9:24 AM

unique visitors said:

Extremely easy by words but in reality�, a lot of things don`t correspond. Not everything is so rosy..!!

# March 22, 2012 9:24 AM

joomla component said:

Fantastic post. Great.

# March 23, 2012 9:24 AM

Vacation rentals in tel aviv said:

Major thanks for the blog.Thanks Again. Want more.

# March 23, 2012 11:19 AM

Compare Virgin Broadband Deals With Cable.co.uk said:

Major thankies for the article.

# March 23, 2012 3:08 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)