Home All Groups Group Topic Archive Search About

Advice for PDF printer driver (VB6)

Author
23 Sep 2005 1:33 PM
Robertico
I'd like to print my reports to PDF.
Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro) using
the VB printer object. (With special thanks to Mike Williams)
Everthing works fine, but this printer driver everytime displays a dialogbox
and asks for path and a file name.
Now i'am looking for an other FDF printer driver which accepts path and file
name from VB (programly set by VB).
As far as i know there's no registry key for Adoble PDF printer i can use.

Thanks in advance,

Robertico

Author
23 Sep 2005 4:06 PM
Mike Williams
"Robertico" <Robertico@nomail.notvalid> wrote in message
news:dh167d$don$1@localhost.localdomain...

> I'd like to print my reports to PDF. Now i'am using the 'Adobe PDF
> printer' driver (Adobe Acrobat 6.0 Pro) using the VB printer object.
> (With special thanks to Mike Williams) Everthing works fine, but this
> printer driver everytime displays a dialogbox and asks for path and a file
> name.

I've never used Adobe Acrobat myself (hobbyists can't afford that sort of
stuff!) so I of course do not know if there is any "official" way to pass it
the path and file name. However, a possible "kludge" would be to wait for
the Adobe dialog box to make itself the active window and then send it the
appropriate key strokes (using either SendKeys or preferably the keybd_event
API or better still the SendInput API. If the appropriate input box in the
Adobe dialog is not by default the active control on that dialog then you
might have to find the window handle and make it so. There's probably a
better way to do this, but its worth a try.

Mike
Author
23 Sep 2005 4:46 PM
Robertico
> I've never used Adobe Acrobat myself (hobbyists can't afford that sort of
> stuff!)

Only when your boss pays the bill.

>However, a possible "kludge" would be to wait for the Adobe dialog box to
>make itself the active window and then send it the appropriate key strokes
>(using either SendKeys or preferably the keybd_event API or better still
>the SendInput API. If the appropriate input box in the Adobe dialog is not
>by default the active control on that dialog then you might have to find
>the window handle and make it so. There's probably a better way to do this,
>but its worth a try.

I already thought about that. But it's not the clean solution i prefer.
Thanks anyway.

Robertico
Author
23 Sep 2005 5:52 PM
Mike Williams
"Robertico" <Robertico@nomail.notvalid> wrote in message
news:dh1hgg$hcl$1@localhost.localdomain...

> I already thought about that. But it's not the clean
> solution i prefer. Thanks anyway.

Yeah. I knew you wouldn't like it. Still, it was worth a try. By the way,
I've never been "into" these PDF files, but I've just had a look at the link
provided by Matt and it looks interesting. I probably won't ever get into it
(too much other stuff to do!) but if I ever do will you help me with it? For
example, can you tell me (after looking at the link provided by Matt)
whether I would be able to use that stuff myself without too much trouble
(and without having to buy anything!) to print pdf files myself?

Mike
Author
23 Sep 2005 6:17 PM
ljb
Show quote Hide quote
"Mike Williams" <M***@WhiskyAndCoke.com> wrote in message
news:dh1fdd$d6f$1@news7.svr.pol.co.uk...
> "Robertico" <Robertico@nomail.notvalid> wrote in message
> news:dh1hgg$hcl$1@localhost.localdomain...
>
> > I already thought about that. But it's not the clean
> > solution i prefer. Thanks anyway.
>
> Yeah. I knew you wouldn't like it. Still, it was worth a try. By the way,
> I've never been "into" these PDF files, but I've just had a look at the
link
> provided by Matt and it looks interesting. I probably won't ever get into
it
> (too much other stuff to do!) but if I ever do will you help me with it?
For
> example, can you tell me (after looking at the link provided by Matt)
> whether I would be able to use that stuff myself without too much trouble
> (and without having to buy anything!) to print pdf files myself?
>
> Mike
>
>
>

I had to resort to printing to a Postscript file format first where my
application could control the file name and then pass that to Adobe
Distiller. Distiller takes the named Postscript file and converts it to a
PDF by the same name and location. If you have Acrobat you should have both
PDF Writer and Distiller.

LJB
Author
24 Sep 2005 6:34 AM
Robertico
I found another one, not very expensive, at
http://www.verypdf.com/pdfcamp/pdfcamp.htm

With this you can control the output by adding an entry to the Windows
registry.
(path, file name, rename/overwrite/insert/append, view or not after
creation)

I'll give this one and PDFCreator a try and let you know.

I already tried PDF995, but during the installation it removes my default
printer.
I don't like that. Not very 'friendly' installation.

Regards,

Robertico
Author
24 Sep 2005 1:06 PM
Lee Peedin
Robertico,
If you already have Acrobat, then you've got all you need - see my
post at the end of this thread.
Lee

On Sat, 24 Sep 2005 08:34:17 +0200, "Robertico"
<Robertico@nomail.notvalid> wrote:

Show quoteHide quote
>I found another one, not very expensive, at
>http://www.verypdf.com/pdfcamp/pdfcamp.htm
>
>With this you can control the output by adding an entry to the Windows
>registry.
>(path, file name, rename/overwrite/insert/append, view or not after
>creation)
>
>I'll give this one and PDFCreator a try and let you know.
>
>I already tried PDF995, but during the installation it removes my default
>printer.
>I don't like that. Not very 'friendly' installation.
>
>Regards,
>
>Robertico
>
Author
23 Sep 2005 5:13 PM
Someone
You could use:

http://www.pdf995.com/

It's free with popup ads, otherwise $9.95. It has no spyware as far as I
know. I think you could specify the file name in an INI file just before
printing. Also, it has auto renaming feature.

You could also search for another PDF printer, but make sure that the file
that it creates is small. Some PDF printers do not use compression and that
could be a problem when you email the file to somebody.


Show quoteHide quote
"Robertico" <Robertico@nomail.notvalid> wrote in message
news:dh167d$don$1@localhost.localdomain...
> I'd like to print my reports to PDF.
> Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro)
> using the VB printer object. (With special thanks to Mike Williams)
> Everthing works fine, but this printer driver everytime displays a
> dialogbox and asks for path and a file name.
> Now i'am looking for an other FDF printer driver which accepts path and
> file name from VB (programly set by VB).
> As far as i know there's no registry key for Adoble PDF printer i can use.
>
> Thanks in advance,
>
> Robertico
>
Author
23 Sep 2005 7:03 PM
Saga
I have used PDF995 and recommend it. It is well worth the
approx $10usd.

I have never had the need to automatically generate files, so I
always let the dialog display and navigate and select the file
where I want the PDF, so I did not reply sooner. I can say
that it is highly configurable, so I would not doubt that this
can be done using PDF995, I am just not really sure.

Regards,
Saga


"Someone" <nob***@cox.net> wrote in message
news:hJWYe.46954$ct5.19287@fed1read04...
Show quoteHide quote
> You could use:
>
> http://www.pdf995.com/
>
> It's free with popup ads, otherwise $9.95. It has no spyware as far as
> I know. I think you could specify the file name in an INI file just
> before printing. Also, it has auto renaming feature.
>
> You could also search for another PDF printer, but make sure that the
> file that it creates is small. Some PDF printers do not use
> compression and that could be a problem when you email the file to
> somebody.
>
>
> "Robertico" <Robertico@nomail.notvalid> wrote in message
> news:dh167d$don$1@localhost.localdomain...
>> I'd like to print my reports to PDF.
>> Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro)
>> using the VB printer object. (With special thanks to Mike Williams)
>> Everthing works fine, but this printer driver everytime displays a
>> dialogbox and asks for path and a file name.
>> Now i'am looking for an other FDF printer driver which accepts path
>> and file name from VB (programly set by VB).
>> As far as i know there's no registry key for Adoble PDF printer i can
>> use.
>>
>> Thanks in advance,
>>
>> Robertico
>>
>
>
Author
23 Sep 2005 5:26 PM
Matt Williamson
Robertico-

Here is another one, with source, so if it doesn't do it, you can make it
<g>

http://sourceforge.net/projects/pdfcreator/

HTH

Matt

Show quoteHide quote
"Robertico" <Robertico@nomail.notvalid> wrote in message
news:dh167d$don$1@localhost.localdomain...
> I'd like to print my reports to PDF.
> Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro)
> using the VB printer object. (With special thanks to Mike Williams)
> Everthing works fine, but this printer driver everytime displays a
> dialogbox and asks for path and a file name.
> Now i'am looking for an other FDF printer driver which accepts path and
> file name from VB (programly set by VB).
> As far as i know there's no registry key for Adoble PDF printer i can use.
>
> Thanks in advance,
>
> Robertico
>
Author
23 Sep 2005 7:23 PM
Saga
Here is another link to the same project:

http://sector7g.wurzel6.de/pdfcreator/download_en.htm

Here it details that it needs an external component for this to
work, the Ghost writer. Just thought I'd mention it.

Saga

Show quoteHide quote
"Matt Williamson" <ih8spam@spamsux.org> wrote in message
news:%23k9a5PGwFHA.3860@TK2MSFTNGP09.phx.gbl...
> Robertico-
>
> Here is another one, with source, so if it doesn't do it, you can make
> it <g>
>
> http://sourceforge.net/projects/pdfcreator/
>
> HTH
>
> Matt
>
> "Robertico" <Robertico@nomail.notvalid> wrote in message
> news:dh167d$don$1@localhost.localdomain...
>> I'd like to print my reports to PDF.
>> Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro)
>> using the VB printer object. (With special thanks to Mike Williams)
>> Everthing works fine, but this printer driver everytime displays a
>> dialogbox and asks for path and a file name.
>> Now i'am looking for an other FDF printer driver which accepts path
>> and file name from VB (programly set by VB).
>> As far as i know there's no registry key for Adoble PDF printer i can
>> use.
>>
>> Thanks in advance,
>>
>> Robertico
>>
>
>
Author
23 Sep 2005 8:14 PM
H-Man
On Fri, 23 Sep 2005 15:33:35 +0200, Robertico wrote:

> I'd like to print my reports to PDF.
> Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro) using
> the VB printer object. (With special thanks to Mike Williams)
> Everthing works fine, but this printer driver everytime displays a dialogbox
> and asks for path and a file name.
> Now i'am looking for an other FDF printer driver which accepts path and file
> name from VB (programly set by VB).
> As far as i know there's no registry key for Adoble PDF printer i can use.
>
> Thanks in advance,
>
> Robertico

You can get the source code for PDF Creator and see how it uses Ghostscript
to create the PDF. Instead of opening a save dialog, just bypass that with
your own parameters. You should be able to slim the program down a lot.


--
HK
Author
23 Sep 2005 11:23 PM
John K.Eason
In article <dh167d$don$1@localhost.localdomain>, Robertico@nomail.notvalid
(Robertico) wrote:

Show quoteHide quote
> *From:* "Robertico" <Robertico@nomail.notvalid>
>
> I'd like to print my reports to PDF.
> Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro)
> using the VB printer object. (With special thanks to Mike Williams)
> Everthing works fine, but this printer driver everytime displays a
> dialogbox and asks for path and a file name.
> Now i'am looking for an other FDF printer driver which accepts path and
> file name from VB (programly set by VB).
> As far as i know there's no registry key for Adoble PDF printer i can
> use.
>
> Thanks in advance,
>
> Robertico

The Win2PDF printer driver uses registry keys to allow VB to set the
output path, filename, author, subject, keywords and a whole bunch of
other stuff using the SaveSetting() function. Note that it only work with
NT/2000/XP and above. Works fine for me on XP.

You can get it from http://www.daneprairie.com and try it before you buy.

Regards
       John (john@jeasonNoSpam.cix.co.uk) Remove the obvious to reply...
Author
24 Sep 2005 1:52 AM
Lee Peedin
Look at the properties of the Adobe PDF driver - you have the ability
to "turn off" the prompt for file name and you will be able to define
a "static" path for all PDF files created.

In order to keep track of "what is what" set app.title in your VP
program and that will be the name of the document in the queue and the
saved document.

I only create several hundred PDF files per day using this.

Lee

On Fri, 23 Sep 2005 15:33:35 +0200, "Robertico"
<Robertico@nomail.notvalid> wrote:

Show quoteHide quote
>I'd like to print my reports to PDF.
>Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro) using
>the VB printer object. (With special thanks to Mike Williams)
>Everthing works fine, but this printer driver everytime displays a dialogbox
>and asks for path and a file name.
>Now i'am looking for an other FDF printer driver which accepts path and file
>name from VB (programly set by VB).
>As far as i know there's no registry key for Adoble PDF printer i can use.
>
>Thanks in advance,
>
>Robertico
>
Author
24 Sep 2005 1:21 PM
Lee Peedin
Robertico,
Here's all you need to do:
Start > Control Panel > Printers & Faxes
Right click Adobe PDF - select Properties
On the General tab select Printing Preferences
Remove the check mark by the following:
  View Adobe PDF Results
  Prompt For PDF Name
  Ask To Replace Existing PDF File
Click Apply
Click OK

Now select the Ports tab
Click Add A Port
  Be sure Adobe PDF Port is selected then
  select New Port (NOT New Port Type)
  Now browse for the static path you would like to
  save all PDF files to
  Click Close, Apply

And you're all set to produce unattended PDF files.  And don't forget
to use app.title to give your PDF file a unique name.

HTH
Lee



On Sat, 24 Sep 2005 01:52:15 GMT, Lee Peedin
<lpeedinREM***@UPPERCASEnc.rr.com> wrote:

Show quoteHide quote
>Look at the properties of the Adobe PDF driver - you have the ability
>to "turn off" the prompt for file name and you will be able to define
>a "static" path for all PDF files created.
>
>In order to keep track of "what is what" set app.title in your VP
>program and that will be the name of the document in the queue and the
>saved document.
>
>I only create several hundred PDF files per day using this.
>
>Lee
>
>On Fri, 23 Sep 2005 15:33:35 +0200, "Robertico"
><Robertico@nomail.notvalid> wrote:
>
>>I'd like to print my reports to PDF.
>>Now i'am using the 'Adobe PDF printer' driver (Adobe Acrobat 6.0 Pro) using
>>the VB printer object. (With special thanks to Mike Williams)
>>Everthing works fine, but this printer driver everytime displays a dialogbox
>>and asks for path and a file name.
>>Now i'am looking for an other FDF printer driver which accepts path and file
>>name from VB (programly set by VB).
>>As far as i know there's no registry key for Adoble PDF printer i can use.
>>
>>Thanks in advance,
>>
>>Robertico
>>
Author
24 Sep 2005 2:29 PM
Robertico
Show quote Hide quote
> Here's all you need to do:
> Start > Control Panel > Printers & Faxes
> Right click Adobe PDF - select Properties
> On the General tab select Printing Preferences
> Remove the check mark by the following:
>  View Adobe PDF Results
>  Prompt For PDF Name
>  Ask To Replace Existing PDF File
> Click Apply
> Click OK
>
> Now select the Ports tab
> Click Add A Port
>  Be sure Adobe PDF Port is selected then
>  select New Port (NOT New Port Type)
>  Now browse for the static path you would like to
>  save all PDF files to
>  Click Close, Apply
>
> And you're all set to produce unattended PDF files.  And don't forget
> to use app.title to give your PDF file a unique name.

As i mentioned in my first post, i also need to set the path to save the
file.
To be more specific,  i need a dynamic path and not a static path.
Thanks anyway.

Robertico
Author
25 Sep 2005 8:27 AM
Mark Yudkin
Robertico, you do NOT need a dynamic path for the file, what you need is
that the output be stored where you want it (dynamic path).

Lee has told you that he creates 100s of PDFs per day, and how to name the
file dynamically. The rest is a trivial matter of moving the file from where
it's created to where you want it, which you do in your code.

Show quoteHide quote
"Robertico" <Robertico@nomail.notvalid> wrote in message
news:dh3trn$792$1@localhost.localdomain...
>> Here's all you need to do:
>> Start > Control Panel > Printers & Faxes
>> Right click Adobe PDF - select Properties
>> On the General tab select Printing Preferences
>> Remove the check mark by the following:
>>  View Adobe PDF Results
>>  Prompt For PDF Name
>>  Ask To Replace Existing PDF File
>> Click Apply
>> Click OK
>>
>> Now select the Ports tab
>> Click Add A Port
>>  Be sure Adobe PDF Port is selected then
>>  select New Port (NOT New Port Type)
>>  Now browse for the static path you would like to
>>  save all PDF files to
>>  Click Close, Apply
>>
>> And you're all set to produce unattended PDF files.  And don't forget
>> to use app.title to give your PDF file a unique name.
>
> As i mentioned in my first post, i also need to set the path to save the
> file.
> To be more specific,  i need a dynamic path and not a static path.
> Thanks anyway.
>
> Robertico
>
>
Author
25 Sep 2005 11:25 AM
Lee Peedin
And it is a very easy to use WMI to monitor the print queue to "be
sure" your PDF has completed before attempting to move the file.
Lee

On Sun, 25 Sep 2005 10:27:33 +0200, "Mark Yudkin"
<myudkinATcompuserveDOT***@boingboing.org> wrote:

Show quoteHide quote
>Robertico, you do NOT need a dynamic path for the file, what you need is
>that the output be stored where you want it (dynamic path).
>
>Lee has told you that he creates 100s of PDFs per day, and how to name the
>file dynamically. The rest is a trivial matter of moving the file from where
>it's created to where you want it, which you do in your code.
>
>"Robertico" <Robertico@nomail.notvalid> wrote in message
>news:dh3trn$792$1@localhost.localdomain...
>>> Here's all you need to do:
>>> Start > Control Panel > Printers & Faxes
>>> Right click Adobe PDF - select Properties
>>> On the General tab select Printing Preferences
>>> Remove the check mark by the following:
>>>  View Adobe PDF Results
>>>  Prompt For PDF Name
>>>  Ask To Replace Existing PDF File
>>> Click Apply
>>> Click OK
>>>
>>> Now select the Ports tab
>>> Click Add A Port
>>>  Be sure Adobe PDF Port is selected then
>>>  select New Port (NOT New Port Type)
>>>  Now browse for the static path you would like to
>>>  save all PDF files to
>>>  Click Close, Apply
>>>
>>> And you're all set to produce unattended PDF files.  And don't forget
>>> to use app.title to give your PDF file a unique name.
>>
>> As i mentioned in my first post, i also need to set the path to save the
>> file.
>> To be more specific,  i need a dynamic path and not a static path.
>> Thanks anyway.
>>
>> Robertico
>>
>>
>
Author
27 Sep 2005 7:00 AM
Mark Yudkin
(I know, we do it too).

Show quoteHide quote
"Lee Peedin" <lpeedinREM***@UPPERCASEnc.rr.com> wrote in message
news:j72dj1p4u8l709n0017urb3mavbmfo8tsv@4ax.com...
> And it is a very easy to use WMI to monitor the print queue to "be
> sure" your PDF has completed before attempting to move the file.
> Lee
>
> On Sun, 25 Sep 2005 10:27:33 +0200, "Mark Yudkin"
> <myudkinATcompuserveDOT***@boingboing.org> wrote:
>
>>Robertico, you do NOT need a dynamic path for the file, what you need is
>>that the output be stored where you want it (dynamic path).
>>
>>Lee has told you that he creates 100s of PDFs per day, and how to name the
>>file dynamically. The rest is a trivial matter of moving the file from
>>where
>>it's created to where you want it, which you do in your code.
>>
>>"Robertico" <Robertico@nomail.notvalid> wrote in message
>>news:dh3trn$792$1@localhost.localdomain...
>>>> Here's all you need to do:
>>>> Start > Control Panel > Printers & Faxes
>>>> Right click Adobe PDF - select Properties
>>>> On the General tab select Printing Preferences
>>>> Remove the check mark by the following:
>>>>  View Adobe PDF Results
>>>>  Prompt For PDF Name
>>>>  Ask To Replace Existing PDF File
>>>> Click Apply
>>>> Click OK
>>>>
>>>> Now select the Ports tab
>>>> Click Add A Port
>>>>  Be sure Adobe PDF Port is selected then
>>>>  select New Port (NOT New Port Type)
>>>>  Now browse for the static path you would like to
>>>>  save all PDF files to
>>>>  Click Close, Apply
>>>>
>>>> And you're all set to produce unattended PDF files.  And don't forget
>>>> to use app.title to give your PDF file a unique name.
>>>
>>> As i mentioned in my first post, i also need to set the path to save the
>>> file.
>>> To be more specific,  i need a dynamic path and not a static path.
>>> Thanks anyway.
>>>
>>> Robertico
>>>
>>>
>>
>
Author
27 Sep 2005 4:12 PM
Andrei
An alternative to monitoring the printer queue (prone to error) is to
disable spooling for this printer. This way your print call will not
return until the job is completely done.

To disable spooling, right-click the printer icon in the Printers
folder and select Properties. On the Advanced tab, click the Print
Processor button and set the Default datatype to RAW. Then you can
select "Print directly to the Printer".

To set it programmatically, call OpenPrinter and GetPrinter, 'Or' in
ATTRIBUTE_DIRECT And PRINTER_ATTRIBUTE_RAW_ONLY into the Attributes
member of the PRINTER_INFO_2 structure, set the pDatatype member to
"RAW", and call SetPrinter.

For automation support and workflow integration in a raster PDF driver,
I have found the following to be outstanding:

http://www.peernet.com/epdf/index.html

A
Author
27 Sep 2005 4:32 PM
Robertico
Thanks all. I have some homework to do :-))