By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

How to prevent DISTILLER from propting output filename ?

P: n/a
Hi

I am creating a pdf by just printing on Acrobat Distiller. This is
fine.

I need to create a pdf which has a given prespecified name and I do not
wish that
Distiller prompts me for a name.

Does anyone know how to pass the output file name (thus avoiding that
Distiller open the open file dialog) ?

-tom

Jun 18 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
tld

to**************@uniroma1.it wrote:
Hi

I am creating a pdf by just printing on Acrobat Distiller. This is
fine.

I need to create a pdf which has a given prespecified name and I do not
wish that
Distiller prompts me for a name.

Does anyone know how to pass the output file name (thus avoiding that
Distiller open the open file dialog) ?

-tom


You may not want to dig this deep for this project but here is what I
did (I was too cheap to buy adobe)........

I had this same problem when I was trying to automate pdf creation. I
used GhostScript and Redmon. I created a custom vb application that
reads a text file for the file name and path and then creates a PDF
with that path and name. Pretty much you set up a postscript printer,
with a redirected port, you then set up the port to be redirected to
Redmon, from there you use a custom app that accepts a single command
line argument (you put the path to this custom app in the arugment
section for Redmon followed by a %1). This custom app will get the
path to the postscript document(in the windows temp folder) via the
argument passed from redmon, so then your custom app would call
Ghostscript to convert the postscript file to PDF to whatever name you
wanted. It sounds complicated but if you read the website and wrap
your head around actually what to do and what its doing it is pretty
simple. I have some instructions written up that I need to post on my
site sometime. This is really not as complicated as I made it sound.
http://www.cs.wisc.edu/~ghost/redmon/

http://www.cs.wisc.edu/~ghost/

http://www.cs.wisc.edu/~ghost/redmon/en/redmon.htm

If you want more detailed instructions repost or email me and Ill give
them to you.....
tc******@gmail.com

Jun 20 '06 #2

P: n/a
Thank you very much tld.

A was afraid that the solution was something along the lines you
indicate. As you say it's not terribly difficult, but it's at least
inconvenient. That Distiller product has been around for such a long
time that it's a real shame they have not been able to provide a simple
mechanism to indicate an output filename. Worst, there was one (back to
versions 4-5) based on a registry variable, and they have removed it!

It's clear they want to force a solution based on using the distiller
API (or consequently similar open source solutions you are indicating).
If you are going to publish your experience, I think it will be useful
for many persons and I will be your first reader (please let me know
when you do).

Further, if you are willing to post here more details I will be very
grateful, and I think many others will benefit from your experience.

Thank you,

-tommaso

tld ha scritto:
to**************@uniroma1.it wrote:
Hi

I am creating a pdf by just printing on Acrobat Distiller. This is
fine.

I need to create a pdf which has a given prespecified name and I do not
wish that
Distiller prompts me for a name.

Does anyone know how to pass the output file name (thus avoiding that
Distiller open the open file dialog) ?

-tom


You may not want to dig this deep for this project but here is what I
did (I was too cheap to buy adobe)........

I had this same problem when I was trying to automate pdf creation. I
used GhostScript and Redmon. I created a custom vb application that
reads a text file for the file name and path and then creates a PDF
with that path and name. Pretty much you set up a postscript printer,
with a redirected port, you then set up the port to be redirected to
Redmon, from there you use a custom app that accepts a single command
line argument (you put the path to this custom app in the arugment
section for Redmon followed by a %1). This custom app will get the
path to the postscript document(in the windows temp folder) via the
argument passed from redmon, so then your custom app would call
Ghostscript to convert the postscript file to PDF to whatever name you
wanted. It sounds complicated but if you read the website and wrap
your head around actually what to do and what its doing it is pretty
simple. I have some instructions written up that I need to post on my
site sometime. This is really not as complicated as I made it sound.
http://www.cs.wisc.edu/~ghost/redmon/

http://www.cs.wisc.edu/~ghost/

http://www.cs.wisc.edu/~ghost/redmon/en/redmon.htm

If you want more detailed instructions repost or email me and Ill give
them to you.....
tc******@gmail.com


Jun 20 '06 #3

P: n/a
tld
I think its better to at least try to use "open source" solutions to
fit a need because its tends to foster understanding for what actually
is going on behind the scenes. The problem with depending on a
commercial product is that they are dependent on you getting "hooked"
on this product and therefore do not facilitate understanding. I won't
go on preaching but I have put together a few pdfs (flow chart and
instructions) and some source code that should describe in detail what
I did to fill this need. Its like 22 lines of code and 2 open source
programs to download. You could probably have this running in half a
day. Hope this helps...

http://cs1.mcm.edu/~chavanaa/AutoPDF.zip

P.S. I hosed my website when I updated it with this link so it looks
like crap! :(

Jun 20 '06 #4

P: n/a
Thanks! Very good Tony,

really nice. I would like to propose some slight changes which, I
believe, will make your already good solution more general. As it is,
for instance, I cannot easily adapt to my specific needs.

I would like to remove the manual port setting which does not fit well
in a general program. I cannot ask my user to setup a port.

The ideal solution is something that allows to create the pdf
completely programmatically.

I would think one could just print to a file using something which
could be a replacement of a color PS driver (an open source replacement
of Distiller) and then convert the PS file to PDF. This would be quite
easy to do with Distiller and its API. I am just wondering if you could
adapt your o.s. solution along these lines.

Actually if you also have other solutions they would be fine, provided
that everything is done programmatically under the scenes. perhaps you
could also create the port programmatically (probably not very elegant)
?

What do you think Tony?

-tom

tld ha scritto:
I think its better to at least try to use "open source" solutions to
fit a need because its tends to foster understanding for what actually
is going on behind the scenes. The problem with depending on a
commercial product is that they are dependent on you getting "hooked"
on this product and therefore do not facilitate understanding. I won't
go on preaching but I have put together a few pdfs (flow chart and
instructions) and some source code that should describe in detail what
I did to fill this need. Its like 22 lines of code and 2 open source
programs to download. You could probably have this running in half a
day. Hope this helps...

http://cs1.mcm.edu/~chavanaa/AutoPDF.zip

P.S. I hosed my website when I updated it with this link so it looks
like crap! :(


Jun 20 '06 #5

P: n/a
tld
Tom,

1) The manual port setting is something that can be done
programmatically. There is actually someone who sells a package (on
http://www.mast-computer.com/) that works in conjuction with
GhostScript and Redmon to accomplish the same goal I did. His
application which costs 13 dollars (which again I was too cheap to buy)
asks for the path to Redmon and Ghostscript and then creates the port
programmitcally to those specs, so this is can definitely be done.
Depending on the scope of your project, creating the port through code
may be well worth your time.

2) My printer can be used to print programmitically. It involves two
lines of code generally, first you write a line to the file that
contains the desired pdf name, then you simple use your code to print
the document to the already setup printer. We use this current
solution to print PDFs straight from MS Access. We had some ad hoc
reports that we generate for clients from Access and last week my boss
insisted we not send snapshot format. I use a macro and write a line
to pdf name file and then call print on the report. This puts the PDF
report where ever I specify based on the client. This loops through
each client putting each file on our SFTP location for client
retrieval. Any code you have that can print can be automated.

3) As for just printing to a file, I think this presents the same
problem as printing to PDF. You still would be required to manually
enter an output file name. I have printed to a postscript file on
Linux systems via one shell command never on XP though. It would be
nice if this kind of application was available then you could skip the
whole printer port issue which I agree would ease this whole process,
does Distiller API have to ability to print to postscript via command
line arguments or passed variables? From what I saw on the API
documenation it looked like it was just concerned with taking
postscript documents to PDF. (forgive me I am pretty ignorant when it
comes to Distiller)

The Adobe® Acrobat® Distiller® application converts PostScript
language page descriptions into Portable Document Format (PDF) files.

4) So far I use this on one PC that outputs PDF reports weekly for
clients. It runs on a scheduled task and therefore its all done
programmtically. This was the limitation I had to get around in the
Mast-Computer.com product because it could only print to a specific
file name and you couldnt change it dynamically through code like I
needed to for each client. I havent had the need to install this on
mulitple end users machines but if that is the case you I would say it
may be a pain to write the code to create the port but without it, it
will be a bigger pain :(. Definitely the best thing would be to find
something that gets you a PS file with one shell command then convert
it with Ghost!!!

So what are you trying to accomplish? What type of documents do you
want to print to PDF and what is the whole process you are looking at?
Are you wanting to build a full out installation exe? I am just trying
to get a picture of your specific needs?

-Tony

Jun 21 '06 #6

P: n/a
Dear Tony,

My scenario is quite simple I am printing drawing
on the print graphics object:

PrintDocument1.Print()

where:

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

'Here I draw full color over e.Graphics ...

PageIndex += 1
If PageIndex= Me.PagesList.Count Then
e.HasMorePages = False
Else
e.HasMorePages = True
End If

End Sub
That's it. Ideally, what I would like to do is to be able to specify
just a pdf name
and then the print result (full color) should go into the pdf file.

(If possible, I would rather avoid port setting and alike)

I hope there is a simple o.s. solution to that.

PS ------------

The solution using Distiller would be as follows:
1. You print normally to a file using Distiller as print driver (this
generates a PS)
and it's done within VB.net only
2. You Distill the PS file using a single function provided by the
Distiller API
which takes the PDF name as argument

Note that for step 1 you can use *any* PS driver, provided it supports
full colors


tld ha scritto:
Tom,

1) The manual port setting is something that can be done
programmatically. There is actually someone who sells a package (on
http://www.mast-computer.com/) that works in conjuction with
GhostScript and Redmon to accomplish the same goal I did. His
application which costs 13 dollars (which again I was too cheap to buy)
asks for the path to Redmon and Ghostscript and then creates the port
programmitcally to those specs, so this is can definitely be done.
Depending on the scope of your project, creating the port through code
may be well worth your time.

2) My printer can be used to print programmitically. It involves two
lines of code generally, first you write a line to the file that
contains the desired pdf name, then you simple use your code to print
the document to the already setup printer. We use this current
solution to print PDFs straight from MS Access. We had some ad hoc
reports that we generate for clients from Access and last week my boss
insisted we not send snapshot format. I use a macro and write a line
to pdf name file and then call print on the report. This puts the PDF
report where ever I specify based on the client. This loops through
each client putting each file on our SFTP location for client
retrieval. Any code you have that can print can be automated.

3) As for just printing to a file, I think this presents the same
problem as printing to PDF. You still would be required to manually
enter an output file name. I have printed to a postscript file on
Linux systems via one shell command never on XP though. It would be
nice if this kind of application was available then you could skip the
whole printer port issue which I agree would ease this whole process,
does Distiller API have to ability to print to postscript via command
line arguments or passed variables? From what I saw on the API
documenation it looked like it was just concerned with taking
postscript documents to PDF. (forgive me I am pretty ignorant when it
comes to Distiller)

The Adobe® Acrobat® Distiller® application converts PostScript
language page descriptions into Portable Document Format (PDF) files.

4) So far I use this on one PC that outputs PDF reports weekly for
clients. It runs on a scheduled task and therefore its all done
programmtically. This was the limitation I had to get around in the
Mast-Computer.com product because it could only print to a specific
file name and you couldnt change it dynamically through code like I
needed to for each client. I havent had the need to install this on
mulitple end users machines but if that is the case you I would say it
may be a pain to write the code to create the port but without it, it
will be a bigger pain :(. Definitely the best thing would be to find
something that gets you a PS file with one shell command then convert
it with Ghost!!!

So what are you trying to accomplish? What type of documents do you
want to print to PDF and what is the whole process you are looking at?
Are you wanting to build a full out installation exe? I am just trying
to get a picture of your specific needs?

-Tony


Jun 21 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.