Size of printed String

Hi
String s = "Hello";
System.out.println(s+"\t"):Is there any method to learn the size of Strings "in relation to Tabs".
I'm trying to pretty print at standard output some list of strings of different length and it gets messy
Array size = 3600
assassi     assass�     assassui     assass�
assachi     assach�     assachui     assach�
assazi     assaz�     assazui assaz� (crap here)
assessi     assess�     assessui     assess�
Like that.

You can use FontMetrics.getStringBounds() or use TextLayout
================================
Sincerely,
Melnikov V
AlarIT programmer
http://www.AlarIT.com
================================

Similar Messages

  • Setting Paper Size while printing reports in character mode report

    Hi
    I am using developer suite 10g and am able to print the reports in char mode.
    but i have a small problem, i am unable to select the paper size while printing
    i select the parameters in a form and click on run report button
    this button helps me to get the data print directly
    but it takes the paper size as 12" height every time.
    where as my requirement is for difftent sizes. like 6", 9" height
    if i can select the size at runtime i can get my work done.
    can any one help me in this. its very urgent.
    Regrads
    Bhaskar

    HI, I My self writing , who created this question, as I got sucess in changing the font size.
    my dflt.prt in printer folder has the following,
    printer "dflt"
    height 46
    width 130
    after page control(L)
    return control(M)
    linefeed control(J)
    code "1" esc "G"
    code "2" esc "H"
    code "3" esc "4"
    code "4" esc "5"
    code "5" esc "W1"
    code "6" esc "W0"
    code "7" esc "C"
    code "8" control(O)
    code "9" control(R)
    I am able to increase the font size using code &5 and & 6 for the fileds or lables in report.
    But how to reduce the font size ???
    which code should I use in printer file. Our dot matrix printer is of type EPSON.

  • How to allow domain users to customize  Adobe PDF  printer page size in Printer Preferences

    Hi
    I am able to customize  Adobe PDF  printer page size in Printer Preferences in admin login but not able to customize  Adobe PDF  printer page size in domian users login...
    can I have a solution to customize  Adobe PDF  printer page size in domin user login

    WOW! I was amazed to see that within minutes of posting my initial thread, I tried something that works.
    Apparently, the only way is will actually convert is if you select the regular Print option in the File tab. Then, change the Printer to Adobe PDF & the Paper Size to 11x17. It also worked for 36"x48" becuase I created a custom size named "Poster", so I changed the paper size to Poster & it worked!
    I hope this helps someone. I searched for an existing forum on this issue off & on for MONTHS before creating this thread. If anyone has any suggestions why the Adobe PDF tab /PDF Maker wouldn't work, I'd like to know.

  • How do i edit the font size of a String?

    hi.. im a student in programming this yr.. i wan to edit the font size of a String.. how can i do that? i only know that there is setFont.. can anyone help me?

    import java.awt.*;
    import javax.swing.*;
    public class EditFontSize extends JFrame {
        public EditFontSize() {
            initComponents();
        private void initComponents() {
            jPanel1 = new JPanel();
            jLabel2 = new JLabel();
            jLabel3 = new JLabel();
            jLabel4 = new JLabel();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Edit the font size ");
            jLabel2.setFont(new Font("Dialog", 0, 14));
            jLabel2.setText("Test");
            jPanel1.add(jLabel2);
            jLabel3.setFont(new Font("Dialog", 0, 18));
            jLabel3.setText("Test");
            jPanel1.add(jLabel3);
            jLabel4.setFont(new Font("Dialog", 0, 24));
            jLabel4.setText("Test");
            jPanel1.add(jLabel4);
            getContentPane().add(jPanel1, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-273)/2, (screenSize.height-118)/2, 273, 118);
        public static void main(String args[]) {new EditFontSize().setVisible(true);}
        private JLabel jLabel2;
        private JLabel jLabel3;
        private JLabel jLabel4;
        private JPanel jPanel1;
    }

  • How do I change the default paper size for printing?

    I am running Firefox 3.6.3. Recently, the default paper size for printing unexpectedly changed to a user-defined size of 3.00" x 4.57". It used to be letter size (8.5 x 11). The default paper size is 8.5 x 11 for everything else. I have tried changing the size in the preferences dialog box and then clicking "default", but after I close Firefox or if Firefox opens a new window, the default size switches back to 3.00" x 4.57". Does anyone know how to fix this?
    == This happened ==
    Every time Firefox opened
    == About 2 weeks ago

    In "mine" dutch firefox 3.6.12 there is no option to change paper-size see
    "about:config" Promise to be careful (and be!) Enter "print.postscript.paper_size" gives a empty screen
    "paper_size" gives a few results
    What about the numbers 4259872, 4784247 and what is the meaning of
    paper_size, paper_size_type , paper_size_unit

  • Set custom page size for printing

    I want to set a custom page size for printing some PDF three and four-page musical scores to roll paper on an Epson 1290 using Adobe Reader 9.3.4 on Ubuntu 10.04. The printer properties in the print dialog has a media size option, and one of the choices is "custom", but having chosen "custom", the dialog does not allow me to add the actual page size to the lpr printer command. I can see that when I choose "custom", the lpr command is
    lpr -P Stylus-Photo-1290 -o PageSize=Custom etc
    but what I need for a three page output, for example, is
    lpr -P Stylus-Photo-1290 -o PageSize=Custom.297x630mm etc
    and I can't see how to add the actual custom paper size. If I Ok the media size choice dialog with it just set to PageSize=Custom, I can see from the output preview in the print dialog that the actual page size that has been chosen is letter. The online Adobe doc for Reader 9 printing (http://help.adobe.com/en_US/Reader/9.0/content.html#heading2.3) says "For documents that are larger than the standard page size, go to File  > Page Setup.  Create a custom page size before you print your  document". The problem with that is that there is no "Page Setup" option on the File menu in the Unix version of Adobe Reader, only a "Print" option, which is where I already am.
    If I open the PDFs in Evince, it allows me to add the custom page sizes I want, but as Evince doesn't have the option to print multiple pages per sheet I can't use it either...

    Yes, it used to work, and the resize zoom bar used to work too (now its grayed out). I don't know if this is a "who's to blame for it" thing, but its not getting fixed and its pretty bad that no one seems to care enough even to respond. I found my own solution by opening it in Gimp. Just right click and select open with other ...Gimp and it will import into it. In the Gimp Print dialog, you have a scaling percentage in the "Page Setup" tab, and size settings in the "Image settings" plus loads of other stuff including multiple copies.

  • Print size does not default to form size when printing PDF form.

    So, we have created an interactive new client form for our firm. The form was created in LiveCycle Designer ES 8.2 and is set to legal size (8.5 x 14). After the form was completed and exported, it was filled out for testing and printed. During the printing process it was noticed that in the print dialog box, the dimentions for the form were wrong. It showed that the default document size was 8.5 x 11. Where and how is this changed in LC?
    A new form was created (starting from scratch) with the document settings set to legal again, and inside of LC in the PDF preview panel, I tried to print and the same thing occured.
    Please advise as how to set the document to its default size when printing without have to do it in the print dialog box.

    The print dialog doesn't display the forms dimensions but those of the currently selected paper format of your printer.
    If you change the page format in the printer driver the diemensions in the preview will change too.

  • How to measure the size of a string

    windows app store how to measure the size of a string?
    string str = "Hello word windows app store";

    if you need the actual width the string occupies in pixels than use (see
    this MSDN link for more details):
    Graphics.MeasureString(String, Font)
    if you only need the "length" of the string i.e. no. of characters than use (see
    this MSDN link for more details):
    str.Length
    dont forget to bing / google :)
    hope this helps!
    Graphics.MeasureString(String, Font) can not use in windows store app.
    TextBlock has Measure()
    method, as following:
    Size MeasureString(string content, Size availableSize, double fontSize, string fontFamily="Segoe UI")
        TextBlock tb = new TextBlock();
        tb.TextWrapping = TextWrapping.Wrap;
        tb.Text = content;
        tb.FontFamily = new Windows.UI.Xaml.Media.FontFamily(fontFamily);
        tb.FontSize = fontSize;
        tb.Measure(availableSize);
        return tb.DesiredSize;
    Test:
    string str = "Hello word windows app store";
    Size size = MeasureString(str, new Size(800, 600), 40);

  • Custom Print Size not printing to Epson 4900

    I had Epson Support on the phone yesterday as I have been unable to print anything wider than 22 inches from Lightroom 5.7 . The custom page size is 17" by 30". The tech took over my computer, made sure all was set up correctly. The lightroom print module showed the proper dimensions and the tech hit print. The print came out resized at 22 inches. The tech then opened the same photo in Photoshop CS5, set up a custom paper size to 17 by 30 and hit print. The print preview showed the proper dimensions and he sent it to the printer. The print came out perfectly at 17x 30. He had no explanation but said it had to be a lightroom problem and not a problem with the 4900
    All firmware and software updates have been downloaded to the printer. The computer is a IMac Intel running the latest OS. Does anyone have any ideas why the custom size will print properly from Photoshop, but not from Lightroom
    Thanks in advance

    I asked you a question in the Beginners forum. It usually isn't a good idea to post in more than one forum.

  • File is huge when combined or changed to PDF, how do I get the file to a normal size to print?

    Files are to large to print once they are PDF, how do I get them to a normal 8x11 size to print?

    So why is it when I send these PDF files to clients they are to large for clients to print?
    If I send a combined PDF file that is 3817KB, which a client has said is to large for them to print.
    I send it to our office manager, she will print it, scan it back to me as a PDF, it will come
    back as 375KB, the client can then print the file.
    My question is, was/is there something I need to change in the process of scanning, combining files
    to PDF that would create a smaller size file when done?
    Sorry for all the confusion
    Marilyn Bartunek
    Juffer Real Estate Inc.
    605-360-7703
    [email protected]
    Date: Tue, 1 Apr 2014 10:13:35 -0700
    From: [email protected]
    To: [email protected]
    Subject: file is huge when combined or changed to PDF, how do I get the file to a normal size to print?
        Re: file is huge when combined or changed to PDF, how do I get the file to a normal size to print?
        created by Test Screen Name in Creating, Editing & Exporting PDFs - View the full discussion
    Sorry, I'm lost.First I thought this was about page size. But you say it isn't. You say it's about file size.  You've combined files of 494 + 441 = 935 KB, and you get 944 KB. This seems fine and you say it is fine. So what is the problem? Are you now on still a third meaning of huge, about size on screen?
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6261540#6261540
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6261540#6261540
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6261540#6261540. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Creating, Editing & Exporting PDFs at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • CS5 & Manage Custom Sizes when printing.

    Every time I try to “manage custom sizes” when printing, Photoshop “quits unexpectedly.” I am using Photoshop CS5, and Epson 7800, and Mac Yosemite. I’ve done all the updates, and reinstalled the driver. Any ideas on troubleshooting?

    I am having the exact same problem with an Epson 3880.  I chatted with Epson support earlier today and they suggested that I uninstall the drivers and support software and reinstall.  I followed their instructions and the result was the same.  I did save my image file to a TIFF format and then opened it under Preview and when I used file->print and selected "manage custom sizes" it brought up the custom size menu as expected.  I also attempted this using Photoshop Elements 11 and the "manage custom sizes" menu appeared only in this case when I selected "Cancel" Elements crashed too.
    It is not clear to me how to proceed with kglad's recommendation to "shutdown running processes in a logical manner".  I don't know what a logical manner might be.
    Anyway, I have just done a complete uninstall of Photoshop CS5 and I'm about to reinstall it from the distribution DVD.  I think I'll test the "manage custom sizes" before I install the updates this time.
    I'd sure appreciate it if you come up with anything, that you would post it here.  Thanks
    So, I uninstalled Photoshop 5, restarted my iMac, and reinstalled Photoshop CS5.  When I attempted to Manage Custom Sizes, Photoshop CS5 blew up.
    I find that I can add custom sizes and manage them from Preview and then use them in Photoshop.  So, I guess that will have to suffice until someone comes up with a fix.  Given that Photoshop CS5 is no longer supported that will probably be never.
    Post here if something better comes along.

  • Change paper size when printing

    How to change paper size when printing pdf? No option for paper size appear.

    That is a feature of AirPrint. If you do a Google search on "AirPrint paper size" you'll find documentation from major printer manufacturers. For example, this is copied from some HP documentation:
    What paper and media sizes are supported? 
    With AirPrint, paper and photo media sizes are automatically selected depending on the application you are using on your Apple device, your HP ePrint printer, and the region in which you are using AirPrint. You do not have the option to select different paper sizes.
    For example, from Apple’s Photo application, if the HP ePrint printer has a separate photo paper tray, AirPrint uses 4 x 6 inch photo media as the default paper size. If the printer does not have a separate photo paper tray, AirPrint uses letter-size paper. If you are printing from Apple’s Safaribrowser, letter-size paper is the default paper size in the US region, and A4 is the default paper size in Europe.
    AirPrint supports the following paper and media sizes:
    Letter
    Legal
    A4
    4 x 6 in photo paper
    A6 photo paper

  • I customize my paper size and print size and am then viewing a photo on my screen. I print it out and it chops off about 5% of all edges of my original photo on the screen. Why does it do that? It is driving me crazy. I use an Epson Photo 2200 printer.

    I customize my paper size and print size and am then viewing a photo on my screen. I print it out and it chops off about 5% of all edges of my original photo on the screen. Why does it do that? It is driving me crazy. I use an Epson Photo 2200 printer

    What print and paper sizes are you using?  Are you trying to print a borderless print?  Does your printer support borderless for that particular size?  Are you printing to the custom stock size or to a larger stock size?
    OT

  • Does the pixel size affect printing in iphoto?

    Have trouble printing in iphoto.  I can view the photo in iphoto fine.  When I print, I am just getting a small corner of the picture.  Can the pixel size affect printing?

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • How to set text size when printi from a web page

    can't increase text size when printing a web page

    If you're using IE, click on View, Text Size and then whatever size you'd like.  You'll see the changes on the screen and it should print out the same way.
    Hope that helps.
    Say Thanks by clicking the Kudos thumbs up. Please mark the post that solves your problem as an Accepted Solution so other forum users can utilize the solution.
    I am an HP employee.

Maybe you are looking for

  • Error in Creation of Purchase Requisition through LSMW

    Hi   I am trying to craete a PR upload prog through LSMW batch input method. In the Specify File option I am giving the TXT file destination.The TXT file is saved at my desktop. But while saving it is givving an error as "No logical path has been spe

  • Enrollment pending for last 4 days

    I tried enrolling to IOS Developer program on 1st Sept 2014. However, till date, I have not got any response, it still says, 'enrollment pending' for last 4 days. Please help. My credit card was successfully charged. Can anyone please provide me the

  • ZDM Agent "Invalid Drive Path"

    We use Zenworks to install software and use the Zenworks folders to display the program shortcut icon. After installed, it will launch (Run options tab > Application > Path to file) and the program will start. I'm having an issue for the last couple

  • Rebuild folder structure

    Fortunately this is in my test environment. Wondering if there's any way to rebuild my primary domain folder structure from the secondary domain. I incorrectly updated a server with my primary domain and post office from sles11sp2 to sles11sp3 via bo

  • IPad usage unknown

    I have a 16GB iPad 2, and under usage it says over 11GB is used. But when I totaled the space that all the apps, photos, and videos took, it was only about 4GB. No music or movies are being stored. How do I clear this extra spa