• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

"AcroRd32.exe /t" print a PDF document ( print only, no need to open )

New Here ,
Oct 25, 2007 Oct 25, 2007

Copy link to clipboard

Copied

I'm using the following command to print a PDF document:
"D:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe" /t "D:\R104-20071025165656.pdf" "\\192.168.0.4\hp" "hp LaserJet 1000" "\\192.168.0.4\hp"

Now it works fine! But I have more request:
I want a command that only send the file to printer and no need to open the PDF file on local system.
So anybody can help me?

Thanks in advance!

Views

31.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 25, 2007 Oct 25, 2007

Copy link to clipboard

Copied

The Acrobat SDK has details on the supported interfaces to Acrobat
(this isn't one of them). A few of them work with the free Reader too.
Command lines were declared obsolete by Microsoft around 1992.

Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 25, 2007 Oct 25, 2007

Copy link to clipboard

Copied

Thanks very much! Aandi Inston.

So I think I need to study Acrobat SDK or find another method to resolve this problem.

Thanks again!

Muiz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 25, 2007 Oct 25, 2007

Copy link to clipboard

Copied

> Command lines were declared obsolete by Microsoft around 1992.

Fortunately, no one paid much attention, and the *nix guys simply chuckled.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 25, 2007 Oct 25, 2007

Copy link to clipboard

Copied

I use a JAVA program to create a PDF file and then just want to send the generated file to printer to print. That's all. I'm trying to find an easy way to achieve this request.

Muiz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2007 Oct 26, 2007

Copy link to clipboard

Copied

Dear all, now I use Jasperreport to generate the PDF file and then send it to printer.

Just update to you.

Thanks for you help!

Muiz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2007 Oct 26, 2007

Copy link to clipboard

Copied

Hi Muiz,

I am also using JasperReports and I have the same problem, I am developing a web application and I generate a report in a servlet. How can I send it directly to the client's default printer, without showing it?

I am sorry if this is offtopic,

Pedja

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 26, 2007 Oct 26, 2007

Copy link to clipboard

Copied

> How can I send it directly to the client's default printer, without showing it?

You can't. This would be considered a very bad thing.

Imagine if you visited a web site and the advertisers could choose to
start printing their adverts!

Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2007 Oct 26, 2007

Copy link to clipboard

Copied

Dear Pedja,

My program is a desktop application, no a web application. It's not the same as you. And hope the following codes can help you :)

private void exportReportToPrinter(JasperPrint jasperPrint,int copyNum, String printerName, MediaSizeName mediaSizeName) throws Exception
{
// create the print service exporter so that we can print to a named
// printer
JRPrintServiceExporter exporter = new JRPrintServiceExporter();

// set the report to print
exporter.setParameter(JRPrintServiceExporterParameter.JASPER_PRINT, jasperPrint);

// tell the exporter to print 1 copy on A4 paper
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(new Copies(copyNum));
aset.add(mediaSizeName);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, aset);

// let the exporter know which printer we want to print on
PrintServiceAttributeSet serviceAttributeSet = new HashPrintServiceAttributeSet();
serviceAttributeSet.add(new PrinterName(printerName, null));
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, serviceAttributeSet);

// print it
exporter.exportReport();
}

Muiz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2007 Oct 27, 2007

Copy link to clipboard

Copied

Thanks for the code, Muiz! I don't know if I can use this in my web app but I've already accepted this as 'not possible' so if I manage to do any progress - good for me! 🙂 Thanks again!

Pedja

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 28, 2007 Oct 28, 2007

Copy link to clipboard

Copied

Pedja, you're welcome!

If you want to achieve this function, you can use JavaScript. I remember sb. using javascript to resolve this problem. But I forgot where I find it. Good luck :)

Muiz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 22, 2008 Feb 22, 2008

Copy link to clipboard

Copied

LATEST
Dear all,

What if what is intended to print some other pdf file instead of a report generated from Jasper?

Calling programs thru command-line arguments cannot be deprecated because is the simplest platform-independent way to call other programs.

When I use Acroread32.exe /t file.pdf <UNCName> <printServName>, I send the command by another process that calls Runtime.getRuntime().exec(strExecution). The problem is that if I run the program, an Reader display shows to me (which is unnecessary), and if another app is calling this sentence, an Acro32.exe process is started upon Task Manager but it hangs-up, and remains "zombie". The printjob never completes.

Please any help will be appreciated. Thank you very much.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines