Connecting Tech Pros Worldwide Forums | Help | Site Map

Generate PDF with VB code in Acrobat 6.0

Andrew
Guest
 
Posts: n/a
#1: Nov 12 '05
My VB Application opens an Access Report and has an option to generate the
report in PDF once the report is closed. This is accomplished by:

- Switching over to the Acrobat Printer (i.e. PDFWriter) from the default
printer.

- Setting a string type sub key "PDFFilename" in the registry
"HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter" to store the PDF in
a user selected directory with a filename that's determined by VB codes.

- Generating the PDF by issuing the command ".DoCmd.OpenReport sReport,
acViewNormal".

- Closing the report by issuing the command ".DoCmd.Close acReport,
ReportName, acSaveNo".

- Resetting to the default printer from Acrobat Printer "PDFWriter".

This works fine with Acrobat 5.0. When I recently installed Acrobat 6.0, I
managed to set the directory and name of the PDF into a string type sub key
"PDFFilename" in the registry "HKEY_CURRENT_USER\Software\Adobe\Acrobat
PDFMaker". However, I ran into a host of problems:

- Acrobat 6.0 does not recognize the filename in the string type sub key
"PDFFilename" in the registry. Instead, it uses its own default filename to
save the PDF.

- Acrobat 6.0 does not recognize the user selected directory in the string
type sub key "PDFFilename" in the registry. Instead, it saves the PDF in the
"My Documents" directory even though I left the "Location" textbox blank in
the printing preference property of Acrobat 6.0 printer "Adobe PDF" in
Window's printer setting.

Can you please show me the proper procedures to automatically generate PDF
by using Acrobat 6.0?

The methods that I used in Acrobat 5.0 to set up PDFWriter does not
work with Acrobat 6.0. Would I have to work with the registry, or
postscripts, or distiller?

Your help is greatly appreciated.

Thank you





Elaine
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Generate PDF with VB code in Acrobat 6.0


Set the printer to "Acrobat Distiller" rather than "PDFWriter"?

On Thu, 19 Feb 2004 14:22:43 -0500, "Andrew" <andrew@abc.ca> wrote:
[color=blue]
>My VB Application opens an Access Report and has an option to generate the
>report in PDF once the report is closed. This is accomplished by:
>
>- Switching over to the Acrobat Printer (i.e. PDFWriter) from the default
>printer.
>
>- Setting a string type sub key "PDFFilename" in the registry
> "HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter" to store the PDF in
>a user selected directory with a filename that's determined by VB codes.
>
>- Generating the PDF by issuing the command ".DoCmd.OpenReport sReport,
>acViewNormal".
>
>- Closing the report by issuing the command ".DoCmd.Close acReport,
>ReportName, acSaveNo".
>
>- Resetting to the default printer from Acrobat Printer "PDFWriter".
>
>This works fine with Acrobat 5.0. When I recently installed Acrobat 6.0, I
>managed to set the directory and name of the PDF into a string type sub key
>"PDFFilename" in the registry "HKEY_CURRENT_USER\Software\Adobe\Acrobat
>PDFMaker". However, I ran into a host of problems:
>
>- Acrobat 6.0 does not recognize the filename in the string type sub key
>"PDFFilename" in the registry. Instead, it uses its own default filename to
>save the PDF.
>
>- Acrobat 6.0 does not recognize the user selected directory in the string
>type sub key "PDFFilename" in the registry. Instead, it saves the PDF in the
>"My Documents" directory even though I left the "Location" textbox blank in
>the printing preference property of Acrobat 6.0 printer "Adobe PDF" in
>Window's printer setting.
>
>Can you please show me the proper procedures to automatically generate PDF
>by using Acrobat 6.0?
>
>The methods that I used in Acrobat 5.0 to set up PDFWriter does not
>work with Acrobat 6.0. Would I have to work with the registry, or
>postscripts, or distiller?
>
>Your help is greatly appreciated.
>
>Thank you
>
>
>
>[/color]

Andrew
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Generate PDF with VB code in Acrobat 6.0


Thanks for replying. After I installed Acrobat 6.0, "Adobe PDF" is listed
as the printer. How do I set the printer to "Acrobat Distiller"?
Since I want to use VB codes to generate the PDF, would I have to modify the
registry just like I did in Acrobat 5.0?


"Elaine" <no_elaine_nance_spam@dced.state.ak.us> wrote in message
news:40351723.14819659@news.state.ak.us...[color=blue]
> Set the printer to "Acrobat Distiller" rather than "PDFWriter"?
>
> On Thu, 19 Feb 2004 14:22:43 -0500, "Andrew" <andrew@abc.ca> wrote:
>[color=green]
> >My VB Application opens an Access Report and has an option to generate[/color][/color]
the[color=blue][color=green]
> >report in PDF once the report is closed. This is accomplished by:
> >
> >- Switching over to the Acrobat Printer (i.e. PDFWriter) from the default
> >printer.
> >
> >- Setting a string type sub key "PDFFilename" in the registry
> > "HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter" to store the PDF in
> >a user selected directory with a filename that's determined by VB codes.
> >
> >- Generating the PDF by issuing the command ".DoCmd.OpenReport sReport,
> >acViewNormal".
> >
> >- Closing the report by issuing the command ".DoCmd.Close acReport,
> >ReportName, acSaveNo".
> >
> >- Resetting to the default printer from Acrobat Printer "PDFWriter".
> >
> >This works fine with Acrobat 5.0. When I recently installed Acrobat 6.0,[/color][/color]
I[color=blue][color=green]
> >managed to set the directory and name of the PDF into a string type sub[/color][/color]
key[color=blue][color=green]
> >"PDFFilename" in the registry "HKEY_CURRENT_USER\Software\Adobe\Acrobat
> >PDFMaker". However, I ran into a host of problems:
> >
> >- Acrobat 6.0 does not recognize the filename in the string type sub key
> >"PDFFilename" in the registry. Instead, it uses its own default filename[/color][/color]
to[color=blue][color=green]
> >save the PDF.
> >
> >- Acrobat 6.0 does not recognize the user selected directory in the[/color][/color]
string[color=blue][color=green]
> >type sub key "PDFFilename" in the registry. Instead, it saves the PDF in[/color][/color]
the[color=blue][color=green]
> >"My Documents" directory even though I left the "Location" textbox blank[/color][/color]
in[color=blue][color=green]
> >the printing preference property of Acrobat 6.0 printer "Adobe PDF" in
> >Window's printer setting.
> >
> >Can you please show me the proper procedures to automatically generate[/color][/color]
PDF[color=blue][color=green]
> >by using Acrobat 6.0?
> >
> >The methods that I used in Acrobat 5.0 to set up PDFWriter does not
> >work with Acrobat 6.0. Would I have to work with the registry, or
> >postscripts, or distiller?
> >
> >Your help is greatly appreciated.
> >
> >Thank you
> >
> >
> >
> >[/color]
>[/color]


Tony Toews
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Generate PDF with VB code in Acrobat 6.0


"Andrew" <andrew@abc.ca> wrote:
[color=blue]
>When I recently installed Acrobat 6.0,[/color]

You could try searching at Adobe.com or at groups.google.com. I've read another
posting along the same lines stating that Adobe blew it on this issue.

Say what you will about Microsoft but Microsoft is very good at providing backward
compatibility.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
SA
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Generate PDF with VB code in Acrobat 6.0


Andrew:

As you've found Acrobat 6 is totally different that Acro 5's PDF writer.
Acrobat 6's Adobe PDF Printer is essentially the Distiller Printer from
Acrobat 5, updated with new functionality. Adobe has never exposed an easy
method to work with Distiller (e.g. registry or com objects) unless you
start with a postscript file (where in you can use the Distiller's com
object.)

That said, we make a VBA library that you can call from within your Access
db (by using a function wrapper, and then using the Application.Run method
to run that function from VB) that supports outputting Access reports to PDF
files, even using Acrobat 6. Its pretty easy to use with very little code.
You can find it on our web.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

"Andrew" <andrew@abc.ca> wrote in message
news:x08Zb.7509$Cd6.674687@news20.bellglobal.com.. .[color=blue]
> My VB Application opens an Access Report and has an option to generate the
> report in PDF once the report is closed. This is accomplished by:
>
> - Switching over to the Acrobat Printer (i.e. PDFWriter) from the default
> printer.
>
> - Setting a string type sub key "PDFFilename" in the registry
> "HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter" to store the PDF in
> a user selected directory with a filename that's determined by VB codes.
>
> - Generating the PDF by issuing the command ".DoCmd.OpenReport sReport,
> acViewNormal".
>
> - Closing the report by issuing the command ".DoCmd.Close acReport,
> ReportName, acSaveNo".
>
> - Resetting to the default printer from Acrobat Printer "PDFWriter".
>
> This works fine with Acrobat 5.0. When I recently installed Acrobat 6.0, I
> managed to set the directory and name of the PDF into a string type sub[/color]
key[color=blue]
> "PDFFilename" in the registry "HKEY_CURRENT_USER\Software\Adobe\Acrobat
> PDFMaker". However, I ran into a host of problems:
>
> - Acrobat 6.0 does not recognize the filename in the string type sub key
> "PDFFilename" in the registry. Instead, it uses its own default filename[/color]
to[color=blue]
> save the PDF.
>
> - Acrobat 6.0 does not recognize the user selected directory in the string
> type sub key "PDFFilename" in the registry. Instead, it saves the PDF in[/color]
the[color=blue]
> "My Documents" directory even though I left the "Location" textbox blank[/color]
in[color=blue]
> the printing preference property of Acrobat 6.0 printer "Adobe PDF" in
> Window's printer setting.
>
> Can you please show me the proper procedures to automatically generate PDF
> by using Acrobat 6.0?
>
> The methods that I used in Acrobat 5.0 to set up PDFWriter does not
> work with Acrobat 6.0. Would I have to work with the registry, or
> postscripts, or distiller?
>
> Your help is greatly appreciated.
>
> Thank you
>
>
>
>[/color]


Closed Thread