Tuesday, April 25, 2006

AcroPDF.dll fix in Acrobat Reader 7.0.7

I've made a solution using the ActiveX AcroPDF.dll that comes free with Acrobat Reader to automate batch printing of PDF files in a more consistent way than selection a bunch of PDF files in Explorer right click and print that has problems with not all PDF's being printed or in a random order and sometimes the first file is not printed to fit the paper but was zoomed in quite a bit (a bug that seems to be related to versions 7.0.0 up to 7.0.7 but that worked using the COM object). I used

AxAcroPDF1.LoadFile("C:\test.pdf")

AxAcroPDF1.printAllFit(True)

and it worked on my PC for a while but then stopped working one day and I could not get it to work again. Adobe support confirmed to me that it was fixed in Acrobat 7.0.7 and that explained why it worked on some PC's but not on all. I had during the time tried installing older versions like Acrobat 5.0 and Acrobat 6.0 for other testing purposes and somehow that broke the fix even for 7.0.7 after a while. What helped was to completely uninstall every Adobe Acrobat and Acrobat Reader and clean up the registry.

I still get a dialog box saying "WARNING! A script has requested to print an Acrobat file. This could print an entire document. Do you want to proceed printing?" There is a checkbox to make this not show up but in versions before 7.0.7 it just made the application not print the PDF's at all. So finally I got to know why this happened.

One method to skip this question is to change the registry setting iWarnScriptPrintAll at

HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\7.0\AVAlert\cCheckbox\cEWH

to 1 (DWORD)

before launch of Reader so that the dialog is not displayed. Setting it to 0 will make Reader to show it again.

[HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\7.0\AVAlert\cCheckbox\cEWH]
"iWarnScriptPrintAll"=dword:00000001

Something that is more irritating and that I've not found an easy solution for (let me know if you find it) is that you cannot add a new command to the PDF extension. Try Tools>Folder Options>File Types>Advanced on the PDF and add a new action. Now right click on a PDF and see that it's not there. Go back and try to edit it. Not possible. I suspect that it's the PDF shell extension file pdfshell.dll that does this. Not kind at all.

You might as well run into this and I hope these notes can get help some of you.

1 comment:

  1. Restored comments

    graham_king said...

    Thanks a lot for posting about the Acrobat bug:
    "WARNING! A script has requested to print an Acrobat file. This could print an entire document. Do you want to proceed printing?"

    I was having that problem trying to get Acrobat in IE to print from Python win32com. Upgrading to Acrobat 7.0.8 solved it. Cheers !
    October 19, 2006
    Anonymous said...

    Yes - another thank you.

    Any idea how to make your code work with Acrobat 8 reader - seems the way of calling the control has changed
    December 12, 2007
    JTB World said...

    I tried adding the PDF Browser Control AcroPDF.dll version 8.1.0.0 that comes with Acrobat Reader 8.1.1 and used Visual Studio 2008 and had no problem. How and where did you call the control?
    December 24, 2007

    ReplyDelete