If I wanna print an AI file on a t-shirt...???

Would it be okay, first to save the file as an EPS and then open it i photoshop and save it as an PNG? Or will it make the image quality horrible?
Thanks in advance.

Finkaninus,
Or will it make the image quality horrible?
It may very well.
Why not just print from Illy or Save As/Print to PDF and tkae it from there?
If I wanna print an AI file on a t-shirt...???
If you wanna print, print.

Similar Messages

  • How to print a HTML file in browser look using DocPrintJob

    Hello guys,
    Does anyone know how to print HTML output/file into browser look?
    I'm using DocPrintJob and the DocFlavor set to DocFlavor.INPUT_STREAM.AUTOSENSE.
    posted below is my code :
    public class BasicPrint {
        public static void main(String[] args) {
            try {
                // Open the image file
                String testData = "C:/new_page_1.html";
                InputStream is = new BufferedInputStream(new FileInputStream(testData));
                DocFlavor flavor =  DocFlavor.INPUT_STREAM.AUTOSENSE;
                // Find the default service
                PrintService service = PrintServiceLookup.lookupDefaultPrintService();
                System.out.println(service);
                // Create the print job
                DocPrintJob job = service.createPrintJob();
                Doc doc= new SimpleDoc(is, flavor, null);
                // Monitor print job events; for the implementation of PrintJobWatcher,
                // see e702 Determining When a Print Job Has Finished
                PrintJobWatcher pjDone = new PrintJobWatcher(job);
                // Print it
                job.print(doc, null);
                // Wait for the print job to be done
                pjDone.waitForDone();
                // It is now safe to close the input stream
                is.close();
            } catch (PrintException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
        static class PrintJobWatcher {
            // true iff it is safe to close the print job's input stream
            boolean done = false;
            PrintJobWatcher(DocPrintJob job) {
                // Add a listener to the print job
                job.addPrintJobListener(new PrintJobAdapter() {
                    public void printJobCanceled(PrintJobEvent pje) {
                        allDone();
                    public void printJobCompleted(PrintJobEvent pje) {
                        allDone();
                    public void printJobFailed(PrintJobEvent pje) {
                        allDone();
                    public void printJobNoMoreEvents(PrintJobEvent pje) {
                        allDone();
                    void allDone() {
                        synchronized (PrintJobWatcher.this) {
                            done = true;
                            PrintJobWatcher.this.notify();
            public synchronized void waitForDone() {
                try {
                    while (!done) {
                        wait();
                } catch (InterruptedException e) {
    }the printed ouput for this code will be look like this
    <html>
    <body>
    <div style="page-break-after:'always';
                background-color:#EEEEEE;
                width:400;
                height:70">
         testPrint</div>
    ABCDEFGHIJK<p>
     </p>
    </body>
    </html>however, the output that i want is the HTML in browser look not HTML code itself.
    i've tried to change the DocFlavor into any TEXT_HTML type but it gives error:
    sun.print.PrintJobFlavorException: invalid flavor if you guys has any idea or solution, can you share with me... already search in Google but still not found any solution
    Thanks in advanced.

    hi,
    do the following
    URL url = null;
    try
         url = new URL("http://www.xyz.com");
    catch (MalformedURLException e)
          System.out.println("URL not correct " + e.toString());
    if (url != null)
           getAppletContext().showDocument(url,"_blank"); //shows the page in a new unnamed top level browser instance.
    }hope that helpz
    cheerz
    ynkrish

  • Cannot print a PDF file after upgrading to Windows 8.1

    Cannot print a PDF file after upgrading to Windows 8.1
    I can print anything else from either the Desktop or Start but not a PDF.  No error message but just does not print.
    Update: down loaded Adobe Reader which runs on the desktop so when I read a PDF file it now runs on the desktop and I can print it.

    Cannot print a PDF file after upgrading to Windows 8.1
    I can print anything else from either the Desktop or Start but not a PDF.  No error message but just does not print.
    Update: down loaded Adobe Reader which runs on the desktop so when I read a PDF file it now runs on the desktop and I can print it.

  • Error (InvalidArgsError) when Printing to a file with Adobe Acrobat 9.0 Interop SDK

    Hi,
    i am getting a error (Invalid arguments) when trying to print to a file with the Adobe Acrobat  SDK 9.0. When i use Adobe Acrobat 7.0 it works correctly. I set the fileName Property as follow:
    printerParamsType.InvokeMember("fileName", BindingFlags.SetProperty, null, printerParams, new object[] { path2RawFile });
    fileName has the value:  /c/temp/Rawfiles/df76eccc-2465-4f60-a4e7-d11d8da6ed64.prn
    [9464] System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.Runtime.InteropServices.COMException (0x000003E9): InvalidArgsError: Invalid arguments.
    thanks

    Hello,
    I'm sorry you're having trouble with Acrobat. Unfortunately,
    these forums are specific to the
    Acrobat.com website and its set of hosted services, and do
    not cover the Acrobat family of desktop products.
    Any questions related to the Acrobat family of desktop
    products would be best suited in the Acrobat Forums:
    Link to
    Acrobat Forums
    Thanks!
    Michelle

  • On my new Imac, I had the trial version of Pages, and saved some files in it. Now I have purchased the full version from Apple via a download, but I cannot save or print the old files, please help!

    On my new Imac I saved some files on the free trial version of Pages, since downloading the full version from Apple, have been unable to save or print from old files saved when using the trial version. Any ideas? Thank you!

    My guess is the 30-day trial period has expired but you didn't remove the trial before installing the full version. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user.
    Yvan Koenig has written an AppleScript that removes the files. You can find it on his iDisk in For_iWork > iWork '09 > uninstall iWork '09.zip.

  • I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    Are you trying to Print to PDF or are you trying to Print a PDF file to a physical printer?

  • How to Print Post Script Files

    Hi All,
    I am trying to make a utility software in foxpro that could print post script file on:-
    1) Post script printer
    2) Non Post Script printer
    Operating System Windows 95 & above
    Help is requested from all the community members
    Reagards
    Harsh

    PostScript printer - send it to the printer port e.g. LPT1: with a simple copy.
    Non-PostScript printer - you'll need to buy a PostScript RIP, or perhaps use Acrobat Distiller to convert the PostScript to PDF, then print the PDF with Acrobat's API - see the Acrobat SDK. (This is not possible with the free Reader).

  • Printing all of file to printer

    I have written some code to print from a file to a printer. The problem is that only the first page prints out and the rest do not. Here's more clarification:
    Becasue I assume that in a file about 45 lines make up a normal page I am able to get the right amount of pages to be displayed in the dialog and to print, but still, the first page is printed fine and the rest are blank. I am baffled as to what I'm doing wrong. I have also noticed that many other people have had the same problem, but with no solutions. It seems as though the print method of the printable interface is called twice for every page with a different graphics element, and I don't know if that is what is causing my problem or not. I am using the jdk 1.3.1 - is that a problem? Here is my code and if anyone can propose a solution to the blank pages problem I would be very grateful!
    import java.awt.*;
    import java.awt.print.*;
    import java.io.*;
    import javax.swing.*;
    public class MyPrinter implements Runnable {
    protected PrinterJob job;
    protected MyPrintable myPrint = new MyPrintable();
    protected MyPageable myPage = new MyPageable();
    protected MyDialog dialog = new MyDialog();
    protected RandomAccessFile raf;
    //protected Startmenu mainMenu;
    protected String fileName;
    protected File printFile;
    protected int numPages = 0;
    public MyPrinter() { } // end constructor
    public void printFile(String name) {// gives error message if file doesn't exist!
    printFile = new File(name);
    fileName = name;
    if((printFile.exists()) && (printFile.canRead())) {
    Thread myThread = new Thread(this);
    myThread.start();
    } // end if
    else {
    dialog.showError("Datei "+fileName+" existert nicht!", "Fehler mit Drucken");
    } // end else
    } // end printFile
    public void run() {
    numPages = findNumPages();
    job = PrinterJob.getPrinterJob();
    job.setPageable(myPage); // this is an instance of Pageable
    if(job.printDialog()) { // user didn't cancel the printing
    try {
    job.print();
    try { raf.close(); } // end try
    catch(IOException e) { dialog.showError("Fehler: "+e.getMessage(), "Problem");}
    } // end try
    catch (PrinterException pe) {dialog.showError("Fehler: "+pe.getMessage(), "Problem");}
    } // end if
    } // end run
    private int findNumPages() {
    try {
    numPages = 0;
    raf = new RandomAccessFile(fileName, "r");
    int fileLength = (int)printFile.length();
    int lineNumber = 0;
    while((int)raf.getFilePointer() < fileLength) {
    lineNumber = 0;
    while((((int)raf.getFilePointer()) < fileLength) && (lineNumber < 45)) {
    raf.readLine();
    lineNumber++;
    } // end while loop
    numPages++;
    } // end while loop
    raf.seek(0);
    } // end try
    catch(IOException e) { dialog.showError("Fehler: "+e.getMessage(), "Problem");}
    return numPages;
    } // end findNumPages
    public class MyPageable implements Pageable {
    public Printable getPrintable(int pageIndex) { return myPrint; } // end getPrintable
    public PageFormat getPageFormat(int pageIndex) {
    PageFormat pf = new PageFormat();
    pf.setOrientation(PageFormat.PORTRAIT);
    return pf;
    } // end getPageFormat
    public int getNumberOfPages() {
    return numPages; // test
    //return ((int)printFile.length()/4000); // assume 4KB per page
    } // end getNumberOfPages
    } // end MyPageable class
    public class MyPrintable implements Printable {
    private Font fnt = new Font("Serif", Font.PLAIN, 11);
    protected int lastPageIndexChecked = -1;
    public int print(Graphics g, PageFormat pf, int pageIndex)
    throws PrinterException {
    // pageIndex # corresponds to page number # + 1
    pf.setOrientation(PageFormat.PORTRAIT);
    if (pageIndex >= numPages) { return Printable.NO_SUCH_PAGE; } // end if
    else {
    g.setFont(fnt);
    g.setColor(Color.black);
    String oneLine;
    int x = 75, y = 80, lineNumber = 0;
    try {
    int fileLength = (int)printFile.length();
    while((((int)raf.getFilePointer()) < fileLength) && (lineNumber < 45)) {
    oneLine = raf.readLine();
    lineNumber++;
    g.drawString(oneLine, x, y);
    y += 15;
    } // end while loop
    } // end try
    catch(IOException e) { dialog.showError("Fehler: "+e.getMessage(), "Problem");}
    return Printable.PAGE_EXISTS;
    } // end else
    } // end print
    } // end MyPrintable class
    } // end MyPrinter class

    I was actually able to solve the problem! The print function of the Printable interface is called twice for every page, which was what prevented the pages after the first (the graphics for the other pages) from somehow getting all the info they needed, etc. So here is my updated code for anyone who is having similar problems and needs a similar solution: :)
    import java.awt.*;
    import java.awt.print.*;
    import java.io.*;
    import javax.swing.*;
    public class MyPrinter implements Runnable {
    protected PrinterJob job;
    protected MyPrintable myPrint = new MyPrintable();
    protected MyPageable myPage = new MyPageable();
    protected MyDialog dialog = new MyDialog();
    protected RandomAccessFile raf;
    protected String fileName;
    protected File printFile;
    protected int numPages = 0;
    protected int[] lastFilePositions;
    public MyPrinter() { } // end constructor
    public void printFile(String name) {// gives error message if file doesn't exist!
    printFile = new File(name);
    fileName = name;
    if((printFile.exists()) && (printFile.canRead())) {
    Thread myThread = new Thread(this);
    myThread.start();
    } // end if
    else {
    dialog.showError("Datei "+fileName+" existert nicht!", "Fehler mit Drucken");
    } // end else
    } // end printFile
    public void run() {
    numPages = findNumPages();
    job = PrinterJob.getPrinterJob();
    job.setPageable(myPage); // this is an instance of Pageable
    if(job.printDialog()) { // user didn't cancel the printing
    try {
    job.print();
    try { raf.close(); } // end try
    catch(IOException e) { dialog.showError("Fehler: "+e.getMessage(), "Problem");
    System.exit(0);
    } // end catch
    } // end try
    catch (PrinterException pe) {dialog.showError("Fehler: "+pe.getMessage(), "Problem");
            System.exit(0);
          } // end catch
    } // end if
    } // end run
    private int findNumPages() {
    try {
    numPages = 0;
    raf = new RandomAccessFile(fileName, "r");
    int fileLength = (int)printFile.length();
    int lineNumber = 0;
    while((int)raf.getFilePointer() < fileLength) {
    lineNumber = 0;
    while((((int)raf.getFilePointer()) < fileLength) && (lineNumber < 45)) {
    raf.readLine();
    lineNumber++;
    } // end while loop
    numPages++;
    } // end while loop
    raf.seek(0);
    lastFilePositions = new int[numPages];
    intializeLastFilePositions();
    } // end try
    catch(IOException e) { dialog.showError("Fehler: "+e.getMessage(), "Problem");
    System.exit(0);
    } // end catch
    return numPages;
    } // end findNumPages
    private void intializeLastFilePositions() {
    for(int i = 0; i < lastFilePositions.length; i++) {
    lastFilePositions[i] = 0;
    } // end for loop
    } // end intializeLastFilePositions
    public class MyPageable implements Pageable {
    public Printable getPrintable(int pageIndex) { return myPrint; } // end getPrintable
    public PageFormat getPageFormat(int pageIndex) {
    PageFormat pf = new PageFormat();
    pf.setOrientation(PageFormat.PORTRAIT);
    return pf;
    } // end getPageFormat
    public int getNumberOfPages() {
    return numPages; // test
    //return ((int)printFile.length()/4000); // assume 4KB per page
    } // end getNumberOfPages
    } // end MyPageable class
    public class MyPrintable implements Printable {
    private Font fnt = new Font("Serif", Font.PLAIN, 11);
    protected int startAtLineNumber = 0;
    public int print(Graphics g, PageFormat pf, int pageIndex)
    throws PrinterException {
    // pageIndex # corresponds to page number # + 1
    pf.setOrientation(PageFormat.PORTRAIT);
    if(pageIndex > numPages) return NO_SUCH_PAGE;
    else {
    if(pageIndex == 0) { startAtLineNumber = 0; } // end if
    else {
    startAtLineNumber = lastFilePositions[pageIndex-1];
    } // end else
    g.setFont(fnt);
    g.setColor(Color.black);
    String oneLine;
    int x = 75, y = 80, lineNum = 0;
    try {
    raf.seek(startAtLineNumber);
    int fileLength = (int)printFile.length();
    while((((int)raf.getFilePointer()) < fileLength) && (lineNum < 45)) {
    oneLine = raf.readLine();
    if(oneLine.length() > 130) { // wrap lines if one line is too long
    String secondLine = oneLine.substring(130, oneLine.length());
    oneLine = oneLine.substring(0, 130);
    g.drawString(oneLine, x, y);
    y += 15;
    g.drawString(secondLine, x, y);
    y += 15;
    } // end if
    else { // line fit on one line
    g.drawString(oneLine, x, y);
    y += 15;
    } // end else
    lineNum++;
    } // end while loop
    lastFilePositions[pageIndex] = (int)raf.getFilePointer();
    } // end try
    catch(IOException e) { dialog.showError("Fehler: "+e.getMessage(), "Problem");
    System.exit(0);
    } // end catch
    return Printable.PAGE_EXISTS;
    } // end else
    } // end print
    } // end MyPrintable class
    } // end MyPrinter class

  • How do I download and print a pdf file in osx mountain lion

    How do I download and print a pdf file?

    control click on your PDF to download option
    Open it on your desktop Command-P is the short cut for print option.

  • How to Print  a PDF file from within a ABAP ( from gui input)

    Hi champions,
    This is Client requirement:
    "We need to print a PDF file from within a ABAP"
    We first need to test whether it is even feasible, and then if it 
    is, then write a small test ABAP which can accept a PDF file
    name as input (from GUI) and then print it to a SAP print
    device (printer).”
    Please Can any body help me on this.......
    It's urgent
    Thanks
    Basu

    Check following blog for PDF output from SAP
    /people/thomas.jung3/blog/2005/04/28/setting-up-an-adobe-writer-for-abap-output
    anya

  • I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    I am using Numbers app for the ipad and it has been working absolutely fine but now, when I want to email a spreadsheet as a PDF via the 'share and print' option, the file now doesn't appear as an attachment to the recipient. Any ideas please?

    Hi mafiose15,
    Thanks for visiting Apple Support Communities.
    Restoring your iPod to factory settings is the best way to try and get it back to working order. You can use the instructions below to restore it:
    How to restore iPod
    Verify that you have an active Internet connection, because you may need to download new versions of the iTunes and iPod Software.
    Download and install the latest version of iTunes if necessary.
    Open iTunes. Connect your iPod to your computer using the USB or FireWire cable that came with your iPod.
    After a few moments, your iPod will appear in the Source panel in iTunes.
    Select your iPod in the Source panel. You will see information about your iPod appear in the Summary tab of the main iTunes window.
    Click Restore.
    If you are using a Mac, you will be asked to enter an administrator’s name and password.
    A progress bar will appear on the computer screen, indicating that stage one of the restore process has begun. When this stage is done, iTunes will present one of two messages with instructions specific to the iPod model you are restoring.
    Disconnect iPod and connect it to iPod Power Adapter (typically applies to older iPod models).
    Leave iPod connected to computer to complete restore (typically applies newer iPod models).
    During stage two of the restore process, the iPod displays an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remain connected to the computer or iPod power adapter during this stage.
    Note: The progress bar may be difficult to see, because the backlight on the iPod display may be off.
    After stage two of the restore process is complete, the iTunes Setup Assistant window will appear. It will ask you to name your iPod and choose your syncing preferences, as it did when you connected your iPod for the first time.
    You can find the instructions in this article:
    Restoring iPod to factory settings
    http://support.apple.com/kb/ht1339
    All the best,
    Jeremy

  • Print a pdf file from sap

    Hello,
    I'm looking for a way to print a .pdf file from sap . The file  was created manualy and is in a newtwork folder.
    I have to send the print to a network printer . Is it possible to use the AcroRd32.exe as a command line?
    Thank you.

    hii,
    try this
    CONVERT_OTFSPOOLJOB_2_PDF
    http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm
    PDF - Printing a PDF file from ABAP or SAP Script
    regards,
    Sri.

  • How can i get rid of the print dialog box when using api to print an html file

    i am using the systemshell.vi provided by labview the VI is working fine but it will open a dialog box for printer selection and properties. i would like to hide that dialog box and have it print to the default printer with the default properties

    ShellExec is part of lvwutil and merely calls a function in Shell32.dll. There is nothing about the function call that controls the display of the printer dialog. I think that what shell32.dll does when it prints (just like right clicking on the file) is print the file according to what is defined about that file type in Windows Folder Options. On my Win2K system, the print application is defined as "C:\Program Files\Microsoft Office\Office\msohtmed.exe" /p %1. If I remove the /p, then Word starts up and in order to print, I get a printer dialog when choosing Print from the File menu. So it seems like the printer dialog is entirely dependant on the application that does the printing. I get no dialog when I use the VI to print a .txt file. I
    nstead of using shell32, you might want to try some ActiveX method or property of an application like Internet Explorer that can open and print an html file.

  • How to print an excel file (2010 version) with multiple tabs into a pdf file with bookmarks (acrobat 9). I was able to do this easily using excel (2007 version).

    Recently I got a new laptop, with excel 2010 version and acrobat 9 standard.
    I could no longer print (save as) an excel file with multiple tabs into a pdf file with bookmarks.
    My old computer has excel 2007 version and acrobat 9 standard.
    Print an excel file into pdf with bookmarks was a piece of cake.
    Both machine has the same add-in -- Acrobat PDFMaker Office COM addin
    Thanks if anyone could help me with this.
        Tom

    You need to upgrade Acrobat to a newer version.
    On Thu, Oct 30, 2014 at 4:12 PM, excel-pdf-bookmarks <

  • How to print an Doc file(MS Word File)on a printer in JAVA

    Hi.I am Prakash.
    Folowing is the code that i have used to print an doc file on a printer. Problem is that , when i run this code it will provide me an printout of a doc file.,but not in well formate as the actual formate of the file. If any one tried this before plz help me.Thanks
    import java.lang.reflect.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Graphics2D;
    import java.io.*;
    import javax.swing.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class BasicPrint {
         JFrame frame;
         JButton btn;
         private boolean PrintJobDone = false;
         protected void MakeGui() {
              frame = new JFrame("PrintService");
              btn = new JButton("Cancel Print Job");
              btn.disable();
              frame.getContentPane().add(btn, BorderLayout.SOUTH);
              frame.pack();
              frame.setVisible(true);
         BasicPrint(String FileToPrint, String pMode) {
              try {
                   MakeGui();
                   File baseDir = new File("d:/doc");
    File outDir = new File(baseDir, FileToPrint);
                   // Open the image file
                   InputStream is = new BufferedInputStream(new FileInputStream(
                             outDir));
                   // Find the default service
                   DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   //DocFlavor flavor = new DocFlavor("application/msword", "java.io.InputStream");
                   //DocFlavor docFlavor = new DocFlavor("application/vnd.ms-word", "java.io.InputStream");
                   if (pMode != null && pMode.equalsIgnoreCase("PS"))
                        flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
                   else if (pMode != null && pMode.equalsIgnoreCase("PDF"))
                        flavor = DocFlavor.INPUT_STREAM.PDF;
                   else if (pMode != null && pMode.equalsIgnoreCase("JPG"))
                        flavor = DocFlavor.INPUT_STREAM.JPEG;
                   else if (pMode != null && pMode.equalsIgnoreCase("GIF"))
                        flavor = DocFlavor.INPUT_STREAM.GIF;
                   else if (pMode != null && pMode.equalsIgnoreCase("PNG"))
                        flavor = DocFlavor.INPUT_STREAM.PNG;
                   else if (pMode != null && pMode.equalsIgnoreCase("PCL"))
                        flavor = DocFlavor.INPUT_STREAM.PCL;
                   else if (pMode != null && pMode.equalsIgnoreCase("RAW"))
                        flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT16"))//****                                   *********
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16;
                        System.out.println("****ACTIVE***");
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTBE"))//****
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16BE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTHOST"))//***
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT8"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_8;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTASCI"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
                   else if(pMode != null && pMode.equalsIgnoreCase("TXTLE"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16LE;                                        //*******
                   else if(pMode != null && pMode.equalsIgnoreCase("SEVICE"))
                        flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
                   String type = flavor.getMediaType();
                   System.out.println("Type ="+ type);
                   //IMPRIMIR prakashCV.doc TXT text/plain; charset="utf-16le"; class="java.io.InputStream"
                   System.err.println("* IMPRIMIR " + FileToPrint + " " + pMode + " "
                             + flavor);
                   PrintService dservice = PrintServiceLookup
                             .lookupDefaultPrintService();
                   PrintService[] services = PrintServiceLookup.lookupPrintServices(
                             flavor, null);
                   if (services == null || services.length < 1)
                        services = PrintServiceLookup.lookupPrintServices(null, null);
                   PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
                   aset.add(new Copies(1));
                   aset.add(OrientationRequested.PORTRAIT);
                   // aset.add(MediaTray.MAIN);
                   aset.add(Sides.ONE_SIDED);
                   aset.add(MediaSizeName.ISO_A4);
                   PrintService service = ServiceUI.printDialog(
                             (GraphicsConfiguration) null, 60, 60, services,
                             (PrintService) dservice, (DocFlavor) flavor, aset);
                   if (service != null) {
                        // Create the print job
                        final DocPrintJob job = service.createPrintJob();
                        Doc doc = new SimpleDoc(is, flavor, null);
                        // Monitor print job events; for the implementation of
                        // PrintJobWatcher,
                        PrintJobWatcher pjDone = new PrintJobWatcher(job);
                        if (job instanceof CancelablePrintJob) {
                             btn.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       CancelablePrintJob cancelJob = (CancelablePrintJob) job;
                                       try {
                                            cancelJob.cancel();
                                       } catch (PrintException e) {
                                            // Possible reason is job was already finished
                             btn.enable();
                        try {
                             // Print it
                             job.print(doc, (PrintRequestAttributeSet) aset);
                        } catch (PrintException e) {
                             e.printStackTrace();
                        System.err.println("* Impresion Realizada - Esperando ..");
                        // Wait for the print job to be done
                        pjDone.waitForDone();
                   // It is now safe to close the input stream
                   is.close();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   try {
                        synchronized (BasicPrint.this) {
                             PrintJobDone = true;
                             BasicPrint.this.notify();
                   } catch (Exception e) {
                        e.printStackTrace();
         public synchronized void waitForDone() {
              try {
                   while (!PrintJobDone) {
                        wait();
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              try {
                   //args[0]="t";
                   //args[1]="rr";
    //               if (args.length < 1) {
    //                    System.err.println("\nSintaxis:\n\n java BasicPrint FileToPrint [pMode]\n");
    //                    System.exit(0);
                   BasicPrint bp = null;
                   //if (args.length < 2){
                        //bp = new BasicPrint(args[0], null);
                   //}else{
                        //bp = new BasicPrint(args[0], args[1]);
                        bp = new BasicPrint("prakashCV.doc","SEVICE");                                                       //****/***
                   bp.waitForDone();
                   System.exit(0);
              } catch (Exception e) {
                   e.printStackTrace();
         class PrintJobWatcher {
              // true iff it is safe to close the print job's input stream
              boolean done = false;
              int lastEvent = 0;
              PrintJobWatcher(DocPrintJob job) {
                   // Add a listener to the print job
                   job.addPrintJobListener(new PrintJobAdapter() {
                        public void printJobRequiresAttention(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* La impresora requiere de su Atencion ! * "
                                                 + pje);
                             // allDone();
                        public void printDataTransferCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* Transferencia de datos a la impresora OK. * "
                                                 + pje);
                             // allDone();
                        public void printJobCanceled(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Trabajo de impresion CANCELADO ! * "
                                       + pje);
                             allDone();
                        public void printJobCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Impresion completa OK. * " + pje);
                             allDone();
                        public void printJobFailed(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* ERROR en la Impresion ! * " + pje);
                             // allDone();
                        public void printJobNoMoreEvents(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* No mas eventos de impresion * " + pje);
                             allDone();
                        void allDone() {
                             synchronized (PrintJobWatcher.this) {
                                  done = true;
                                  PrintJobWatcher.this.notify();
              /** Description of the Method */
              public synchronized void waitForDone() {
                   try {
                        while (!done) {
                             wait();
                   } catch (InterruptedException e) {
                        e.printStackTrace();
    }

    Hi Maxpkh
    Do you mean attachment? You can't do that with free Adobe Reader you need Acrobat to do this.
    ~Deepak

Maybe you are looking for

  • Scheduling JDBC adapter in PI 7.0 SP09

    Hello Experts, My client is using PI 7.0 sp09.  I have a JDBC adapter that needs to execute once every 24 hours but each time the server is restarted the adapter executes and starts the 24 hr cycle again from that time.  Is there any way to schedule

  • Valid RTPs NOT passing to Brule V11.1.1.3

    Problem Description: Forms error with the business rules using valid RTPs. Form set to run on save, use members on form for prompts. The rule is running on save, but the RTPs are p-up (s/b hidden), then only 'Null' values are being sent to essbase (b

  • Adding Cuts to an Adjustment Layer

    I am relatively new to Premiere, having been an Avid editor for the last 20+ years.  I need to add cuts to an adjustment layer that correspond to the layer below.  Is there an easy way to do this?  On the Avid, it is relatively simple, so I was hopin

  • I can't download Adobe Creative Cloud

    I can only download the innstaller, and it keeps installing the same thing over and over!

  • WS14500015 - n-step WF, item based

    Hi Guys, I'm developing an item based approval WF for my customer (WS14500015), using the BAdI BBP_WFL_APPR_WORKFLOW, Method GET_REMAINING_APPROVERS. I have the situation, that a SC (BUS2121) is created with two items, the approver list looks as foll