- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Overview of the page boundaries in Java
Overview of the page boundaries QR Code 2d Barcode Creator In Java Using Barcode generation for Java Control to generate, create QR Code JIS X 0510 image in Java applications. www.OnBarcode.comQR Code Scanner In Java Using Barcode reader for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comUp until now, you ve defined the page size using a Rectangle as the value of one of the five different page boundaries that can exist for a page in a PDF document. You ll learn Generate Barcode In Java Using Barcode creator for Java Control to generate, create Barcode image in Java applications. www.OnBarcode.comQR-Code Creation In Java Using Barcode generator for Java Control to generate, create QR Code JIS X 0510 image in Java applications. www.OnBarcode.comOverview of the page boundaries
Creating UCC - 12 In Java Using Barcode encoder for Java Control to generate, create GS1 - 12 image in Java applications. www.OnBarcode.comMake Code 128 Code Set A In Java Using Barcode creator for Java Control to generate, create Code 128C image in Java applications. www.OnBarcode.commore about these boundaries in this section, and you ll work through an example that demonstrates the difference between the two most important page boundaries. Suppose that I wanted to avoid being accused of false modesty. I could try to print a poster measuring one square meter, featuring myself in a Superman outfit. Seriously! The famous commercial artist Dick Kline once made such a drawing. It was sent to me as a gift by Bill Segraves, a long-time iText user. The drawing isn t a raster image. It consists of a sequence of B zier curves that I ve copied into a text file named hero.txt. To do this, you d create a PdfTemplate from such a text file. QR-Code Maker In Java Using Barcode creator for Java Control to generate, create QR image in Java applications. www.OnBarcode.comMSI Plessey Generation In Java Using Barcode generator for Java Control to generate, create MSI Plessey image in Java applications. www.OnBarcode.comListing 5.15 Hero1.java
Encode Denso QR Bar Code In Objective-C Using Barcode creator for iPad Control to generate, create Denso QR Bar Code image in iPad applications. www.OnBarcode.comDrawing QR-Code In Java Using Barcode generation for Java Control to generate, create QR Code 2d barcode image in Java applications. www.OnBarcode.compublic PdfTemplate createTemplate(PdfContentByte content, Rectangle rect, int factor) throws IOException { PdfTemplate template = content.createTemplate( rect.getWidth(), rect.getHeight()); template.concatCTM(factor, 0, 0, factor, 0, 0); FileReader reader = new FileReader(RESOURCE); int c; while ((c = reader.read()) > -1) { template.setLiteral((char)c); } return template; } GS1 - 12 Drawer In Java Using Barcode creation for Android Control to generate, create UPC Symbol image in Android applications. www.OnBarcode.comBarcode Reader In VS .NET Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications. www.OnBarcode.comAs you can see, you can write literal PDF syntax to the direct content using the setLiteral() method. It accepts a char, a float, or a String value. Incorrect use of this method can result in seriously damaged PDF files. Please don t use it before you ve read chapter 14. In the next chapter, we ll return to this example and find a much better way to reuse existing content. ECC200 Drawer In Objective-C Using Barcode printer for iPhone Control to generate, create Data Matrix image in iPhone applications. www.OnBarcode.comQR Code JIS X 0510 Encoder In None Using Barcode generator for Microsoft Excel Control to generate, create QR Code JIS X 0510 image in Microsoft Excel applications. www.OnBarcode.comWARNING
Scan PDF 417 In Visual C# Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET applications. www.OnBarcode.comCode-39 Generation In VS .NET Using Barcode creator for Reporting Service Control to generate, create Code 39 Full ASCII image in Reporting Service applications. www.OnBarcode.comThe original drawing is intended to be added on an A4 page, but I want to put it on an A0 document, so I have to scale it with a factor 4 (see ISO-216). I could create a Document with PageSize.A0 like this: Scan Barcode In VB.NET Using Barcode Control SDK for .NET Control to generate, create, read, scan barcode image in .NET applications. www.OnBarcode.comCode128 Generation In Objective-C Using Barcode drawer for iPhone Control to generate, create ANSI/AIM Code 128 image in iPhone applications. www.OnBarcode.comDocument document = new Document(PageSize.A0); Create Code 39 Extended In VB.NET Using Barcode printer for .NET framework Control to generate, create Code 39 image in Visual Studio .NET applications. www.OnBarcode.comPrinting DataMatrix In None Using Barcode generator for Font Control to generate, create Data Matrix 2d barcode image in Font applications. www.OnBarcode.comThis line defines the media box of the first page in the document.
The media box
So far, you ve been creating documents with only one type of boundary: the media box. The media box defines the boundaries of the physical medium on which the page is to be printed. It may include any extended area surrounding the finished page for bleed, printing marks, or other such purposes. It may also include areas close to the edges of the medium that cannot be marked because of physical limitations of the output device. Content falling outside this boundary may safely be discarded without affecting the meaning of the PDF file. ISO-32000-1:2008, section 14.1.2 Table, cell, and page events
The A0 rectangle used in the code line at the end of the previous section is defined like this: public static final Rectangle A0 = new RectangleReadOnly(2384,3370); This corresponds to a physical medium measuring 2384 pt x 3370 pt (or 84.10 cm x 118.89 cm, or 33.11 in x 46.81 in). NOTE
The values 2384 and 3370 in this constructor match the width and height of the page, but they really form the coordinates of the upper-right corner of a rectangle. The values for the coordinate of the lower-left corner are omitted because they are zero: the lower-left coordinates are (0,0). When you learned how to add lines, shapes, and text at absolute positions in chapter 3, you assumed that the origin of the coordinate system coincided with the lowerleft corner of the page. This assumption is correct as long as the media box is defined with (0,0) as the coordinate for its lower-left corner, but that s not mandatory. It s perfectly OK for an application to create a media box with a different origin. It might be interesting to have the origin of the coordinate system in the upperleft corner of the page. Or you could place the origin in the middle of a page, so that you can distinguish four quadrants for your drawing operations. That s what I did when I created my Superman poster in PDF.
|
|