CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    2

    Print Paper settings java

    Hi Folks,
    I have been working on a Project in java for generating and print the labels. I can able to print the page with default settings, but i cant set the custom page width and height. How can we set the page width and height thru coding in java.

    Any help much appreciated.

    Thanks,

    With regards,
    Arun

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Print Paper settings java

    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    May 2012
    Posts
    2

    Re: Print Paper settings java

    Yeah. I only post over there. I need the solution.

  4. #4
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Print Paper settings java

    Cross posting wastes all of our time because we end up reading posts and answering them when they have already been answered elsewhere.

    If you must cross post, state in your thread that you have done so. At least then we won't duplicate answers. And when you get an answer close all the other threads down (and preferably point them to the correct answer) otherwise you will soon find people stop answering your questions.

    It also helps if you post the the relevant bit of code you are using so we can what you are trying to do.

    To answer your question:
    Create a Paper object with your label size and printable area and call setPaper() on the PageFormat object.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured