All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lowagie.text.pdf.VectorPrintBaseFont Maven / Gradle / Ivy

Go to download

This powerful reporting library aims to simplify producing reports using iText. Looking at producing reports with iText the most demanding tasks are how to get from data to report blocks, how to style those blocks and how to evaluate (debug) the resulting report. Exactly those three major tasks are well supported by the VectorPrint report library: - (combination of) xml configuration and annotations to transform existing Java data objects into report block - provide styling information (css like) seperate from code - a firebug like debug mode to help evaluate your report.

The newest version!
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lowagie.text.pdf;

/*
 * #%L
 * VectorPrintReport4.0
 * %%
 * Copyright (C) 2012 - 2013 VectorPrint
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public 
 * License along with this program.  If not, see
 * .
 * #L%
 */

import com.lowagie.text.DocumentException;
import static com.lowagie.text.pdf.BaseFont.fontCache;
import com.vectorprint.VectorPrintException;
import java.io.IOException;

/**
 *
 * @author Eduard Drenth at VectorPrint.nl
 */
public class VectorPrintBaseFont extends BaseFont {

   @Override
   int getRawWidth(int c, String name) {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public int getKerning(int char1, int char2) {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public boolean setKerning(int char1, int char2, int kern) {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   void writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) throws DocumentException, IOException {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   PdfStream getFullFontStream() throws IOException, DocumentException {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public float getFontDescriptor(int key, float fontSize) {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public String getPostscriptFontName() {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public void setPostscriptFontName(String name) {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public String[][] getFullFontName() {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public String[][] getAllNameEntries() {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public String[][] getFamilyFontName() {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   public boolean hasKernPairs() {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

   @Override
   protected int[] getRawCharBBox(int c, String name) {
      throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
   }

    
    public static void cacheAndEmbedBuiltInFont(String name, byte[] pfb) throws DocumentException, IOException, VectorPrintException {
       if (!BuiltinFonts14.containsKey(name)) {
          throw new VectorPrintException(name + " is not a builtin font");
       }
       Type1Font bf = new Type1Font(name, BaseFont.WINANSI, true, new byte[0], pfb, false);
       bf.embedded = true;
       bf.pfb = pfb;
       String key = name + "\n" + BaseFont.WINANSI + "\n" + Boolean.TRUE;
       fontCache.put(key, bf);
       key = name + "\n" + BaseFont.WINANSI + "\n" + Boolean.FALSE;
       fontCache.put(key, bf);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy