Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
454 Table 14.1 Notation Prefix Infix Postfix C HAPTER 14 Mathematical notations Example + 10 6 10 + 6 10 6 + The imaging model Description Polish notation The common arithmetic and logical formula notation Reverse Polish notation Interpreters of the postfix notation are often stack-based. Operands are pushed onto a stack, and when an operation is performed, its operands are popped from a stack and its result pushed back on. This has the advantage of being easy to implement and very fast. When you look at the content stream snippets extracted from a PDF file using list- ing 14.1, you'll see operations such as -595 0 m , where -595 and 0 are the operands (in this case, representing a translation), and where m is the operator (which will cause the cursor to move 595 points to the left and 0 points up). In iText, this syntax is generated by the PdfContentByte class. This class was intro- duced in section 3.1, where you used it to draw paths and text at absolute positions-- to create a movie calendar, for instance. One of the member variables of this object is a ByteBuffer , storing the PDF syntax until it can be put into a stream object. This