1 46 package com.lowagie.text.pdf; 47 48 import java.awt.color.ICC_Profile ; 49 50 import com.lowagie.text.ExceptionConverter; 51 52 57 58 class PdfICCBased extends PdfStream { 59 60 protected int NumberOfComponents; 61 62 PdfICCBased(ICC_Profile profile) { 63 super(); 64 try { 65 NumberOfComponents = profile.getNumComponents(); 66 switch (NumberOfComponents) { 67 case 1: 68 put(PdfName.ALTERNATE, PdfName.DEVICEGRAY); 69 break; 70 case 3: 71 put(PdfName.ALTERNATE, PdfName.DEVICERGB); 72 break; 73 case 4: 74 put(PdfName.ALTERNATE, PdfName.DEVICECMYK); 75 break; 76 default: 77 throw new PdfException(NumberOfComponents + " component(s) is not supported in PDF1.4"); 78 } 79 put(PdfName.N, new PdfNumber(NumberOfComponents)); 80 bytes = profile.getData(); 81 flateCompress(); 82 } catch (Exception e) { 83 throw new ExceptionConverter(e); 84 } 85 } 86 } 87 | Popular Tags |