Unable to print Swedish Character using DocFlavor

Hi All,
i am trying to print Swedish character using DocFlavor, but its not getting printed.
My printer only supports below Flavors.
Win32 Printer : V2PRINTER supports :
image/gif; class="[B"
image/gif; class="java.io.InputStream"
image/gif; class="java.net.URL"
image/jpeg; class="[B"
image/jpeg; class="java.io.InputStream"
image/jpeg; class="java.net.URL"
image/png; class="[B"
image/png; class="java.io.InputStream"
image/png; class="java.net.URL"
application/x-java-jvm-local-objectref; class="java.awt.print.Pageable"
application/x-java-jvm-local-objectref; class="java.awt.print.Printable"
application/octet-stream; class="[B"
application/octet-stream; class="java.net.URL"
application/octet-stream; class="java.io.InputStream"
I have tried different encoding format available  like UTF-8, ASCII but i am getting exception Invalid Flavor.
PFB code snippet.
package test;
import java.awt.print.PrinterJob;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintException;
import javax.print.PrintService;
import javax.print.SimpleDoc;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
public class TestPrinter {
      * @param args
     public static void main(String[] args)
          String receiptName = "D:\\Receipt.txt";
          // retrieve all the printers
          PrintService[] printers = PrinterJob.lookupPrintServices();
          // print service declaration
          PrintService printer = null;
          for (int i = 0; i < printers.length; i++)
               System.out.println(printers.getName());
               if (printers[i].getName().equalsIgnoreCase("Ricoh Aficio MP 2550B PCL"))
                    printer = printers[i];
                    System.out.println("Printer Found :" + printers[i].getName());
          FileInputStream psStream = null;
          try
               psStream = new FileInputStream(receiptName);
          catch (FileNotFoundException e1)
               // TODO Auto-generated catch block
               e1.printStackTrace();
// DocFlavor psInFormat = DocFlavor.BYTE_ARRAY.GIF;
DocFlavor psInFormat = null;
// psInFormat = new DocFlavor("text/plain; charset=utf-8", "java.io.InputStream");
psInFormat = new DocFlavor("text/plain; charset=us-ascii", "java.io.InputStream");
Doc myDoc = new SimpleDoc(psStream, psInFormat, null);
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
          try
               DocPrintJob job = printer.createPrintJob();
               job.print(myDoc, aset);
               psStream.close();
          catch (PrintException pe)
               System.out.println(pe.getMessage());
          catch (Exception e)
               System.out.println(e.getMessage());
Please let me know what wrong i am doing here.
Edited by: user8003374 on Apr 18, 2013 11:40 PM
Edited by: user8003374 on Apr 18, 2013 11:41 PM

Hello,
Please try to reinstall the SAPGUI again...bcoz LOCL initialize the SAPLPD in local printing and SAP sends data to SAPLPD to print it.. so you can try this option also..i am not sure it will help....but u can try..
Regards,
kamlesh

Similar Messages

  • Unable to print PDF files using Acrobat 8.

    I had to uninstall and then reinstall Office for Mac 2011.  I don't know if it's related or not,  but since doing so I have been unable to print PDF files using Adobe Acrobat 8. After opening a PDF file and hitting print, Adobe Acrobat 8 crashes. Any suggestions?  I already uninstalled and reinstalled Adobe Acrobat 8, but it still won't print PDF files. O

    While you are having difficulty in printing a PDF file, you may try the  subsequent steps. If you are in a rush and would like to print a simple  document such as a letter, a form, or a calendar, you may print it as an  image. Next option is that you may need to update your printer driver   if the PDF does not print, the PDF prints as a blank page or with  unreadable text or if you get an error message when you print.  Sometimes, when you print a file that is on a thumb drive or a network,  the file gets damaged. Then you have to open the copy on your hard drive  and print again. At last, you can try printing the PDF using another  printer and check your printer connection too if the PDF does not get  printed. get more help to fix unable to printer PDF file hope this helps you.
    Good Luck!

  • I am unable to print "ALL Pages" using the Adobe Print plugin in Firefox, only the first page gets printes. however IE works perfectly fine.Please advise. Is it some way that firefox identifies the complete web page..? PLease help

    I am unable to print "ALL Pages" using the Adobe Print plugin in Firefox, only the first page gets printes. however IE works perfectly fine.Please advise. Is it some way that firefox identifies the complete web page..? PLease help

    Does the entire webpage appear in Print Preview? <br />
    File > Print Preview

  • I am unable to print anything while using firefox as my browser !

    i am unable to print anything while using firefox as my browser !

    Hi Philip,
    This could be an issue with some corrupt print preferences. In your toolbar go to about:config and reset all of your print.preferences. This could hopefully help!
    - Sarah

  • I am unable to print a copy using my 3510e printer

    I am unable to print a copy of a document using my 3510e printer

    Hi @birdhouse632 , do you run into an error when copying from your printer? Please check your printer firmware and install the latest firmware using the printer front panel as shown here. 
    Although I am an HP employee, I am speaking for myself and not for HP. *Say thanks by clicking the "Kudos! Star" which is on the left* Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves
    I work for HP but my posts and replies are my own.
    I work for HP but my posts and replies are my own.
    Click the Kudos star as a way to say "thank you" for helpful posts.
    Be sure to come back and click the 'Accept as Solution' button on the post that solved your issue - it may help someone else .....

  • Why am I unable to print 3x5 cards using a Cannon MX330?

    Why am I unable to print 3x5 cards typed on MacBook Pro and using a Cannon MX330 printer?

    You can try to reset print prefs on the <b>about:config</b> page.
    *http://kb.mozillazine.org/Problems_printing_web_pages
    *https://support.mozilla.org/kb/how-print-websites
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config

  • I am unable to print PDF's using either Adobe Reader or Safari. In Adobe Reader, I get an error message from my Cannon printer that says, "/usr.libexec/cups/filter/pstocupsraster failed". In Safari, I can only print the first page of a PDF.

    To try to resolve this problem, I have done the following actions.
    1 - I have run Disk Warrior.
    2 - I have repaired permissions.
    3 - I have deleted all plist that are either Cannon or Adobe.
    4 - I have downloaded and installed the lastest versions of Adobe Reader and the Cannon printer drivers.
    I am still unable to print PDF's.
    In Safari, I can print only the first page. In a multipage PDF, Safari only seems to recognize the first page.
    In Adobe Reader, I get an error message from my printer: "/usr/libexec/cups/filter/pstocupsraster failed".
    Any help would be greatly appreicated!

    Quit Safari.
    Open the Library folder in your home folder as follows:
    ☞ If running OS X 10.7 or later, hold down the option key and select Go ▹ Library from the Finder menu bar.
    ☞ If running an older version of OS X, select Go ▹ Go to Folder… from the Finder menu bar and copy the line below into the text box that opens:
    ~/Library
    Delete the following items from the Library folder:
    Caches/com.apple.Safari/Cache.db
    Preferences/com.apple.quicktime.plugin.preferences.plist
    Preferences/QuickTime Preferences
    Relaunch Safari and test.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running OS X 10.7 or later, open LaunchPad. Click Utilities, then Console in the page that opens.
    Select "/var/log/cups/error_log" from the file list. Post the messages from the time of the last printing attempt.
    Post the log text, please, not a screenshot. If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.

  • Am unable to print from Firefox (used to be able to) even though I can print from Safari....what should I try?

    have an up to date Firefox and was able to print to HP printer from internet until recently. I can print from internet using Safari so am sure that the problem is in some setting from Firefox. The printer is chosen in preferences and it seems to send a message to printer but only blank paper comes out....and ideas of what to try would be appreciated!

    Hi timcasey-
    I recommend you read this Support article on troubleshooting printing issues:
    [[Firefox prints incorrectly]]
    Hope that helps.

  • Unable to print special character in SAP script

    Hi,
      There is an address which needs to be hardcoded in a SAP Script form.
    It looks like:
    Česká republika s.r.o
    Karla Engliu0161e 3219/4
    Česká republika
    IČO:  25635972
    The letters which has got a tilde and sign above them are appearing as a hash '#' in print. I have tried uploading it as an image and as standard text. But still not working. Can someone help please?
    Thanks in advance,
    Anita

    Hello,
    Is your SAP Unicode? If no, then this can get very messy. If yes, I'd start with checking if the font used by the SAPScript supports that character.
    Regards,
    Michael

  • Unable to print in linux using java 1.5

    Hi i could't able to print in linux system using java 1.5. Printer name is detecting.
    when i execute printDataTransferCompleted then printJobNoMoreEvents happening But print is not happening.
    here i attached the source.
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.event.PrintJobEvent;
    import javax.print.event.PrintJobListener;
    public class HellowLinux {
         public static void main(String args[]){
              String printText = "The Java Tutorials are practical guides for programmers" ;
              DocFlavor byteFlavour = DocFlavor.BYTE_ARRAY.TEXT_PLAIN_UTF_8;
              Doc myDoc = new SimpleDoc(printText.getBytes(), byteFlavour, null);
              PrintService[] services = PrintServiceLookup.lookupPrintServices(byteFlavour, null);
              System.out.println("No of printer detected : "+services.length );
              for(int i = 0; i<services.length; i++){
                   System.out.println("Printer Name : "+services.getName());
              if(services.length > 0){
                   DocPrintJob myJob = services[0].createPrintJob();
                   myJob.addPrintJobListener(new PrintJobMonitor());
                   try{
                        myJob.print(myDoc, null);
                        System.out.println("Printed Successfully ... ");
                   }catch(Exception e){
                        System.out.println("Error : "+e.getMessage());
         private static class PrintJobMonitor implements PrintJobListener {
              public void printDataTransferCompleted(PrintJobEvent pje) {
                   // Called to notify the client that data has been successfully
              // transferred to the print service, and the client may free
              // local resources allocated for that data.
                   System.out.println("Data transfer Completed : "+pje.hashCode()
                             +"\n"+pje.getPrintEventType());
              public void printJobCanceled(PrintJobEvent pje) {
                   // Called to notify the client that the job was canceled
              // by a user or a program.
                   System.out.println("Cancelled : "+pje.hashCode()
                        +"\n Event Type "+pje.getPrintEventType());
              public void printJobCompleted(PrintJobEvent pje) {
                   // Called to notify the client that the job completed successfully.
                   System.out.println("Completed : "+pje.hashCode()
                             +"\n Event Type "+pje.getPrintEventType());
              public void printJobFailed(PrintJobEvent pje) {
                   // Called to notify the client that the job failed to complete
              // successfully and will have to be resubmitted.
                   System.out.println("Failed : "+pje.hashCode()
                             +"\n Event Type "+pje.getPrintEventType());
              public void printJobNoMoreEvents(PrintJobEvent pje) {
                   // Called to notify the client that no more events will be delivered.
                   System.out.println("No More Events : "+pje.hashCode()
                             +"\n Event Type "+pje.getPrintEventType());
              public void printJobRequiresAttention(PrintJobEvent pje) {
                   // Called to notify the client that an error has occurred that the
              // user might be able to fix.\
                   System.out.println("Requires Attention : "+pje.hashCode()
                             +"\n Event Type "+pje.getPrintEventType());
    Edited by: 936393 on May 24, 2012 12:08 AM

    Hi ,
    Go to Help menu >> update
    it will update your application to 13.1
    then go to  Editor 's Edit menu >> Preferences and click on Reset Preference on next launch .
    after that relaunch your application..
    Refer article for the same:
    https://helpx.adobe.com/photoshop-elements/kb/elements-printer-issue-incompatible-error.ht ml

  • Unable to print and to use scan doctor program

    I am not able to print to my personal home wireless network printer.  Others on the network can print.  I have an HP Officer Jet Pro 8600 which is not under warranty so I can't email or chat with a HP representative w/o paying.  I dowloaded the HP print and Scan Doctor 4.3 from the HP site, but that pogram stops running after a few seconds of running.    I have tried all of the "idiot" scenarios (turning off, starting sytem, etc)  and nothing resolves the issues to include deleting and installing the driver again.  I am runnig Windows 8.1 and McAfee antivirus.  PLEAE HELP so I can do my work!!!!!!

    Hello Frustrated99_,
    Welcome to the HP Support Forums! I understand you are not able to print wirelessly to your HP OfficeJet Pro 8600.What error messages do you get on the computer or front panel of the 8600? Are all the computers connected to the same network as the printer? Did this Windows computer come preinstalled with Windows 8.1 or did you recently upgrade the OS? If you upgraded the OS did you reinstall the new drivers for your 8600, or are you still using the older drivers from a previous OS?
    Please let me know the Exact model of 8600 you are currently using as well as the requested information so we can begin troubleshooting.
    Thanks,
    HevnLgh
    I work on behalf of HP
    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" to the left of the reply button to say “Thanks” for helping!

  • Unable to parse control character using regular expression & Pattern class

    I am trying to parse the Ctrl-X character from a string using the Pattern class but for some or the other reason it is not finding it.
    Here is the code that I wrote,
    Pattern p=Pattern.compile("\\cX");
    Matcher m=p.matcher(str);
    System.out.println(str+": "+m.find());
    the result is prop^Xau,bu,ca,en,fe,fi,ge,hj,ma,pe,re,sh,sr,tr^Yto^Xym^Yfmt^Xh : false
    where, str= prop^Xau,bu,ca,en,fe,fi,ge,hj,ma,pe,re,sh,sr,tr^Yto^Xym^Yfmt^Xh
    Thanks,
    Arunraj

    arunraj.nair wrote:
    I am trying to parse the Ctrl-X character from a string using the Pattern class but for some or the other reason it is not finding it.
    Here is the code that I wrote,
    Pattern p=Pattern.compile("\\cX");
    Matcher m=p.matcher(str);
    System.out.println(str+": "+m.find());
    the result is prop^Xau,bu,ca,en,fe,fi,ge,hj,ma,pe,re,sh,sr,tr^Yto^Xym^Yfmt^Xh : false
    where, str= prop^Xau,bu,ca,en,fe,fi,ge,hj,ma,pe,re,sh,sr,tr^Yto^Xym^Yfmt^XhWhat does str.length() give you? And posting, and trying with, a (much) shorter String might help you and others here to more easily see the problem.
    db

  • Unable to print double side using cannon D500 series

    Im using OS Lion..I could'nt enable the double sided printing in my printer..any suggestions pls..

    Depending on the application you are using you may need to press the Show Details button at the bottom of the print window to see the additional menus.
    For example, if you are using Preview and select to print you may see a window like below.
    If you press the Show Details button, as shown with a red box around it, you will then see a different view of the print dialog, as shown below.
    And as shown above, if you click on the Preview menu you will see Finishing, provided you have the D500 set as the printer.
    And with the Finishing menu selected you will see the ability to select 1-sided or 2-sided.

  • Unable tp print pdf's using vista

    We are not sure if this is a vista/adobe reader conflict, but we can't seem to print pdf's. We are using a HP Laser Jet 3055 printer. Any help or advice would be greatly appreciated.
    Thanks

    Dear user,
    Things are working just fine at our end. I would request you to please keep your application updated to latest release i.e. Acrobat 10.1.1 or Reader 10.1.1
    You may go to Help->Check for updates. Also, if the same problem exists then I would request you to please repair the installation by going to Help-->Repair Acrobat Installation.
    Thanks,
    Atul Agarwal
    Adobe Systems

  • Unable to print in PSE13 using windows 8.1

    I am running windows 8.1 and whenever I try to print in PSE13 I receive an error message about not enough memory on my external board. What does this mean and how do I resolve this? My printer is a Canon MG6320 and there is nothing in the print queue when I try to print. If I open up other programs, I am able to print just fine.

    Hi ,
    Go to Help menu >> update
    it will update your application to 13.1
    then go to  Editor 's Edit menu >> Preferences and click on Reset Preference on next launch .
    after that relaunch your application..
    Refer article for the same:
    https://helpx.adobe.com/photoshop-elements/kb/elements-printer-issue-incompatible-error.ht ml

Maybe you are looking for

  • Windows 8.1 black screen with mouse cursor after login (HP 2730P)

    I live in Canada and first just to confirm that Windows 8 with all Microsoft patches was running ok on my HP EliteBook 2730P NoteBook PC. Originally I had Windows XP running in it. With Win 8, I just lost few unique HP applications. But last night, j

  • PFAC rule for detrmining partner functions in Actions of Opportunity

    Hi all, In Opportunity, we have scheduled the actions automatically for every phase.When we select phase in Opportunity transaction & save , the activities in that pahse would be created automatically based on conditions with person responsible same

  • 'Resource Usage' field in Planner workbench

    Hi, Currently the 'Resource Usage' field in Planner Workbench > Item > Routing Operation > Resources doesn't not display decimal places. What do I need to change in profile option or preference or anywhere else so that atleast 1 place after decimal i

  • IDOC for Invoice Issue from Delivery

    Hi All, We have requirement in which we need to trigger an IDoc after PGI is done to create an Invoice. I want to know the BASIC TYPE , Outbound Function Module and Inbound Function Module which should be used? Kindly help. Regards

  • Fix variable alphabetizing in debug pane

    I have been trying to use Director 11 for months, but have more or less given up because of one problem that is probably very easy to fix: when debugging, it does not appear to be possible to have the list of variables sorted alphabetically. this mak