PDA

View Full Version : Printing PDFs from 3.2 - any ideas



Archie Campbell
1-Sep-2005, 09:25 AM
Hello Adobe Acrobat fans

I was just about to write some 3.2 console mode code to print a bunch of PDF
documents (like say 100 at a time).
Just before I go heading off in the wrong direction again, does anyone have
some thoughts about it that they would like to pass on about a good way to
do it.

Much appreciated.
Thanks
Archie

Pepe
1-Sep-2005, 10:38 AM
Have you thought of using a virtual printer to PDF. There are two which
I use:
-Adobe PDF Converter
-PDFConverter


Never used them from within Dataflex.

Hope it helps

Pepe Guimarães

Archie Campbell
1-Sep-2005, 12:11 PM
Hi Pepe

Thanks for the reply.

The converter you suggested will take a document and convert it to PDF.
In my case I already have the .PDF file and I would like to print it.

So far I have discovered:
1. A product call "Batch and Print" that has a command line interface that
will do it.

2. I am trying to shell out and run a command like
AcroRd32.exe file1.pdf /p
I cant seem to get this to work, but am continuing with it.
Once I get this to work I am not sure how I set the printer for it.


Thanks
Archie







"Pepe Guimarães" <pg@moose-software.com> wrote in message
news:K9znHywrFHA.632@dacmail.dataaccess.com...
> Have you thought of using a virtual printer to PDF. There are two which
> I use:
> -Adobe PDF Converter
> -PDFConverter
>
>
> Never used them from within Dataflex.
>
> Hope it helps
>
> Pepe Guimarães

wila
2-Sep-2005, 01:31 AM
Archie Campbell wrote:
> 2. I am trying to shell out and run a command like
> AcroRd32.exe file1.pdf /p
> I cant seem to get this to work, but am continuing with it.

Archie,
If this is 3.2 on windows then you should be able to use shellexecute
via winapi and pass "print" as action instead of the more default "open"
as parameter.

> Once I get this to work I am not sure how I set the printer for it.
The solution above would always try to print to the default printer
afaik, so it won't work for alternative printers.


--
Wil

Archie Campbell
2-Sep-2005, 01:27 PM
Thanks Wil

Is there a similar method that will allow me to change the default printer,
or have it popup up a box to select the printer

Thanks
Archie


"Wil van Antwerpen" <info@antwise.com> wrote in message
news:Ob55rf4rFHA.1204@dacmail.dataaccess.com...
> Archie Campbell wrote:
> > 2. I am trying to shell out and run a command like
> > AcroRd32.exe file1.pdf /p
> > I cant seem to get this to work, but am continuing with it.
>
> Archie,
> If this is 3.2 on windows then you should be able to use shellexecute
> via winapi and pass "print" as action instead of the more default "open"
> as parameter.
>
> > Once I get this to work I am not sure how I set the printer for it.
> The solution above would always try to print to the default printer
> afaik, so it won't work for alternative printers.
>
>
> --
> Wil

wila
3-Sep-2005, 06:23 AM
Archie,

Archie Campbell wrote:
> Thanks Wil
>
> Is there a similar method that will allow me to change the default printer,
> or have it popup up a box to select the printer

[Wil] There probably is, but i wonder if that's the solution to go after
in your case. If you need to automate more, like changing the printer to
use, then other solutions will be better. Besides that I don't think you
should mess with the default printer.

You could also try and wrap the activex pdf component of the viewer in
VDF and then call the VDF printer app from your DF application.
Officially this should work fine, but i've heard that there's
compatibility problems between different versions. So.. that might not
be the correct way either.

Alternatively you can wrap and use Internet Explorer as an activex
component (using VDF of course) and print and view the pdf document this
way. This should work fine, IE is capable of loading any version of the
pdf activex component..

But what if you can't use VDF (for whatever reason) then there surely
must be alternatives, right?
Sure there is.. it is called ghostscript.
http://www.cs.wisc.edu/~ghost/gsview/

To print a file you would this:
<snip>
To print a PostScript file, we need to tell Ghostscript the name of the
printer device. For an HP DeskJet 500 or an HP DeskJet Portable printer,
this is djet500. We would instead start Ghostscript with:

c:\gs3.53\gswin32.exe -Ic:\gs3.53;c:\gs3.53\fonts -sDEVICE=djet500
</snip>

Ghostscript allows you to get a list of available printers like this:
<snip>
To get a list of available printer devices, start Ghostscript for
displaying, then type:

GS>devicenames ==
</snip>

So there are multiple ways you could get the functionality that you're
after.

--
Wil

>
> Thanks
> Archie
>
>
> "Wil van Antwerpen" <info@antwise.com> wrote in message
> news:Ob55rf4rFHA.1204@dacmail.dataaccess.com...
>
>>Archie Campbell wrote:
>>
>>>2. I am trying to shell out and run a command like
>>> AcroRd32.exe file1.pdf /p
>>> I cant seem to get this to work, but am continuing with it.
>>
>>Archie,
>>If this is 3.2 on windows then you should be able to use shellexecute
>>via winapi and pass "print" as action instead of the more default "open"
>>as parameter.
>>
>>
>>> Once I get this to work I am not sure how I set the printer for it.
>>
>>The solution above would always try to print to the default printer
>>afaik, so it won't work for alternative printers.
>>
>>
>>--
>>Wil
>
>
>

LasseJ
11-Sep-2005, 03:23 PM
Archie,
FYI:
I tried this in VDF where I was required to print a bunch of .pdf's. When I
used Acrobat Reader via FlexCom it messed up the output in very
unpredictable ways. I then tried to use Acobat (not reader) and it worked
perfectly. In Reader the PrintOut command is a procedure which will return
to the program immediatly with no return value (of course :-)) whereas non
Reader Printout is a function that returns a value to test if it printing is
ready.
Regards
Lars J
"Archie Campbell" <archie@accordsystems.com> skrev i meddelandet
news:MgGcwgxrFHA.1276@dacmail.dataaccess.com...
> Hi Pepe
>
> Thanks for the reply.
>
> The converter you suggested will take a document and convert it to PDF.
> In my case I already have the .PDF file and I would like to print it.
>
> So far I have discovered:
> 1. A product call "Batch and Print" that has a command line interface
that
> will do it.
>
> 2. I am trying to shell out and run a command like
> AcroRd32.exe file1.pdf /p
> I cant seem to get this to work, but am continuing with it.
> Once I get this to work I am not sure how I set the printer for it.
>
>
> Thanks
> Archie
>
>
>
>
>
>
>
> "Pepe Guimarães" <pg@moose-software.com> wrote in message
> news:K9znHywrFHA.632@dacmail.dataaccess.com...
> > Have you thought of using a virtual printer to PDF. There are two which
> > I use:
> > -Adobe PDF Converter
> > -PDFConverter
> >
> >
> > Never used them from within Dataflex.
> >
> > Hope it helps
> >
> > Pepe Guimarães
>
>

Archie Campbell
12-Sep-2005, 10:57 AM
Hello Wil

Much appreciate your suggestion.
I am trying to keep the application Linux compatible at the client
workstation so I will file the VDF and IE suggestions for future reference
and check out ghostscript.

Thanks Wil

Archie


"Wil van Antwerpen" <info@antwise.com> wrote in message
news:EKK3jnHsFHA.632@dacmail.dataaccess.com...
> Archie,
>
> Archie Campbell wrote:
> > Thanks Wil
> >
> > Is there a similar method that will allow me to change the default
printer,
> > or have it popup up a box to select the printer
>
> [Wil] There probably is, but i wonder if that's the solution to go after
> in your case. If you need to automate more, like changing the printer to
> use, then other solutions will be better. Besides that I don't think you
> should mess with the default printer.
>
> You could also try and wrap the activex pdf component of the viewer in
> VDF and then call the VDF printer app from your DF application.
> Officially this should work fine, but i've heard that there's
> compatibility problems between different versions. So.. that might not
> be the correct way either.
>
> Alternatively you can wrap and use Internet Explorer as an activex
> component (using VDF of course) and print and view the pdf document this
> way. This should work fine, IE is capable of loading any version of the
> pdf activex component..
>
> But what if you can't use VDF (for whatever reason) then there surely
> must be alternatives, right?
> Sure there is.. it is called ghostscript.
> http://www.cs.wisc.edu/~ghost/gsview/
>
> To print a file you would this:
> <snip>
> To print a PostScript file, we need to tell Ghostscript the name of the
> printer device. For an HP DeskJet 500 or an HP DeskJet Portable printer,
> this is djet500. We would instead start Ghostscript with:
>
> c:\gs3.53\gswin32.exe -Ic:\gs3.53;c:\gs3.53\fonts -sDEVICE=djet500
> </snip>
>
> Ghostscript allows you to get a list of available printers like this:
> <snip>
> To get a list of available printer devices, start Ghostscript for
> displaying, then type:
>
> GS>devicenames ==
> </snip>
>
> So there are multiple ways you could get the functionality that you're
> after.
>
> --
> Wil
>
> >
> > Thanks
> > Archie
> >
> >
> > "Wil van Antwerpen" <info@antwise.com> wrote in message
> > news:Ob55rf4rFHA.1204@dacmail.dataaccess.com...
> >
> >>Archie Campbell wrote:
> >>
> >>>2. I am trying to shell out and run a command like
> >>> AcroRd32.exe file1.pdf /p
> >>> I cant seem to get this to work, but am continuing with it.
> >>
> >>Archie,
> >>If this is 3.2 on windows then you should be able to use shellexecute
> >>via winapi and pass "print" as action instead of the more default "open"
> >>as parameter.
> >>
> >>
> >>> Once I get this to work I am not sure how I set the printer for it.
> >>
> >>The solution above would always try to print to the default printer
> >>afaik, so it won't work for alternative printers.
> >>
> >>
> >>--
> >>Wil
> >
> >
> >