1 50 51 package com.lowagie.text.pdf; 52 import java.io.IOException ; 53 54 import com.lowagie.text.DocumentException; 55 import com.lowagie.text.Image; 56 57 61 public class PdfImportedPage extends com.lowagie.text.pdf.PdfTemplate { 62 63 PdfReaderInstance readerInstance; 64 int pageNumber; 65 66 PdfImportedPage(PdfReaderInstance readerInstance, PdfWriter writer, int pageNumber) { 67 this.readerInstance = readerInstance; 68 this.pageNumber = pageNumber; 69 thisReference = writer.getPdfIndirectReference(); 70 bBox = readerInstance.getReader().getPageSize(pageNumber); 71 type = TYPE_IMPORTED; 72 } 73 74 79 public PdfImportedPage getFromReader() { 80 return this; 81 } 82 83 public int getPageNumber() { 84 return pageNumber; 85 } 86 87 88 97 public void addImage(Image image, float a, float b, float c, float d, float e, float f) throws DocumentException { 98 throwError(); 99 } 100 101 109 public void addTemplate(PdfTemplate template, float a, float b, float c, float d, float e, float f) { 110 throwError(); 111 } 112 113 115 public PdfContentByte getDuplicate() { 116 throwError(); 117 return null; 118 } 119 120 PdfStream getFormXObject() throws IOException { 121 return readerInstance.getFormXObject(pageNumber); 122 } 123 124 public void setColorFill(PdfSpotColor sp, float tint) { 125 throwError(); 126 } 127 128 public void setColorStroke(PdfSpotColor sp, float tint) { 129 throwError(); 130 } 131 132 PdfObject getResources() { 133 return readerInstance.getResources(pageNumber); 134 } 135 136 139 public void setFontAndSize(BaseFont bf, float size) { 140 throwError(); 141 } 142 143 void throwError() { 144 throw new RuntimeException ("Content can not be added to a PdfImportedPage."); 145 } 146 147 PdfReaderInstance getPdfReaderInstance() { 148 return readerInstance; 149 } 150 } 151 | Popular Tags |