Home All Groups Group Topic Archive Search About

How to write a PDF file from Visual Basic ?

Author
19 Oct 2005 3:03 PM
Peri
Dear All,

Can any one help me to write a PDF file from Visual Basic 6.0.

1. Is there any way to write directly to a PDF file from VB

Or

2. Is there any way to export to PDF using Crystal Reports 8.0 from VB ?

or

Any other options

Thanks and Regards,

Peri

Author
19 Oct 2005 3:19 PM
Duane Bozarth
Peri wrote:
>
> Dear All,
>
> Can any one help me to write a PDF file from Visual Basic 6.0.
>
> 1. Is there any way to write directly to a PDF file from VB

A PDF file is simply a file in pdf format..so, if you know the format,
certainly you can write directly to a file.  I don't think that is your
real question, however...

> Or
>
> 2. Is there any way to export to PDF using Crystal Reports 8.0 from VB ?

I know nothing about CR so can't answer...

> or
>
> Any other options

A google of "pdf VB" returned nearly 6E6 hits at least the first three
appeared to be quite directly related to what you want...
Author
19 Oct 2005 3:40 PM
Tom Gaughan
If you have Adobe Professional installed you should have an Adobe PDF
printer driver installed (look at the Window printers).  Then from your code
you should be able to iterate the VB Printers collection, find the PDF
printer driver, set a Printer object and use it.  Without Adobe pro I don't
know how you'd be able to create a PDF file.

Similarly, with Crystal within VB you should be able to set a the Windows
default printer to be the Adobe driver and then call the Crystal object's
Action method and see what happens.

I would think it would behave the same as printing a Word or Excel doc to
the Adobe driver.

Show quoteHide quote
"Peri" <Peri@newsgroups.nospam> wrote in message
news:egbwV3L1FHA.3720@TK2MSFTNGP14.phx.gbl...
> Dear All,
>
> Can any one help me to write a PDF file from Visual Basic 6.0.
>
> 1. Is there any way to write directly to a PDF file from VB
>
> Or
>
> 2. Is there any way to export to PDF using Crystal Reports 8.0 from VB ?
>
> or
>
> Any other options
>
> Thanks and Regards,
>
> Peri
>
>
Author
19 Oct 2005 5:01 PM
Paul Clement
On Wed, 19 Oct 2005 20:33:38 +0530, "Peri" <Peri@newsgroups.nospam> wrote:

¤ Dear All,
¤
¤ Can any one help me to write a PDF file from Visual Basic 6.0.
¤
¤ 1. Is there any way to write directly to a PDF file from VB
¤
¤ Or
¤
¤ 2. Is there any way to export to PDF using Crystal Reports 8.0 from VB ?
¤

I don't believe it is supported in the version you are using:

http://support.businessobjects.com/library/kbase/articles/c2011686.asp

The alternative would be to use a print driver component:

http://www.cutepdf.com/Products/CutePDF/writer.asp


Paul
~~~~
Microsoft MVP (Visual Basic)