How do I keep the information from getting cut off from the top and left sides of the page when I print using the Java 2D printing API?
Because many printers cannot print on the entire paper surface, the PageFormat specifies the imageable area of the page: this is the portion of the page in which it’s safe to render. The specification of the imageable area does not alter the coordinate system; it is provided so that the contents of the page can be rendered so that they don’t extend into the area where the printer can’t print. If you find that information is clipped from your page, you might need to translate the information to the imageable area of the page, as shown in this sample: public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException { Graphics2D g2 = (Graphics2D)g; g2.translate(pf.getImageableX(), pf.getImageableY() + 72); …
Related Questions
- How do I keep the information from getting cut off from the top and left sides of the page when I print using the Java 2D printing API?
- Im having trouble printing my listing to use as a brochure; the right side of the page is cut off; how can I print the whole thing?
- When printing the PCard web pages, the right margin is cut off. How can I print the entire page?