Printing Specified File

Hello,
I am trying to write a script that prints a specified file.
Here is my script. What am I doing wrong?
set theLocation to ("/Volumes/ATTIC/Shared/finance/Current Positions/Combined/")
set fileName to (do shell script "date '+%Y%m%d'" & ".pdf")
set theFile to theLocation & fileName as text
set theReport to POSIX path of theFile
tell application "Finder"
print file theFile
end tell
Finder got an error: Can't get file "/Volumes/ATTIC/Shared/finance/Current Positions/Combined/20061031.pdf".
I have tried a couple other variations of this script with different error messages. My thought is that maybe I have the path in the wrong form or syntax. At any rate, thanks in advance for the help. The file is on a network server that is mounted.
Mac Pro   Mac OS X (10.4.7)  

Thank you for the quick response.
set theLocation to ("/Volumes/ATTIC/Shared/finance/Current Positions/Combined/")
set fileName to (do shell script "date '+%Y%m%d'" & ".pdf")
set theFile to theLocation & fileName as text
set theReport to POSIX file theFile
tell application "Finder"
print file theReport
end tell
This yields "Finder got an error: Can't continue " on the next to the last line.
set theLocation to ("/Volumes/ATTIC/Shared/finance/Current Positions/Combined/")
tell application "Finder" to print file (POSIX file (theLocation & (do shell script "date '+%Y%m%d'" & ".pdf")) as alias)
This yields "Can't make POSIX file "/Volumes/ATTIC/Shared/finance/Current Positions/Combined/20061031.pdf" of application "Finder" into type alias."
Thoughts?
Mac Pro/iBook G4   Mac OS X (10.4.7)  

Similar Messages

  • Print module - print to file options

    When creating JPEGs using the Export function of the Library module, Lightroom 4 offers you very detailed control over the export options, including automated rules for the folder/filename structure.
    When creating JPEGs using "print to file" in the Print module, the controls seem to be much more limited. Notably, the folder/filename has to be specified manually for each print job.
    Is there a way to keep (or append to) the original filename when exporting from the Print module, short of typing it in by hand for every single image?
    (For context: My print lab requires that submitted files exactly match the print, pixel-for-pixel, for everything to work correctly. If the file doesn't match, their print driver will scale and crop until it does. So, if I use the Library module's Export function and the aspect ratio of the file is different from that of the closest available paper, two edges may get cropped. Or, in other words, I have to pad the image with white bars to fill the paper's aspect ratio if I want it to print the way I want it to. The Print module creates files that are perfect for my purposes. But, since I can't figure out how to get it to keep the filename, the back print data on the paper copies- which I will need 8 years later to find the original when a re-print is ordered- is useless.)

    Thanks Effeegee. At your suggestion, I tried LR/Mogrify + ImageMagick and, with a bit of tweaking, it does exactly what I need (and far more efficiently than LR4 Print).
    For other users' reference, the LR/Mogrify configuration to do this is:
    In Lightroom Library -> Export, LR/Mogrify adds "Post-Process Actions". Turn on "Background Canvas" and "Compress to file size".
    Under the regular "Image Sizing" control, turn on "Resize to Fit: Dimensions" and set the paper size (long side first) and printer resolution. This resizes the image to fit within the specified paper size.
    Under "Mogrify Canvas", set the paper size again (in pixels, long side first), and turn on "Adjust for landscape/portrait". This pads the image with blank borders to exactly fill the specified paper size.
    Note that if the short side is specified first, LR/Mogrify sometimes pads on all sides....
    To minimize additional JPEG artefacts, I suspect that under Lightroom export's "File Settings" the JPEG quality should be 100 (i.e. negligible loss) and the final compression should be done only after all post-process actions, i.e. use LR/Mogrify's "Compress to given file size". (But don't quote me on that as I haven't traced the actual code path.)

  • Print html file with barcode from abap report

    hi
    i am printing html file from abap program using gui_execute.
    i am using netscape.exe , its printing first time and when reprint its not working
    basically html file contains gif file which has fedex barcode.
    could you please let me know how to print html file from report

    DGU wrote:
    where to check RAW or TEXT? the print report vi only asks for file name and printer name.
    When I print from notepad, everything just goes by default. This is a label printer, so I never need to specify printing parameter such as size, orientation, etc in the past
    Famous last words go something like this: "...never had to do that before."  Maybe you have to do that now.  It's worth at least comparing the defaults settings for bothe generic drivers.  It could save you a lot of headache if you notice something different.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Photosmart C4780 install fails at "system cannot find specified file"

    My problem started simply with the printer, an HP Photosmart C4780 which has always had a wireless connection and would not print.  At first, the network connection checked out fine from the printer control panel.  I ran a Microsoft printer troubleshooter, which found a block in the print queue, and cleared it.  The first test page would not print, but the "inner test page" did print.  I didn't understand whatever that meant, so I looked for help from the HP site.
    I ran the HP Print and Scan Doctor, and it suggested I reinstall the driver.  I downloaded and saved the current one from HP (PS_AIO_06_C4700_USW_Full_Win_enu_140_175.exe) and then uninstalled the existing driver.  When I attempted to install the new one, a window popped up saying, "The system cannot find the specified file," with only one box to click which said simply "OK".  The installation went through to "review installation options", after which came “checking updates, downloading updates, installing updates” and then it was while “checking system” that the “cannot find the file” window popped up, and when I clicked “OK”, the installation window as well as the error message box, just disappeared.  What I assume was the file path was in the frame of the window, but the whole thing didn't fit so it didn't show the end.  What I could read was “C:\Users\ … \Local\Temp\7zS588E\Setup\.\Setup\hpzpnp40 …
    I found one topic on the same problem for the same model printer in the forum, which offered this fix:
    You will need to first complete a level 3 uninstall of the software. I have included the steps below for this.
    1. Press the Windows key, and the letter R
    2. Type %temp%, and click OK
    3. Open the 7z folder (most recent one if there are multiples)
    4. Open the util folder
    5. Open the ccc folder
    6. Double click on the Uninstall_L3
    Once the Uninstall_L3 has completed, please delete all items listed in the temp folder. Note, you will  not be able to to delete all items, please skip the ones that you cannot. Next please empty the trash, and perform a clean boot. I have included the document 'How to perform a clean boot in Windows'. If your computer does not request it, please restart your computer.
    Once your computer is back up, you will need to reinstall the printers software. You can either do this by using the Installation CD, or downloading the software.
    I did what was suggested, until it got to the point where it said it did not recommend removing any further items if I intended on using the HP Officejet printer (yes I have a second HP printer attached to the network) anytime in the future.  Not really understanding how this all works, I decided to stop what I was doing, so unfortunately it did not solve my problem.
    Do I need to uninstall both HP printers before I can reinstall one?  And if I do that, is there any reason I would not be able to reinstall both printers?  Sounds like I'm asking for trouble.  Bottom line... I still cannot install the driver.
    I have tried to install both the full and basic versions of the driver and always get the same result.
    I have an HP Pavilion dv6-3100t notebook, running Windows 7 Home Premium, version 6.1.7601 service pack 1, 64 bit.  I haven't installed any new hardware or software.  This printer has always had a wireless connection.  The router I use is a Netgear 54 Mbps WGR614 v6 (supplied by my cable company), and the network includes not only my notebook and the Photosmart printer, but also an ASUS desktop, another HP printer, an Officejet 6300 series (used only for printing graphics and photos with a wired connection to the router), and a Vizio smart-TV.  I use Norton 360 Premier Edition and disabled the anti-virus auto-protect when I downloaded and attempted to install the driver.
    Please help!  And thanks in advance for your time and attention.
    This question was solved.
    View Solution.

    Hi wakey-wakey,
    I would recommend accessing your Temp folders, rename a Temp folder to 7zS588E and run the installation from that folder. 
    Please keep me posted.
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Adobe X doesn't print all files

    Hi, I'm using Adobe X, XP Home, everything up to date.
    Often I need to open or print more than 1 file at a time.
    If I go to the directory, block off any number of pdf files and click on open, not all of the files will open. That was causing problems, but I discovered the trick there is to specify open with Adobe X and then they will all open.
    If I block off any number of pdf files and click on print, again, not all of the files will print.  Is there an option that allows me to batch print pdf files?
    Hoping there is!
    Thanks for any help, Tom

    I'm guessing its a setting but can't seem to find that particular one.  Has anyone ran into this?  Any ideas?
    While Bridge is not assigned for use over a network your problem seems cache related to me. When in a problem folder go to the menu tools / cache / and choose purge cache for folder and see if this helps you.

  • How do I print the file name of a PDF file?

    How do I print the file name of a PDF file?

    In the print dialog under Advanced you can specify this.

  • Firefox will disable my HP L7680( error message " turn power off then on again") when using either the printer icon or print in file pull down. .

    This happens for em & other print request in my online brokerage account. It has no problem printing PDF files. When the message appears, four lights start blinking at the same time on the auto answer button, on off button, lower SD slot, and the light under the OK button with the directional tabs. At that point I have to power down the printer and change to ie8 to print these. My ie8 browser has no problems with any printing, but it does not function when trying to add notes in my Comcast address book

    Mowaffaq, you may want to determine whether you are making those changes in the master printing preferences (versus the adjusting the session printing preferences from within your application).
    Click "Start", click "Printers and Faxes" (or "Devices and Printers"), right-click your printer, and select "Printing Preferences". On the "Paper/Quality" tab, you should be able to specify A4 as your default paper for all future print jobs.
    Hope that helps.

  • Printing PDF files in jdk1.4

    Has anyone been able to print a pdf file in jdk1.4? If so...could you please provide some sample code. I have been able to print just about every DocFlavor except PDF. Thanks.

    Hi,
    I've been on a project for the past several months, and we are trying to do the exact same thing. We dynamically generate pdfs, and then wish to print them to a network printer. The problem is that the printer does not specify the "pdf" docflavor. So I guess the long term solution will be to wait for Adobe or someone else to write a java print service plug-in for printing pdf files. The work around that we used in the mean time was to invoke gsprint (part of the free ghostview) from a command line within java to print a specified pdf file. This does not however let one specify advanced print options such as "stapling", which one would be able to do if using the java print service from java1.4.
    if you find anything else out, please post to the forums...

  • Printing PDF Files takes forever

    I'm new to the mac world, but love it. It takes forever to print pdf files on my iMac. I'm using an HP3050 Laserjet, plugged directly into the iMac. Never had this problem with the printer connected to my Vista Laptop.
    I started to print a 2 page pdf 9 minutes ago and still have not gotten a pageout of the printer. PDF File is only 132 KB.
    Any advice would be greatly appreciated

    David Goodman1 wrote:
    It was happening with preview and adobe pdf viewer. I tried an experiment, unplugged the usb cable and re-set the printer to its defaults.
    That solved part of the problem. It now prints pdf's quickly, but any document, word,pdf etc that I try to print, the printer now beeps and prompts for a manual feed, press enter for confirmation. After pressing the enter button on the printer whatever file I'm trying to print comes out.
    Okay, the printer thinks that you're feeding paper from the manual feed slot, not from the paper tray. When you select 'Print', the printer dialog box should come up. There are two basic styles for the printer dialog box:
    1 basic, which has seven items in it: the printer ID pull-down menu, which allows you to select printers if you have more than one printer; in my case, I'd have Brother HL-2070N, Brother MFC-440CN, Adobe PDF 8.0, and a few other items on the list. It would also show the printer presets pull-down, the four print system buttons (PDF, Preview, Cancel and Print) and the dialog control triangle.
    2 complete, which can be access from the basic dialog by clicking on the dialog control triangle. This will zoom out the dialog box to include the full array of options available for that printer. What options show depend on which printer you have, but one of them will be a pull-down menu which usually has the name of the app you're trying to print from. One of the items on that menu will be 'Print Feed' or something similar. Select that item. The dialog will zoom out and show you the various print feed options. It is probable that there will be a checkmark next to 'manual feed' or something similar. Select 'automatic' or 'tray #1' or similar. Print normally.
    Once you have printed something with the correct settings the print system will remember the settings you want and will keep them until you change them. Just remember that if you change them, the system will remember the new settings until you change them back.
    Plus, printing #10 envelopes no longer works correctly, the address information only partially prints and is un-readable.
    That's almost certainly because it things that it's printing letter-size paper from the manual tray. One of the settings under 'Print Settings' or similar should allow you to select the size and type of paper; if you select #10 envelope, it will adjust accordingly. Note that unless you specify otherwise, if you select #10 envelope the system will usually automatically select the manual feed for you. It will go back to whatever feed setting had been made before printing envelopes once you select a different type of paper. (At least that's how it's worked in every printer I've used for quite some time now.)
    I'm going to plug the printer back into my Vista Laptop and see if it goes back to normal.
    It's not hardware-related, it's driver-related, so you should be able to print from Vista without a problem.
    If you do have a problem, let us know 'cause then the problem is not a driver problem. And if it's not a driver problem you may yet get to buy a new printer, 'cause fixing printer hardware is usually more expensive than just tossing the printer and replacing it. I would charge you at least $50/hour plus parts to fix this kind of thing. You can get a new printer for under $100. You make the call.
    Is there any kind of "terminal" command I can use to re-set how the Mac is dealing with the printer?
    if you really want to see the guts of the print system, you can go to the CUPS pages on your system, but you really don't want to do that unless you absolutely have no choice. The CUPS pages, the Common UNIX Printing System pages, on your system are available if you launch your web browser (any web browser) and go to <http://127.0.0.1:631/printers>. There's a whole lot of info in there, but playing inside there is not for the faint of heart.

  • Need help printing tiff files

    I have written some code that prints any file that can be opened using JAI and the ImageIO Tools. The code works good for me but I have some special cases where I am having some difficulty. Some files I need to print are TIFF files with many pages. Some are compressed using Fax Group 4 encoding and others are compressed using OLD jpeg-in-tiff. I can read and print the files just fine, but it takes about 2 seconds to print each page. Also the spooling data for 88 pages is 900 MB in size. Printing the same files using IrfanView takes <1 seconds and the spool file is much smaller (equivalent to the size of the uncompressed tiff) The speed and size issues are problems for me because I am working on a print web service. My code to render each page is below. So far I have tried rendering hints and such to increase speed, but I think the problem is that when I read the image it takes up a lot of space in memory.
    Here is the overall requirements for what I am doing: A use will request that the server print a set of files (mixed image formats, restricted to TIFF, JPEG, and GIF) be printed to specific printer as a single print job. They can specify copies and collation only. The service will open each file in order and send its data to the printer. I have created a custom class that implements the Printable interface to handle the multiple files. The class below is created for each file and handles the printing of the image file.
    I am using JDK 1.4.2 and WebSphere. I am stuck with these options b/c I have to use some IBM API's (IBM Content Manager 8.3) that are not compatible with 1.5 or higher.
    Is there any way to speed up my code. Possibly load the image differently?
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.awt.print.PageFormat;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.FileImageInputStream;
    import javax.imageio.stream.ImageInputStream;
    public class ImagePrinter2 implements Printable
       public static final int PAPER_SIZE_LETTER = 0;
       public static final int PAPER_SIZE_LEGAL = 1;
       private final ImageReader reader;
       private final int _pageCount;
       private final File imageFile;
       private int _pageOffset;
       public ImagePrinter2(File imageFile) throws IOException
          this.imageFile = imageFile;
          ImageInputStream fis = new FileImageInputStream(this.imageFile);
          reader = (ImageReader) ImageIO.getImageReaders(fis).next();
          reader.setInput(fis);
          _pageCount = reader.getNumImages(true);
       public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          throws java.awt.print.PrinterException
          BufferedImage image = null;
          int currentPage = pageIndex - getPageOffset();  //pageIndex is for the overall job, I need the page in this file
          int imgWidth = 0, imgHeight = 0;
          int drawX = 0, drawY = 0;
          double scaleRatio = 1;
          try
             image = reader.read(currentPage);
             imgWidth = image.getWidth();
             imgHeight = image.getHeight();
          catch (IndexOutOfBoundsException e)
             return NO_SUCH_PAGE;
          catch (IOException e)
             throw new PrinterException(e.getLocalizedMessage());
          if (imgWidth > imgHeight)
             pf.setOrientation(PageFormat.LANDSCAPE);
          else
             pf.setOrientation(PageFormat.PORTRAIT);
          Graphics2D g2 = (Graphics2D) g;
          g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
          g2.translate(pf.getImageableX(), pf.getImageableY());
          g2.setClip(0, 0, (int) pf.getImageableWidth(), (int) pf.getImageableHeight());
          scaleRatio =
             (double) ((imgWidth > imgHeight)
                ? (pf.getImageableWidth() / imgWidth)
                : (pf.getImageableHeight() / imgHeight));
          //check the scale ratio to make sure that we will not write something off the page
          if ((imgWidth * scaleRatio) > pf.getImageableWidth())
             scaleRatio = (pf.getImageableWidth() / imgWidth);
          else if ((imgHeight * scaleRatio) > pf.getImageableHeight())
             scaleRatio = (pf.getImageableHeight() / imgHeight);
          //center image
          if (scaleRatio < 1)
             drawX = (int) ((pf.getImageableWidth() - (imgWidth * scaleRatio)) / 2);
             drawY = (int) ((pf.getImageableHeight() - (imgHeight * scaleRatio)) / 2);
          else
             drawX = (int) (pf.getImageableWidth() - imgWidth) / 2;
             drawY = (int) (pf.getImageableHeight() - imgHeight) / 2;
          AffineTransform at = AffineTransform.getTranslateInstance(drawX, drawY);
          if (scaleRatio < 1)
             at.scale(scaleRatio, scaleRatio);
          g2.drawRenderedImage(image, at);
          g2.dispose();
          image = null;
          return PAGE_EXISTS;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
        * @return
       public int getPageCount()
          return _pageCount;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
        * @return
       public int getPageOffset()
          return _pageOffset;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
        * @param i
       protected void setPageOffset(int i)
          _pageOffset = i;
          * Release the reader resources
          * <br><br>
          * Created By: TSO1207 - John Loyd
          * @since version XXX
       public void destroy()
              try
                   ((ImageInputStream) reader.getInput()).close();
              catch (Exception e)
              reader.reset();
          reader.dispose();
        * Helps release memory used when printing (seems to be a 1.4.2 thing)
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
       public void reset() throws FileNotFoundException, IOException
          try
             ((ImageInputStream) reader.getInput()).close();
          catch (Exception e)
          reader.reset();
          ImageInputStream fis = new FileImageInputStream(imageFile);
          reader.setInput(fis);
    }

    I found a couple of issues. One was related to code the other to IBM. AS for the code I found an article about drawing scaled images here: http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html which was quite useful. My updated code is below. The second issues is that the JRE I am using is the IBM Websphere 5.1 JRE which pretty much sicks. I tested using a Sun statndard 1.4.2 JRE and the print was 5 times faster. Now I am looking to find a way around that issue, but it is not a questions for this form.
    public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          throws java.awt.print.PrinterException
          BufferedImage image = null;
          int currentPage = pageIndex - getPageOffset();  //pageIndex is for the overall job, I need the page in this file
          int imgWidth = 0, imgHeight = 0;
          int drawX = 0, drawY = 0;
          double scaleRatio = 1;
          try
             image = reader.read(currentPage);
             imgWidth = image.getWidth();
             imgHeight = image.getHeight();
          catch (IndexOutOfBoundsException e)
             return NO_SUCH_PAGE;
          catch (IOException e)
             throw new PrinterException(e.getLocalizedMessage());
          if (imgWidth > imgHeight)
             pf.setOrientation(PageFormat.LANDSCAPE);
          else
             pf.setOrientation(PageFormat.PORTRAIT);
          Graphics2D g2 = (Graphics2D) g;
          g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
          g2.translate(pf.getImageableX(), pf.getImageableY());
          g2.setClip(0, 0, (int) pf.getImageableWidth(), (int) pf.getImageableHeight());
          scaleRatio =
             (double) ((imgWidth > imgHeight)
                ? (pf.getImageableWidth() / imgWidth)
                : (pf.getImageableHeight() / imgHeight));
          //check the scale ratio to make sure that we will not write something off the page
          if ((imgWidth * scaleRatio) > pf.getImageableWidth())
             scaleRatio = (pf.getImageableWidth() / imgWidth);
          else if ((imgHeight * scaleRatio) > pf.getImageableHeight())
             scaleRatio = (pf.getImageableHeight() / imgHeight);
          //find the scaled width and height
          int scaledWidth = imgWidth, scaledHeight=imgHeight;
          //center image
          if (scaleRatio < 1)
             drawX = (int) ((pf.getImageableWidth() - (imgWidth * scaleRatio)) / 2);
             drawY = (int) ((pf.getImageableHeight() - (imgHeight * scaleRatio)) / 2);
             //new code to set the scale
             scaledWidth = (int)(scaledWidth * scaleRatio);
             scaledHeight = (int)(scaledHeight * scaleRatio);
          else
             drawX = (int) (pf.getImageableWidth() - imgWidth) / 2;
             drawY = (int) (pf.getImageableHeight() - imgHeight) / 2;
    /*don't need transform
          /*AffineTransform at = AffineTransform.getTranslateInstance(drawX, drawY);
          if (scaleRatio < 1)
             at.scale(scaleRatio, scaleRatio);
          g2.drawRenderedImage(image, at);*/
          //use scale instance of draw image
          g2.drawImage(image, drawX, drawY, scaleWidth, scaleHeight, null);     
          g2.dispose();
          image = null;
          return PAGE_EXISTS;
       }Edited by: jloyd01 on Mar 7, 2008 1:35 PM

  • Print to file problem (output size does not alter the user file measures)

    Hi all,
    as I'm using LR 2.2 (on Win XP) as trial version you can see that I'm a newbie to the programme which I like every day better as I step deeper into it.
    I fought my way through organizing and developing my photos but now I have problems with the print module. I want to print the photo to a file (jpg) and therefore I am really happy about the new print to file option.
    My understanding was, that when I choose the option of user file measures in the print to file module then all other settings (paper and printer settings as well as paper and layout settings) where sort of "overruled". Although I changed some of the other settings (for example paper setting in the printer dialog to DIN A 6) the idea was to get prints of the dimension 105.13 mm x 148.17 mm (DIN A6). This picture size is therefore my user file measures setting.
    But it seems that I missed some important settings because I get pictures which are of the same size like the original photos: 43.8 cm x 61.7 cm and therefore much to big.
    I would be pleased if someone could point out where my mistake is rooted.
    THX!
    Jens David

    First of all thanks for the message.
    But my problem is that neither of the two ways is working properly. Perhaps there was some kind of misunderstanding because I didn't used the official terms.
    I specified the page size setting in the page setup dialog to DIN A6 AND I (tried to) override this by using the Custom file dimensions in the Print Job Section; there I used as well the DIN A6 dimensions of 105.13 mm x 148.17 mm.
    Nonetheless my output file retains its original file dimensions.
    I think I still need some ideas where the (or my) problem is rooted.
    THX in advance.
    JD

  • I want to print .ps file from java

    Hello
    i want to print .ps file using javax.print api and this give following error
    sun.print.PrintJobFlavorException: invalid flavor
    and my code is as below
    public PrintPS() {
              /* Construct the print request specification.
              * The print data is Postscript which will be
              * supplied as a stream. The media size
              * required is A4, and 2 copies are to be printed
              //DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
              DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
              PrintRequestAttributeSet aset =
                   new HashPrintRequestAttributeSet();
              aset.add(MediaSizeName.ISO_A4);
              aset.add(new Copies(2));
              aset.add(Sides.TWO_SIDED_LONG_EDGE);
              aset.add(Finishings.STAPLE);
              System.out.println("HI");
              /* locate a print service that can handle it */
              PrintService pservices =
                   PrintServiceLookup.lookupDefaultPrintService();
              System.out.println("Hello "+pservices);
              DocFlavor[] flavors = pservices.getSupportedDocFlavors();
              for (int i = 0; i < flavors.length; i++) {
              System.out.println(flavors.getRepresentationClassName());
         /*     if (pservices.length > 0) {*/
                   System.out.println("selected printer " + pservices.getName());
                   /* create a print job for the chosen service */
                   DocPrintJob pj = pservices.createPrintJob();
                   try {
                        * Create a Doc object to hold the print data.
                        * Since the data is postscript located in a disk file,
                        * an input stream needs to be obtained
                        * BasicDoc is a useful implementation that will if requested
                        * close the stream when printing is completed.
                        FileInputStream fis = new FileInputStream("hexagon.ps");
                        Doc doc = new SimpleDoc(fis, flavor, null);
                        /* print the doc as specified */
                        pj.print(doc, aset);
                        * Do not explicitly call System.exit() when print returns.
                        * Printing can be asynchronous so may be executing in a
                        * separate thread.
                        * If you want to explicitly exit the VM, use a print job
                        * listener to be notified when it is safe to do so.
                   } catch (IOException ie) {
                        System.err.println(ie);
                   } catch (PrintException e) {
                        System.err.println(e);
    plz help me

    1. Turn the router, iPad and printer off.
    2. Turn on the router and then wait 30 seconds to let it complete its start-up process.
    3. Turn on printer and then wait 30 seconds to let it complete its start-up process.
    4. Turn on your iPad and test print.

  • How to print *.PRN file without print Dialog from Java

    hi friends
    I need to print *.PRN file from java code.*
    I need to print directely without open printer dialog box when i select .PRN file then it should able to direct print to default printer.
    Here is the Dos command to directely print the PRN file
    COPY C:\\PrintFile.prn /B \\java103\\HPLaserJ
    (source: http://filext.com/faq/print_from_prn_file.php)
    i try to run that dos command through Process p = Runtime.getRuntime().exec("COPY C:\\PrintFile.prn /B \\java103\\HPLaserJ");
    But is show that
    Here is the LOG of ERROR
    \\java103\HP LaserJet M1120 MFP
    java.io.IOException: Cannot run program "COPY": CreateProcess error=2, The system cannot find the file specified
         at java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at Print2Printer.GetDefaultPrinter.main(GetDefaultPrinter.java:17)
    Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
         at java.lang.ProcessImpl.create(Native Method)
         at java.lang.ProcessImpl.<init>(Unknown Source)
         at java.lang.ProcessImpl.start(Unknown Source)
         ... 5 more
    Here is the Source
    import java.io.IOException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    public class GetDefaultPrinter {
         public static void main(String args[]){
              PrintService printer = PrintServiceLookup.lookupDefaultPrintService();
              System.out.println(printer.getName());
              try {
                   Process p = Runtime.getRuntime().exec("COPY C:\\PrintFile.prn /B \\java103\\HPLaserJ");
                   System.out.println(p);
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();

    you need to specify which program you want to execute in Runtime.getRuntime().exec(). So try this one
    try {
    Process p = Runtime.getRuntime().exec("cmd.exe COPY C:\\PrintFile.prn /B \\java103\\HPLaserJ");
    System.out.println(p);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

  • LSMW: Error concerning the logical path in Specify Files step

    Hi,
    I am trying on an ECC 6.0 EHP6 system to upload (open) POs from an existing SAP ERP system. Since I faced some complications in batch input recording method, I decided to go with the standard batch/direct input method.
    I selected object 0085 (Purchase Order) and method 0001 (Purchase Order). The program that is used is RM06EEI0. I followed all the usual steps, but in the "Specify Files" step I get the message:
    '****.lsmw.conv' does not exist; edit the logical path using transaction FILE
    Being aware of both the FILE and SF01 transactions, I created the logical path and file (through the FILE transaction). However, after the modification, I get the message:
    Logical file '****' is not assigned to physical file '****.lsmw.conv'
    There is also the related SAP Note 753511 (Logical and physical path and file name in transaction LSMW) that refers to this case.

    Hi,
    Click on specify file radio button>Legacy data-on the PC Front end
    where input file location like C:\mydocument\desktop\test.txt
    and give input in Name field: mydocument
    in delimiter section > select Tabular
    File structure section> tick on Field order matches source structure definition
    File type: Record end marker(Text file)
    then press enter key and other steps as same.
    Second thing you said that you have used Batch input recording
    after creation and recording finish , scroll the page below on recording and put a cursor unwanted field and remove unwanted input field.
    I hope your problem will resolve. you can find the steps pdf on Google search try now.
    Thanks
    Sanjeet Kumar

  • Changing the order for printing portfolio files in adobe acrobat 9 pro

    Does anyone know how to change the order for printing pdf files that are part of a portfolio in adobe acrobat 9 pro?  The documentation seems to say that it prints files alphabetically by filename rather than by the internal sort order.  This won't work for me. Any ideas? Thanks.

    Question1: No.
    Question2: No.

Maybe you are looking for