ContentsQuick StartPrecisely print a square
Previous: "Hello World!" - as a PDF document | Next: Basic Charting

Precisely print a square

One of the big advantages of using PDF is the ability to draw precise vector graphics very efficiently, and print them using the Adobe Acrobat Reader. As before, the changes to the previous code are minimal -> see the code

NOTE:

You should be aware that PDF coordinates use the coordinate system you learned in algebra, with the origin located in the lower left and positive Y going up. The units are measured in inches. This is different than you would find in many (scanline oriented) graphic packages.

When you run the hello3 servlet and view it in your browser, what you'll get should be something like this. Print it out and check the measurements.  For a good time, use the "Zoom" feature of the Acrobat reader to check out the corners.

Now here's what we did:

If you are clear on what we've done, this is a great time to take a break and have a look at the JavaDoc for the servlet utilities.


ContentsQuick StartPrecisely print a square
Previous: "Hello World!" - as a PDF document | Next: Basic Charting