How to Print PDF using BI Publisher or Apache FOP in APEX 4.0.1

Hi friends.
I have a problem with APEX and print report in ouput of PDF.
My configuration is:
1. Database: Oracle 11gR2 Standart Edition
2. APEX version: 4.0.1
3. APEX Listener version: 1.0.2.238.15.24
4. Oracle WebLogic Server version: 10.1.3.3.0
5. Oracle BI Publisher version: 10.1.3.4.1
6. Apache Tomcat version: 6.0
7. Cocon version: 2
8. Operating System of Install Weblogic Server, BI Publisher, Apache Tomcat is Windows 2008 Server 32 bits.
9. Operating System of Install Database is HP-UX 11i
Ive configured a weblogic Server with BI Publisher and I have also configured the printing properties of the APEX Server with the following settings:
Tab Report Printing.
Print Server: Advanced(Rqueries Oracle BI Publisher)
Print Server Protocol: HTTP
Print Server Host Address: 174.17.49.106
Print Server Port: 7001
Print Server Script: /xmlpserver/convert
When I want to print the report in a PDF format it returns me the following error:
ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.
Error failed
I have search for documentation but i cant still print the report.
I would appreciate a lot if anyone of you guys can help me figure this out

Hello Tux Dueñas,
I think you need to have ACL's setup in Oracle 11g in order to be able to connect to the BI Publisher server. Check the following link on how to setup ACL's in 11g...
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI
Thanks,
Machaan
Edited by: Machaan on Jan 25, 2011 11:49 AM

Similar Messages

  • How to email Pdfs Using BI PUBLISHER

    Hi ,
    we have a bi publisher report which generates AR Pdf Invoices.
    We have a requirement that when bi publisher generates pdf invoices it should send an email to the customer with the pdf file as attatchment.
    The Customer name will be on the invoice.Now in bursting file we have the code like
    <?xml version="1.0" encoding="UTF-8" ?>
    - <!-- $Header: BURSTING_FILE_XXXX_AR_XXXINVOU1.xml 115.3 2009/01/27 01:11:57 xdouser noship $
    -->
    - <!-- dbdrv: none
    -->
    - <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    - <xapi:request select="/XXXINVOU/LIST_G_INVOICE_HDR/G_INVOICE_HDR">
    - <xapi:delivery>
    <xapi:filesystem output="${CF_PDF_DIR}/${D_PDF_FILE_NAME}" />
    </xapi:delivery>
    - <xapi:document output-type="pdf">
    <xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 240 or C_ORG_ID = 330 or C_ORG_ID = 407 or C_ORG_ID = 994 or C_ORG_ID = 1174" />
    <xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_AUSTRALIA.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 592" />
    <xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_JAPAN.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 550" />
    <xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_SWEDEN.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID = 852 or C_ORG_ID = 1913 or C_ORG_ID = 1973 or C_ORG_ID = 1873" />
    <xapi:template type="rtf" location="xdo://XXXX_AR.XXXINVOU1_GENERIC.en.US/?getSource=true" filter=".//G_INVOICE_HDRC_ORG_ID != 240 and C_ORG_ID != 330 and C_ORG_ID != 407 and C_ORG_ID != 550 and C_ORG_ID != 592 and C_ORG_ID != 994 and C_ORG_ID != 1174 and C_ORG_ID != 852 and C_ORG_ID != 1913 and C_ORG_ID != 1973 and C_ORG_ID != 1873" />
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    could anyone please suggest me what code i should add to this and where should i add.
    Thanks,
    M

    Are you using Oracle's BI Publisher (the full module)? or are you using the BI Publisher that comes as part of PeopleSoft Application?
    The reason I am asking is that we have a similar request were we need to email out our ACH advices from Accounts Payable and I have been told we need to create an application engine program to run the BI Publisher report and then email thru the SendMail() function.
    I am just trying to see if anyone has already done something like this as I cannot find sample app engine coding to run, save and email an ACH pdf file.
    Thanks.
    Jennifer

  • How to print PDF files using java print API

    Hi,
    I was goign throw lot of discusion and reading lot of forums related to print pdf files using java api. but nothing seems to be working for me. Can any one tell me how to print pdf files using java api.
    Thanks in advance

    Mike,
    Can't seem to get hold of the example described in your reply below. If you could let us have the URL to get then it would be great.
    My GUI application creates a pdf document which I need to print. I want to achieve this using the standard Java class PrinterJob (no 3rd party APIs I'm afraid, commercial restraints etc ..). I had a stab at it using the following code. When executed I get the pretty printer dialog then when I click ok to print, nothing happens!
    boolean showPrintDialog=true;
    PrinterJob printJob = PrinterJob.getPrinterJob ();
    printJob.setJobName ("Contract.pdf");
    try {
    if (showPrintDialog) {
    if (printJob.printDialog()) {
    printJob.print();
    else
    printJob.print ();
    } catch (Exception PrintException) {
                   PrintException.printStackTrace();
    Thank you and a happy new year.
    Cheers,
    Chris

  • How to print Pdf files using Adobe Reader

    How to print Pdf files using Adobe Reader

    Open the PDF file with File > Open... in Adobe Reader and print it with File > Print

  • How do you setup to print PDFs using adobe?

    How do you setup to print PDFs using adobe?

    You install Adobe Acrobat, and 'Print to PDF' will be automatically set up.

  • How to print PDF file with hp-ux 11.31 on itanium

    We finished upgrade from 11.5.7 to 12.1.1.
    With 11.5.7 ( pa-risc hp-ux 11.23 ) we print our pdf file in using acroread to convert them in postscript and print them to printer.
    In our 12.1.1 environment ( itanium hp-ux 11.31 ) ; acroread is not available on itanium.
    Which tool can we use to be able to print PDF file on itanium ( itanium pdf to postscript tool ) free
    Thanks
    Marc

    Pl see MOS Doc 778970.1 (How to Print PDF/UTF8 in R12?)
    HTH
    Srini

  • Cannot generate chart in PDF using BI Publisher

    I have a java program to generate chart in PDF using BI publisher. In some platforms the chart cannot be generated. Get the following exception.
    [061812_075947838][][ERROR] java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.invokeMethod(Unknown Source)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.generateChartAsBase64(Unknown Source)
    at oracle.apps.xdo.template.rtf.XSLTFunctions.chart_svg(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.xdo.parser.v2.XSLExtFunctions.callStaticMethod(XSLExtFunctions.java:111)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluateMethod(XPathExtFunction.java:307)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluate(XPathExtFunction.java:226)
    at oracle.xdo.parser.v2.XSLValueOf.processAction(XSLValueOf.java:101)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:512)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
    at com.edocs.common.reporting.batch.BatchEventHandler.generatePDFFile(BatchEventHandler.java:327)
    at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:252)
    at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:136)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:126)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:46)
    at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NoSuchMethodError: oracle.dss.util.CustomStyle.<init>(Ljava/io/InputStream;)V
    at oracle.dss.graph.CommonGraph.setStyleStream(CommonGraph.java:10774)
    at oracle.dss.graph.CommonGraph.setStylePath(CommonGraph.java:10743)
    at oracle.dss.graph.CommonGraph.setStylePathXML(CommonGraph.java:12138)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:13348)
    at oracle.dss.graph.CommonGraph._setXML(CommonGraph.java:15821)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:14751)
    at oracle.dss.graph.Graph.setXML(Graph.java:5243)
    ... 60 more
    In office word bi publisher plugin, load the xml, the chart can be generated.
    The above exception only occurs in some linux and solaris platforms, but never occurs in windows.
    The following plateform throws exception.
    Oracle Linux Server release 5.6 + java version "1.6.0_25"
    The following plateform doesn't throw exception.
    Enterprise Linux Enterprise Linux Server release 5.4 (Carthage) + java version "1.6.0_05"
    The strange thing is in those platforms which can throw exception, if the code is not running in EJB, the chart still can be generated.
    In other words, if the normal web or standalone app invokes that program; the chart can be generated.
    The java code is as below.
         public static void generate(String inputXML, String pdfTempPath, String outputPDF) {
              Reader reader = null;
              try {
                   File xmlFile = new File(inputXML);
         reader = new BufferedReader(new InputStreamReader(new FileInputStream(xmlFile), "UTF-8"));               
              ByteArrayOutputStream tmpXSL = new ByteArrayOutputStream();           
              RTFProcessor rtfProcessor = new RTFProcessor(pdfTempPath);
                   rtfProcessor.setOutput(tmpXSL);
                   rtfProcessor.process();           
              ByteArrayInputStream in = new ByteArrayInputStream(tmpXSL.toByteArray());
              FOProcessor processor = new FOProcessor();
              processor.setData(reader);
              processor.setTemplate(in);
              processor.setOutput(outputPDF);
              processor.setOutputFormat(FOProcessor.FORMAT_PDF);           
              processor.generate();
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try {
                        if(reader!=null) {
                             reader.close();
                   } catch (Exception e) {
    Can anyone explain why this exception is thrown?
    Thanks a lot.

    Hello Tux Dueñas,
    I think you need to have ACL's setup in Oracle 11g in order to be able to connect to the BI Publisher server. Check the following link on how to setup ACL's in 11g...
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI
    Thanks,
    Machaan
    Edited by: Machaan on Jan 25, 2011 11:49 AM

  • How to print PDF files

    How to print PDF files????

    Please see FAQ: How to print a PDF file from Adobe Reader Touch.
    If you don't see the Print button in the toolbar, please update to the latest version of Adobe Reader Touch.
    FAQ: How to update Adobe Reader Touch to the latest version
    The latest version (1.2) also includes newly supported features such as Commenting (adding Sticky Notes, Highlight, Strikeout, and Underline), Save/Save As, and Go to Page.
    Here's the blog post by Dennis Griffin (Product Manager for Adobe Reader for Tablets and Smartphones).
    Adobe Reader Touch for Windows 8 adds Comments and More

  • How to print PDF documents on Unix(Solaris)

    Hi ,
    I wanted to know how to print PDF documents on Unix(Solaris)?
    Is there a document or white paper that i can refer to start printing PDF document.
    What kind of drivers/utilities will be required to achieve the objective?
    Kiran

    Have you tried FOXIT? I think there is a trialversion. I tried Adobereader 2.5 but there is still no option to print.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • How to print Barcode using SAPscript?

    hello, everyone.
    I have some questions.
    now, I have to print some doc. that described by barcode in sapscript form.
    so, try to test in t-code so10
    input value SAPSCRIP-BARCODETEST, ST, EN.
    and click 'print-preview'
    result is correctly output in pint privew.
    but when I print dis priviewed doc. disappeared barcode image.
    is this O.K??
    I have to do something?? (Add DLL file, barcode font or etc....)
    I don't know how to print barcode using SAPScript. anybody solve this problem.please.
    p.s this system is SAP ECC 6.0 only ABAP.
    printer setting is front-end print.

    hello, everyone.
    I have some questions.
    now, I have to print some doc. that described by barcode in sapscript form.
    so, try to test in t-code so10
    input value SAPSCRIP-BARCODETEST, ST, EN.
    and click 'print-preview'
    result is correctly output in pint privew.
    but when I print dis priviewed doc. disappeared barcode image.
    is this O.K??
    I have to do something?? (Add DLL file, barcode font or etc....)
    I don't know how to print barcode using SAPScript. anybody solve this problem.please.
    p.s this system is SAP ECC 6.0 only ABAP.
    printer setting is front-end print.

  • How to print documents using correspondence types?

    Sir/Madam,
    I am in the process of preparing the End User document for "How to print documents using correspondence types?  on client request.Plz give me the required stuff to prepare that.This is an urgent requirement.help me ASAP.
    Thanks in advance
    Regards
    Sap Guru
    [email protected]

    Hi
    use t.codes, FB12 & F.64
    Award points if it is useful
    Regards,
    A.Anandarajan

  • How to print pdf file not using the the adobe reader ?

    hello,
    i used the adobe sdk to open a pdf file in read and modify it serveral times and each time save it to another directory,and now i need to write a program to print the pdf file in this directory.when print the file,i want to continue my work also,so who i tell me how to solve this problem?
    thanks.

    The SDK is only a collection of documentation and headers that show you how to interact with and automate Adobe Acrobat and to some extent Adobe Reader. You need a copy of Acrobat or Reader installed on the system in order to use any of the SDK functions. You cannot "print not using the Adobe Reader", unless you have Adobe Acrobat installed on the system instead of Reader.

  • How to print pdf files not using acrobat product?

    i just want to print pdf files,but not want to use the adobe acrobat or acrobat reader,just want to write a tools print pdf files directly.

    > no i just want to print it,not need to read it.can you help me?
    Well, the problem is to print it you need to be able to read it. Something needs to convert it into a format the printer can understand (most printers are PostScript or PCL).
    I'm not sure you entirely understand what a PDF file is. It's not a fancy text file. It's a binary format. Saying "I want to print a PDF without a PDF interpreter" is like saying "I want to run an EXE without Windows". You need software to interpret the format.
    You certainly can write your own software to interpret the PDF format, convert it to a print language and output that to a printer, but as Aandi said you will need to start by reading the PDF Reference so you know how the inside of a PDF file works, and it will most likely take several years of development even for a seasoned, expert programmer. It's just not as simple as "Printer, meet PDF. PDF, meet printer."

  • How to print pdf file in SQL Server Reporting services report using command prompt?

    Is there a way to automatically print a SQL Server Reporting services report on command prompt? For eg: We can save a pdf file using rs.exe utility. I want to print a pdf using rs.exe utility. Is it possible? I don't want to install any 3rd party software.

    Thanks Simon for replying to my question.
    In oracle form, there is oracle command to print the report from command prompt with the help of rwrun.exe
    e.g: rwrun.exe   REPORT="D:\Test\REP_25\MLA.REP" DESNAME="testprinter" DESTYPE="PRINTER" P_FORMNAME="MLA.FMX" P_SPRACHE="E" P_SPRACHE_NR2="1" P_WHERE_BEDINGUNG="order by land_nr" USERID="test/test.world" PSV_NAME="PSV_DEMO" PSV_JOB_ID="PS$9583" RECURSIVE_LOAD="NO"
    BATCH="YES" NONBLOCKSQL="NO" ARRAYSIZE="1" PARAMFORM="NO" ERRFILE="c:\temp\psv16.tmp"<
    and to save the report we just need to change DESNAME="c:\temp\OC_100001349.pdf" DESTYPE="FILE" in above command instead of DESNAME="testprinter" DESTYPE="PRINTER".
    DESNAME and DESTYPE are the input parameters of the respective report.
    In SSRS, we can run the file from the command prompt and save it.
    rs -i "C:\Users\pujarswa\Documents\reports\new\LoadReport.rss" -s ww2004760:80/ReportServer_MSSQL -v fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"
    -v reportPath="/TipsReport/LoadListTabular" -t -v format="PDF" -v LandNr=4 -u ap\swati -p test@# -e Exec2005
    But we cannot use same command for printing as you said we need to create another script for printing files.
    I have gone through the links but I dont want to use Adobe Acrobat Reader exe for printing because client it may not have Adobe Acrobat Reader on their machine.
    Also I want to pass a input parameter as type="Printer" to my report which will print directly for me and same I can acheive in command prompt passing type="Printer" fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"

  • How to  print pdf file by using java print API ? I am trying with this code

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

Maybe you are looking for

  • ITunes DJ and Coverflow / Top menu issue

    Any updates on this subject? While in version 9 iTunes looked the same as in the thread above, looks have changed a bit now, but still look bad. I spent a lot of time building my library and do not feel like doing al this work again. If no satisfacto

  • Photoshop CC crashing (post mavericks update)

    The issue is that Photoshop is crashing when coming back up from my machine going to sleep and this has only started happening since I updated to mavericks.  I have not had the app crash while working, however, which is nice.  I kind of expected ther

  • Jumping to Specific URL from a cue point in video

    Hello, I am having a video play within flash CS3 and it does fine. Now, I need to tell Flash that when it reaches cue point "end", it should go to a specific web page. How can this be accomplished? I am new to Actionscript 3.0 and after trying differ

  • Iisforward and encoded URLs

    I cannot seem to get the iisproxy/iisforward combination to properly handle encoded URL session strings. I have been performing my tests with WebLogic Sever 5.1.0sp5, IIS 5 and Windows 2000 (both IE and Netscape). I use the examples.servlets.SessionS

  • Error when trying to print. Not enough storage is avail. to process command. How can I fix this?

    HP Officejet 6500 All-In-One This is what pop's up when I try to print. An error has occured in script on this page. Not enough storage is available to process command. Please tell me how to fix this, I give up! Thanks, Cindy