Chapters
-
Introducing PDF and iText
-
Using iText's basic building blocks
-
Adding content at absolute positions
-
Organizing content in tables
-
Table, cell, and page events
-
Working with existing PDFs
-
Making documents interactive
-
Filling out interactive forms
-
Integrating iText in your web applications
-
Brightening up your PDF with color and images
-
Choosing the right font
-
Protecting your PDF
-
PDFs inside-out
-
The imaging model
-
Page content and structure
-
PDF streams
Chapter 14:
The imaging model
< Chapter 13: PDFs inside-out
Chapter 15: Page content and structure >
Chapter 14 of the book iText in Action 2E covers:
- The PDF Imaging Model
- All methods in
PdfContentByte - Using
Graphics2Dto create PDF content
This chapter dives straight into the PDF syntax.
You'll find tables listing all the possible graphics and text operators and operands available in PDF and iText.
This chapter serves as a reference that can be used to look up the meaning of the syntax in a PDF file,
and to find the iText methods that correspond with this syntax. You'll also be introduced to an alternative way
of creating content using
java.awt.Graphics2D.- 14.1: Examining the content stream
- 14.2: Path construction and painting operators
- 14.2.1: Constructing paths
- 14.2.2: Painting and clipping paths
- 14.2.3: Convenience methods to draw shapes
- 14.2.1: Constructing paths
- 14.3: Overview of the graphics state methods
- 14.3.1: Line characteristics
- 14.3.2: Colors
- 14.3.3: Changing the coordinate system
- 14.3.4: Affine transformations using Java
- 14.3.1: Line characteristics
- 14.4: Overview of the text and text state methods
- 14.4.1: Text state operators
- 14.4.2: Text-positioning and text-showing operators
- 14.4.3: Convenience methods for text
- 14.4.1: Text state operators
- 14.5: Using java.awt.Graphics2D
- 14.5.1: Drawing content to PdfGraphics2D
- 14.5.2: Drawing text to PdfGraphics2D
- 14.5.1: Drawing content to PdfGraphics2D
- 14.6: Summary
Consult the full table of contents, take a look at the
illustrations
from this chapter, or try out some of the
examples:
Figures
- Figure 14.1: Constructing and painting paths
- Figure 14.2: Constructing and painting shapes
- Figure 14.3: Examples demonstrating different line characteristics
- Figure 14.4: The current transformation matrix
- Figure 14.5: Demonstrating the different text state operators
- Figure 14.6: Demonstrating the convenience methods for text
- Figure 14.7: Graphics2D for Swing and PDF; the Pear example from the Java tutorial
- Figure 14.8: Combining JFreeChart and iText
- Figure 14.9: Demonstration and solution of the encoding problem
- Figure 14.10: Different strategies for drawing Asian fonts
- Figure 14.11: Different strategies for using mixed fonts
Examples
- GetContentStream
Keywords: Parsing PDF, PdfReader, Parsing PDF > read content stream - PathConstructionAndPainting
Keywords: curveTo method, Direct content, Graphics state, Graphics state stack, moveTo / lineTo, ColumnText > showTextAligned(), Graphics state > line characteristics - GraphicsStateOperators
Keywords: Graphics state, Lines, moveTo / lineTo, PdfTemplate, Graphics state > line characteristics - TransformationMatrix1
Keywords: Current Transformation Matrix, Graphics state, Graphics state stack, PdfTemplate, Rotation, Transformations - TransformationMatrix2
Keywords: Current Transformation Matrix, Graphics state, Graphics state stack, PdfTemplate, Rotation, Transformations - TransformationMatrix3
Keywords: Current Transformation Matrix, Graphics state, Graphics state stack, PdfTemplate, Rotation, Transformations - TextStateOperators
Keywords: Basefont, Kerning, Text state, Text state > Rendering mode - TextMethods
Keywords: Basefont, Current Transformation Matrix, Text state, PdfContentByte > showTextAligned() - PearExample
Keywords: Graphics2D, Java Swing - PearToPdf
Keywords: Graphics2D, Java Swing - DirectorCharts
Keywords: Graphics2D, Java Swing, JFreeChart, PdfTemplate - Graphics2DFonts
Keywords: Graphics2D, Java Swing, Font > Font family, Font > FontMapper - TextExample1
Keywords: Font, Graphics2D, Java Swing, Unicode - Text1ToPdf1
Keywords: Font, Graphics2D, Java Swing, Unicode, Font > FontMapper - Text1ToPdf2
Keywords: Font, Graphics2D, Java Swing, Unicode, Encoding > Identity-H, Font > FontMapper - TextExample2
Keywords: Font, Graphics2D, Java Swing, Unicode - Text2ToPdf1
Keywords: Font, Graphics2D, Java Swing, Unicode, Encoding > Identity-H, Font > FontMapper - Text2ToPdf2
Keywords: Chinese Japanese Korean, Font, Graphics2D, Java Swing, Unicode, Font > FontMapper - Text2ToPdf3
Keywords: Font, Graphics2D, Java Swing, Unicode, Graphics2D > Fonts as shapes - TextExample3
Keywords: Font, Graphics2D, Java Swing, Unicode - Text3ToPdf
Keywords: Font, Graphics2D, Java Swing, Unicode, Graphics2D > Fonts as shapes - TextExample4
Keywords: Font, Graphics2D, Java Swing, Unicode - Text4ToPdf
Keywords: Font, Graphics2D, Java Swing, Unicode, Encoding > Identity-H, Font > FontMapper
Content © 2010-2013 1T3XT BVBA
